欢迎来到天天文库
浏览记录
ID:38352299
大小:52.37 KB
页数:10页
时间:2019-06-10
《数值法求解微分方程》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、数值法求解微分方程P168第27题建立一个M的函数文件functionxdot=exf(t,x)u=1-2*t;xdot=[01;1-t]*x+[01]'*u;再新建一个M文件t0=0;tf=pi;x0t=[0.1;0.2];[t,x]=ode23('exf',[t0,tf],x0t)y1=x(:,1)y2=x(:,2)plot(t,y1,'y',t,y2,'m:')legend('y','d(y)')gridon运行结果:t=00.01450.08730.20140.32590.46210.61210.77780.96211.14821.27671.40531.51881.6
2、7061.86012.08912.35692.65462.96873.1416x=0.10000.20000.10300.21580.12140.28830.15980.37980.21160.44790.27560.48470.34850.48130.42450.42820.49390.31680.53880.15990.55130.03200.5466-0.10690.5272-0.23580.4780-0.41270.3788-0.63470.2037-0.8952-0.0742-1.1797-0.4677-1.4646-0.9691-1.7290-1.2793-1.85
3、86y1=0.10000.10300.12140.15980.21160.27560.34850.42450.49390.53880.55130.54660.52720.47800.37880.2037-0.0742-0.4677-0.9691-1.2793y2=0.20000.21580.28830.37980.44790.48470.48130.42820.31680.15990.0320-0.1069-0.2358-0.4127-0.6347-0.8952-1.1797-1.4646-1.7290-1.8586t=00.01450.08730.20140.32590.46
4、210.61210.77780.96211.14821.27671.40531.51881.67061.86012.08912.35692.65462.96873.1416x=0.10000.20000.10300.21580.12140.28830.15980.37980.21160.44790.27560.48470.34850.48130.42450.42820.49390.31680.53880.15990.55130.03200.5466-0.10690.5272-0.23580.4780-0.41270.3788-0.63470.2037-0.8952-0.0742
5、-1.1797-0.4677-1.4646-0.9691-1.7290-1.2793-1.8586y1=0.10000.10300.12140.15980.21160.27560.34850.42450.49390.53880.55130.54660.52720.47800.37880.2037-0.0742-0.4677-0.9691-1.2793y2=0.20000.21580.28830.37980.44790.48470.48130.42820.31680.15990.0320-0.1069-0.2358-0.4127-0.6347-0.8952-1.1797-1.46
6、46-1.7290-1.8586
此文档下载收益归作者所有