用matlab 解方程 y’ = −20y, y(0) = 1 for 0 ≤ t ≤ 1.

UseRunge-Kuttaorder4andthetrapezoidalmethod.Tryfirstthestepsizeh=0.05,andgraphtheexac... UseRunge-Kutta order 4 and the trapezoidal method. Try first the step size h= 0.05,and graph the exact solution and the two numerical solutions. You should seethat Runge-Kutta provides a better approximation than the trapezoidal method.This is to be expected, since Runge-Kutta is a higher-order method.
Now,increase the step size to h= 0.15.You should see that the approximation obtained by the trapezoidal method isso-so. However, Runge-Kutta behaves really badly! Instead of decreasing tozero, the solution increases! Experiment with other values of halso.
Runge-Kuttaworks much better than other methods when the step size hissmall. If the step size is not small, Runge-Kutta (and the other explicitmethods, like Euler, etc.) can fail to even predict the correct trend, whilethe trapezoidal method still provides a reasonable approximation.
Notethat since the trapezoidal method is implicit, it will in general be hard tosolve for wi+1. It is quite easyin this case though.
求大神 解答
展开
思孕
2014-09-10 · TA获得超过389个赞
知道小有建树答主
回答量:645
采纳率:0%
帮助的人:417万
展开全部

程序一:

syms t

dsolve('Dy+20*y=0','y(0)=1')


结果:

exp(-20*t)



程序二:

t=linspace(0,1,1000);

plot(t,exp(-20*t),'r.-')


结果:

推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式