您好,欢迎访问三七文档
当前位置:首页 > 办公文档 > 会议纪要 > 偏微分方程数值解法13
1/16《偏微分方程数值解法》13——差分格式的矩阵分析变系数方程差分格式有限体积法简介差分格式的矩阵MATLAB创建矩阵2/16变系数两点边值问题)(,)0(0),(LuuLxxfcuubujjjjxjjxfucuhbuh2122二阶差分格式jjjjjjjjjfucuuhbuuuh)(2)2(111112jjch22记2/1jjhb2/1jjhbjjfhF2三对角矩阵A=TriDiag{}jjj,,AU=F3/16四阶差分逼近)(121121214222222hOLhLbhbhxxx四阶差分格式jjxjxjxuLhLubhbh)121()12121(222222)(xfcuubuxxbDDL2jjjjfucLu1)3()2(1)1(11jjjjjjjjjjjjfrfrfruuu4/16),(),(]),([]),([yxfuyxcyuyxbyxuyxax差分格式ijijijijyijyijxijxfucubhuah][1][122其中jijiijxuuu,2/1,2/12/1,2/1,jijiijyuuujijiijjijijijiuauaaua,1,2/1,2/1,2/1,1,2/1)()]([][,2/1,2/1jijiijxijxijxuuaua)()(,1,2/1,1,2/1jiijjiijjijiuuauua变系数二维问题5/16同理1,2/1,2/1,2/1,1,2/1,)(][jijiijjijijijiijyijyububbubub计算模板41032其中2/1,2jiajia,2/13jia,2/112/1,4jiaijjijijijicaaaa2/1,2/1,,2/1,2/10ijfh2练习:设2)1,0(),(yx写出差分格式对应的矩阵6/16变量代换方法引入新函数xuvyuw),(),(]),([]),([yxfuyxcyuyxbyxuyxax),(),(]),([]),([yxfuyxcwyxbyvyxax由于)(6121432hODhDhxxx)(12222hODhxx)()611(422hODDhxx)()611(42hODxx7/16原微分方程变换后的差分形式为][21]4[61,1,1,1,1jijijiijjiuuhvvv][21]4[611,1,1,1,jijijiijjiuuhvww])[611(21])[611(211,1,1,1,2,1,1,1,12jijijijixjijijijiywbwbhvavahijyxijijyxfuc)611)(611())(611)(611(2222补充方程如下)4(61)611(,1,12jiijjiijxuuuu8/16有限体积法在求解区域上选择的一个局部区域进行积分.以内网格点(xi,yj)为中心的局部积分区域},|),{(21,21,,21,21jijijijiijyyyxxxyx2/12/12/12/1]),([]),([jjiiijyyxxDdxxuyxaxdydxdyxuyxax2/12/1]),(),([2/12/1jjyyiidyxuyxaxuyxa利用数值积分的中矩形公式,上式近似等于9/16)],(),(),(),([2/12/12/12/1jijijijiyxxuyxayxxuyxah利用差商近似一阶导数,有近似表达式)()(]),([,1,2/1,1,2/1jiijjiijjijiDuuauuadxdyxuyxaxij)()(]),([1,2/1,2/1,2/1,jiijjiijjijiDuubuubdxdyyuyxbyij同理根据数值求积公式ijDfhdxdyyxfij2),(结果与直接差分格式同10/16特殊三对角矩阵0110110S对称三对角矩阵TSI二阶差分算子2112112TSI22x01101100T11/16x01101100Tjjjjxjjxfucuhbuh2122两点边值问题二阶差分格式系数矩阵IDhTDhTAcb202其中Db=Diag{b1,······,bN-1}Dc=Diag{c1,······,cN-1}12/16二维泊松方程ijijyxfuh)(1222系数矩阵)(ITTIA五点差分格式),()(2222yxfyuxu二维Helmholtz方程),(2yxfukuijijijyxfukuh2222)(1系数矩阵IIkhITTIA22五点差分格式13/16二维对流扩散方程),(yxfruqupuuuyxyyxx),(yxfruuPuP=[p,q]ijijyxyxfurqph])([1222系数矩阵IrIIqTTpIITTIA00)(差分格式MATLAB的张量积运算kron(X,Y)istheKroneckertensorproductofXandY14/16三对角矩阵创建方法n=4;E=eye(n);sub=diag(ones(n-1,1),1)T0=sub-sub‘T=-2*E+sub+sub'T0=0100-10100-10100-10T=-21001-21001-21001-2sub=010000100001000015/16)(ITTIA矩阵创建方法n=3;E=eye(n);sub=diag(ones(n-1,1),1);T=-2*E+sub+sub‘;A=-(kron(E,T)+kron(T,E))A=4-10-100000-14-10-100000-1400-1000-1004-10-1000-10-14-10-1000-10-1400-1000-1004-100000-10-14-100000-10-14spy(A)16/16IrIIqTTpIITTIA00)(创建矩阵n=4;E=eye(n);sub=diag(ones(n-1,1),1);T0=sub-sub;T=-2*E+sub+sub';A=-(kron(E,T)+kron(T,E));p=1;q=1;r=1;A=A+p*kron(E,T0)+q*kron(T0,E);A=A+r*kron(E,E);Spy(A)
本文标题:偏微分方程数值解法13
链接地址:https://www.777doc.com/doc-4918206 .html