计算机在材料科学中的应用上机教程 精品Word格式文档下载.docx
- 文档编号:7479288
- 上传时间:2023-05-08
- 格式:DOCX
- 页数:77
- 大小:9.54MB
计算机在材料科学中的应用上机教程 精品Word格式文档下载.docx
《计算机在材料科学中的应用上机教程 精品Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《计算机在材料科学中的应用上机教程 精品Word格式文档下载.docx(77页珍藏版)》请在冰点文库上搜索。
例1-33
例1-44
例1-55
例1-66
例1-76
例1-87
实验02:
非线性方程求解9
例2-1用对分法求f(x)=x^3-7.7*x^2+19.2*x-15.3在区间【1,2】之间的根。
9
例2-2求代数方程x^3-2*x-5=0,在x0=2附近的根。
10
例2-3
例2-4用牛顿迭代法求方程
在x0=1附近的零点。
11
例2-5用割线法求方程
的根(取x0=1.5,x1=4)。
12
例2-6:
用牛顿迭代法解下列非线性方程组13
实验03:
线性方程组的迭代求解15
简单迭代计算机算法15
例3-1用简单迭代格式解下列方程组15
紧凑迭代计算机算法16
例3-2用简单迭代格式解下列方程组16
松弛迭代计算机算法18
例3-3用简单迭代格式解下列方程组18
实验04基于matlab的微分方程数值解20
例4-3用庞格-库塔公式,求解下列初值问题。
20
例4-4:
微分方程组数值解21
实验作业:
教材page88第5题21
实验05偏微分方程数值解22
例5-1:
用数值法求解下列偏微分方程:
22
例5_1:
例5_2:
(第五章课后习题2)30
实验06:
有限元法解微分方程34
中篇分析应用篇36
实验07:
泡沫材料泡孔(颗粒)大小及形状分析36
实验08:
简单流动POLYFLOW模拟与分析(课堂讲授)41
实验09:
聚合物熔体与口模间传热的非等温流动POLYFLOW模拟与分析42
实验10:
2.5D轴对称挤出POLYFLOW模拟与分析43
实验11:
chemoffice2008在材料科学中的应用44
1、分子构象位垒44
2、红外光谱预测45
3、核磁共振谱预测51
4、计算过渡态能量55
实验12:
MatrialsStudio在材料科学中的应用58
1.建立全同立构PMMA。
58
2、聚合物与金属氧化物表面的相互作用60
实验13:
Office、Origin等在材料科技论文写作中的应用70
实验14:
材料科学中matlab图像处理基础71
实验15:
SurfaceEvolver在材料科学研究中的应用73
上篇数据处理及过程模拟
实验数据及模型参数拟合方法
实验平台:
matlab2012b
实验目的:
lsqcurvefit的使用;
实验原理:
lsqcurvefitsolvesnon-linearleastsquaresproblems.
lsqcurvefitattemptstosolveproblemsoftheform:
minsum{(FUN(X,XDATA)-YDATA).^2}
whereX,XDATA,YDATAandthevaluesreturnedbyFUNcanbevectorsormatrices.
X=lsqcurvefit(FUN,X0,XDATA,YDATA)startsatX0andfindscoefficients
XtobestfitthenonlinearfunctionsinFUNtothedataYDATA(inthe
least-squaressense).FUNacceptsinputsXandXDATAandreturnsa
vector(ormatrix)offunctionvaluesF,whereFisthesamesizeas
YDATA,evaluatedatXandXDATA.NOTE:
FUNshouldreturnFUN(X,XDATA)
andnotthesum-of-squaressum((FUN(X,XDATA)-YDATA).^2).
((FUN(X,XDATA)-YDATA)issquaredandsummedimplicitlyinthealgorithm.)
实验举例:
单变量拟合
》x=7:
2:
47
x=
7911131517192123252729313335373941434547
》y=9:
3:
69
y=
91215182124273033363942454851545760636669
定义函数模型:
》f1=inline('
a
(1)+a
(2)*x'
'
a'
x'
)
f1=
Inlinefunction:
f1(a,x)=a
(1)+a
(2)*x
》[a1,resnormal1]=lsqcurvefit(f1,[1,1],x,y)
Localminimumfound.
Optimizationcompletedbecausethesizeofthegradientislessthan
thedefaultvalueofthefunctiontolerance.
a1=
-1.50001.5000
resnormal1=
7.0682e-28
例1-2
定义二次函数模型
》f2=inline('
a
(1)+a
(2)*x+a(3)*x.^2'
f2=
f2(a,x)=a
(1)+a
(2)*x+a(3)*x.^2
》x2=-3:
3
x2=
-3-2-10123
》y2=[4230-1-2-5]
y2=
4230-1-2-5
》[a2,resnormal2]=lsqcurvefit(f2,[0.5,-1,0],x2,y2)
a2=
0.6667-1.3929-0.1310
resnormal2=
3.0952
多变量拟合
例1-3
》x3=[100200300500100700800;
2410.3534]
x3=
100.0000200.0000300.0000500.0000100.0000700.0000800.0000
2.00004.00001.00000.30005.00003.00004.0000
》y3=[1.1272.4162.2052.3121.4846.0387.325]
y3=
1.12702.41602.20502.31201.48406.03807.3250
定义传热实验模型函数
》f3=inline('
c
(1)*x(1,:
).^c
(2).*x(2,:
).^c(3)'
c'
f3=
f3(c,x)=c
(1)*x(1,:
).^c(3)
》[a3,resnormal3,RESIDUAL3]=lsqcurvefit(f3,[0.020.50.2],x3,y3)
a3=
0.02300.80000.3000
resnormal3=
2.6650e-07
RESIDUAL3=
1.0e-03*
0.13580.1653-0.1808-0.0250-0.22560.3005-0.2151
例1-4
利用解矛盾方程的方法,用二次多项式
函数拟合以下数据.
序号
X
Y
1
-3
4
5
-1
2
-2
6
3
7
-5
》A=[1-39;
1-24;
1-11;
100;
111;
124;
139]
A=
1-39
1-24
1-11
100
111
124
139
》Y=[4230-1-2-5]'
Y=
4
2
3
0
-1
-2
-5
》inv(A'
*A)*(A'
*Y)
ans=
0.666666666666667
-1.392857142857143
-0.130952380952381
例1-5
》x5=[-3-2-124]
x5=
-3-2-124
》y5=[14.38.34.78.322.7]
y5=
14.30008.30004.70008.300022.7000
》f5=inline('
a
(1)+a
(2)*x.^3'
)
f5=
f5(a,x)=a
(1)+a
(2)*x.^3
》[a5resnorm5]=lsqcurvefit(f5,[10,0],x5,y5)
a5=
10.67510.1368
resnorm5=
112.0147
例1-6
》x6=[12345678]
x6=
12345678
》y6=[15.320.527.436.649.165.687.8117.6]
y6=
15.300020.500027.400036.600049.100065.600087.8000117.6000
》f6=inline('
a
(1)*exp(a
(2)*x)'
f6=
f6(a,x)=a
(1)*exp(a
(2)*x)
》[a6,resnormal6]=lsqcurvefit(f6,[10,0],x6,y6)
a6=
11.42410.2914
resnormal6=
0.0119
例1-7
》x7=[1123;
135-1;
1-125]
x7=
1123
135-1
1-125
》y7=[2-11-2]
y7=
2-11-2
》f7=inline('
a
(1)*x(1,:
)+a
(2)*x(2,:
)+a(3)*x(3,:
)'
f7=
f7(a,x)=a
(1)*x(1,:
》[a7,resnormal7]=lsqcurvefit(f7,[0,0,0],x7,y7)
a7=
-1.59170.58990.7572
resnormal7=
5.4712
例1-8
》x8=[-23.7-10010203040]+273.15
x8=
249.4500263.1500273.1500283.1500293.1500303.1500313.1500
》y8=[0.1010.1740.2540.3590.4950.6620.880]/0.101325*760
y8=
1.0e+03*
0.75761.30511.90522.69273.71284.96546.6005
》fun8=inline('
exp(a
(1)-a
(2)./(x+a(3)))'
fun8=
fun8(a,x)=exp(a
(1)-a
(2)./(x+a(3)))
》[a8,resnormal8]=lsqcurvefit(fun8,[14,2000,-15],x8,y8)
Localminimumpossible.
lsqcurvefitstoppedbecausethefinalchangeinthesumofsquaresrelativeto
itsinitialvalueislessthanthedefaultvalueofthefunctiontolerance.
a8=
0.01722.5921-0.0035
resnormal8=
842.1467
》y88=exp(a8
(1)-a8
(2)./(x8+a8(3)))
y88=
0.75441.31551.90482.68613.69914.98656.5934
》(y88-y8)./y8
-0.00420.0079-0.0002-0.0024-0.00370.0042-0.0011
非线性方程求解
方法1:
》x=solve('
x^3-7.7*x^2+19.2*x-15.3'
1.7
3.0
3.0
方法2:
新建一个script文件,文件名为half2root.m,输入如下语句。
clc;
clearall;
a=1;
b=2;
fa=a^3-7.7*a^2+19.2*a-15.3;
fb=b^3-7.7*b^2+19.2*b-15.3;
c=(a+b)/2;
fc=c^3-7.7*c^2+19.2*c-15.3;
whileabs(fc)>
0.5*10^(-4)
c=(a+b)/2;
fc=c^3-7.7*c^2+19.2*c-15.3;
iffb*fc>
0b=c;
fb=fc;
elsea=c;
fa=fc;
end
end
formatlong
fx=fc,x=c
》half2root
fx=
2.062949538128578e-05
1.700012207031250
》fsolve('
x^3-2*x-5'
2)
Equationsolved.
fsolvecompletedbecausethevectoroffunctionvaluesisnearzero
asmeasuredbythedefaultvalueofthefunctiontolerance,and
theproblemappearsregularasmeasuredbythegradient.
2.094551481698583
先建立文件名为nonlineequation.m的脚本文件。
文件内容如下:
functionF=nonlineequation(x)
F=[0.02*x
(1)^2-x
(1)+0.1*x
(2)^2+1;
0.1*x
(1)^2-x
(2)+0.01*x
(2)^3+2];
》fsolve(@(x)nonlineequation(x),[0,0])
1.63192.4055
方法2:
%Newton_method_solve_equation.m
clearall
symsx
f=x^3-7.7*x^2+19.2*x-15.3
x0=1
err=1
while(err>
0.00001)
x_tmp=x0-subs(f,x,x0)/subs(diff(f,x,1),x,x0);
err=norm(x_tmp-x0,inf)
x0=x_tmp
x0
err
》Newton_method_solve_equation
f=
x^3-(77*x^2)/10+(96*x)/5-153/10
x0=
err=
0.4118
1.4118
0.2115
1.6232
0.0691
1.6923
0.0076
1.6999
8.9619e-05
1.7000
1.2357e-08
1.2357e-08
%chord_method_solve_equation.m
symsx;
x0=1.5
x1=3
err=1;
x_tmp=x1-subs(f,x,x1)*(x1-x0)/(subs(f,x,x1)-subs(f,x,x0));
err=norm(x_tmp-x1,inf);
x0=x1;
x1=x_t
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算机在材料科学中的应用上机教程 精品 计算机 材料科学 中的 应用 上机 教程