![]() |
ode45的使用
请问如何使用ode45解
d2x1/dt2=x2-x1; d2x2/dt2=30+x1-2*x2; x1(0)=12,x2(0)=23,Dx1(0)=0,Dx2(0)=0 |
回复: ode45的使用
首先建立函数M文件如下:
function dx=fmat(t,x) % x=[x1,x2,x3,x4],其中x3=dx1、x4=dx2; dx=[x(3);x(4);x(2)-x(1);30+x(1)-2*x(2)]; end 再在命令行中输入: >> t=0:100; >> x0=[12,23,0,0]; >> [t,x]=ode45(@fmat,t,x0); >> [t,x] 可得到结果。 ~ ~ |
所有时间均为北京时间。现在的时间是 03:10。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.