微分方程数值解法课程设计许.doc
《微分方程数值解法课程设计许.doc》由会员分享,可在线阅读,更多相关《微分方程数值解法课程设计许.doc(10页珍藏版)》请在咨信网上搜索。
1、微分方程数值解法课程设计-A组 计算022班3号 许*1. 用复化梯形计算积分解:算法思想:根据复化梯形公式:取步长,有,写出程序,如下所示:N=100;a=0;b=10;h=(b-a)/N;T=zeros(0,N);for j=1:N T(j)=0.5*h*exp(-(a+h*(j-1).2)+exp(-(a+h*j).2) t=sum(T)end运行结果:t = 0.88622. 用Euler、改进的Euler法、梯形法、R-K法解 解:根据算法思想:(1)Euler法 (2)改进的Euler法(3)梯形法(4)R-K法我们可以写出程序如下所示:format long;N=100;h=1/
2、N;%步长U=zeros(1,N+1);%eulerT=zeros(1,N+1);%真解X=zeros(1,N+1);R=zeros(4,N+1);%误差G=zeros(1,N+1);%改进euleO=zeros(1,N+1);%梯形法K=zeros(1,N+1)%R-K法c=zeros(1,4);a=0;for j=2:N+1; X(j)=h*(j-1);endU(1)=1T(1)=1;G(1)=1;X(1)=0;O(1)=1;K(1)=1;for j=1:N U(j+1)=U(j)+h*(U(j)+X(j); %euler法公式 a=G(j)+h*(G(j)+X(j); G(j+1)=G(
3、j)+h/2*(G(j)+X(j)+a+X(j+1); %改进的euler法公式 b=O(j)+h*(O(j)+X(j); for i=1:10 O(j+1)=O(j)+h/2*(G(j)+X(j)+b+X(j+1); %梯形法公式 b=O(j+1);endc(1)=K(j)+X(j);c(2)=K(j)+h/2*c(1)+(X(j)+h/2);c(3)=K(j)+h/2*c(2)+(X(j)+h/2);c(4)=K(j)+h*c(3)+(X(j)+h);K(j+1)=K(j)+h/6*(c(1)+2*c(2)+2*c(3)+c(4);%四阶R-K法公式 T(j+1)=-X(j+1)-1+2*
4、exp(X(j+1); %真实值 R(1,j+1)=U(j+1)-T(j+1); %EULER法误差 R(2,j+1)=G(j+1)-T(j+1); %改进的EULER法误差 R(3,j+1)=O(j+1)-T(j+1); %梯形法误差 R(4,j+1)=K(j+1)-T(j+1); %四阶R-K法误差end真实值T:11.01011.02041.03091.04161.05251.06371.0751.08661.09831.11031.12261.1351.14771.16051.17371.1871.20061.21441.22851.24281.25741.27221.28721.30
5、251.31811.33391.34991.36631.38291.39971.41691.43431.45191.46991.48811.50671.52551.54461.5641.58361.60361.62391.64451.66541.68661.70811.731.75211.77461.79741.82061.84411.86791.8921.91651.94131.96651.99212.0182.04422.07092.09792.12522.1532.18112.20962.23852.26782.29742.32752.3582.38892.42022.45192.484
6、2.51662.54952.58292.61682.65112.68582.7212.75662.79272.82932.86632.90382.94182.98033.01923.05863.09863.1393.183.22143.26343.30593.34893.39253.4366欧拉法U值:11.011.02021.03061.04121.0521.0631.07431.08571.09741.10921.12131.13371.14621.15891.17191.18521.19861.21231.22621.24041.25481.26941.28431.29951.31491
7、.33051.34641.36261.3791.39571.41271.42991.44741.46521.48321.50151.52021.53911.55821.57771.59751.61761.6381.65861.67961.70091.72251.74451.76671.78931.81221.83541.85891.88281.9071.93161.95651.98182.00742.03342.05972.08642.11352.14092.16872.19692.22552.25442.28382.31352.34372.37422.40512.43652.46832.50
8、042.5332.56612.59952.63342.66782.70252.73782.77342.80962.84622.88322.92082.95882.99733.03623.07573.11573.15613.19713.23853.28053.3233.36613.4096改进的欧拉法G值:11.01011.02041.03091.04161.05251.06371.0751.08661.09831.11031.12261.1351.14771.16051.17371.1871.20061.21441.22851.24281.25731.27211.28721.30251.318
9、1.33381.34991.36621.38281.39971.41681.43421.45191.46991.48811.50661.52551.54461.56391.58361.60361.62391.64451.66541.68661.70811.731.75211.77461.79741.82061.8441.86781.8921.91651.94131.96651.9922.01792.04422.07082.09782.12522.15292.1812.20952.23842.26772.29742.32752.35792.38882.42012.45182.48392.5165
10、2.54952.58292.61672.6512.68582.72092.75662.79272.82922.86632.90382.94172.98023.01913.05863.09853.13893.17993.22133.26333.30583.34883.39243.4365梯形法O值:11.01011.02041.03091.04161.05251.06371.0751.08661.09841.11031.12261.1351.14771.16061.17371.1871.20061.21441.22851.24281.25741.27221.28721.30251.31811.3
11、3391.34991.36631.38291.39971.41691.43431.45191.46991.48811.50671.52551.54461.5641.58371.60361.62391.64451.66541.68661.70821.731.75221.77461.79751.82061.84411.86791.8921.91651.94141.96651.99212.0182.04422.07092.09792.12522.1532.18112.20962.23852.26782.29742.32752.3582.38892.42022.45192.4842.51662.549
12、52.5832.61682.65112.68582.7212.75672.79272.82932.86632.90382.94182.98033.01923.05873.09863.1393.183.22143.26343.30593.34893.39253.4366R-K法K值:11.01011.02041.03091.04161.05251.06371.0751.08661.09831.11031.12261.1351.14771.16051.17371.1871.20061.21441.22851.24281.25741.27221.28721.30251.31811.33391.349
13、91.36631.38291.39971.41691.43431.45191.46991.48811.50671.52551.54461.5641.58361.60361.62391.64451.66541.68661.70811.731.75211.77461.79741.82061.84411.86791.8921.91651.94131.96651.99212.0182.04422.07092.09792.12522.1532.18112.20962.23852.26782.29742.32752.3582.38892.42022.45192.4842.51662.54952.58292
14、.61682.65112.68582.7212.75662.79272.82932.86632.90382.94182.98033.01923.05863.09863.1393.183.22143.26343.30593.34893.39253.4366误差R值:第一组0-0.00010033-0.00020268-0.00030707-0.00041353-0.00052209-0.00063279-0.00074566-0.00086072-0.00097802-0.0010976-0.0012194-0.0013436-0.0014702-0.0015992-0.0017306-0.00
15、18645-0.0020008-0.0021398-0.0022813-0.0024254-0.0025722-0.0027217-0.002874-0.003029-0.0031868-0.0033475-0.0035111-0.0036777-0.0038472-0.0040198-0.0041954-0.0043742-0.0045561-0.0047412-0.0049296-0.0051213-0.0053163-0.0055147-0.0057166-0.0059219-0.0061308-0.0063433-0.0065595-0.0067793-0.0070029-0.0072
16、303-0.0074615-0.0076966-0.0079358-0.0081789-0.0084261-0.0086775-0.008933-0.0091928-0.0094569-0.0097254-0.0099983-0.010276-0.010558-0.010844-0.011135-0.011431-0.011732-0.012038-0.012349-0.012664-0.012985-0.013311-0.013642-0.013979-0.014321-0.014668-0.015021-0.015379-0.015743-0.016113-0.016489-0.01687
17、-0.017258-0.017651-0.018051-0.018457-0.01887-0.019288-0.019714-0.020146-0.020584-0.02103-0.021482-0.021941-0.022407-0.02288-0.023361-0.023849-0.024344-0.024847-0.025358-0.025876-0.026402-0.026936第二组0-3.3417e-007-6.7505e-007-1.0228e-006-1.3774e-006-1.739e-006-2.1078e-006-2.4838e-006-2.8672e-006-3.258
18、e-006-3.6564e-006-4.0624e-006-4.4763e-006-4.8981e-006-5.3278e-006-5.7658e-006-6.212e-006-6.6665e-006-7.1296e-006-7.6014e-006-8.0818e-006-8.5712e-006-9.0696e-006-9.5772e-006-1.0094e-005-1.062e-005-1.1156e-005-1.1702e-005-1.2257e-005-1.2822e-005-1.3398e-005-1.3983e-005-1.458e-005-1.5186e-005-1.5804e-0
19、05-1.6432e-005-1.7071e-005-1.7722e-005-1.8384e-005-1.9057e-005-1.9742e-005-2.0439e-005-2.1148e-005-2.1869e-005-2.2603e-005-2.3349e-005-2.4108e-005-2.4879e-005-2.5664e-005-2.6462e-005-2.7273e-005-2.8098e-005-2.8937e-005-2.979e-005-3.0657e-005-3.1539e-005-3.2435e-005-3.3346e-005-3.4272e-005-3.5213e-00
20、5-3.617e-005-3.7142e-005-3.8131e-005-3.9135e-005-4.0156e-005-4.1193e-005-4.2247e-005-4.3318e-005-4.4407e-005-4.5513e-005-4.6636e-005-4.7778e-005-4.8938e-005-5.0116e-005-5.1313e-005-5.2529e-005-5.3765e-005-5.502e-005-5.6294e-005-5.7589e-005-5.8904e-005-6.024e-005-6.1596e-005-6.2974e-005-6.4373e-005-6
21、.5794e-005-6.7237e-005-6.8703e-005-7.0191e-005-7.1702e-005-7.3236e-005-7.4794e-005-7.6376e-005-7.7982e-005-7.9613e-005-8.1269e-005-8.2949e-005-8.4656e-005-8.6388e-005-8.8147e-005-8.9932e-005第三组01.6834e-0073.3755e-0075.076e-0076.7848e-0078.5018e-0071.0227e-0061.196e-0061.3701e-0061.5449e-0061.7205e-0
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 微分方程 数值 解法 课程设计
1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前自行私信或留言给上传者【精***】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时私信或留言给本站上传会员【精***】,需本站解决可联系【 微信客服】、【 QQ客服】,若有其他问题请点击或扫码反馈【 服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【 版权申诉】”(推荐),意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:4008-655-100;投诉/维权电话:4009-655-100。