> 数学 >
matlab 二阶微分方程组解
function Dy=dfun(t,y)
D2y(1,1)=(0.0176*y(2)-960-23.85/(0.0088-0.0072*y(1)).^1.4-0.1*Dy(1,1))/96;
Dy(2,1)=(-0.0176*Dy(1,1)-0.1*y(2)+2)/(2.4e7*y(1));
t=linspace(0,0.15,100);
ode113('dfun',t,[0,16e6]);
这有什么问题
人气:342 ℃ 时间:2020-04-10 01:45:43
解答
把原方程写出来看看,你这种写法比较非主流

你的初值有问题,再检查检查

clc

f=@(t,x)([x(2);-.0027/96*x(3)+10-9.5e-6/96/(.0088-.0072*x(1))^1.4-.1/96*x(2);(2-.0176*x(2)-.1*x(3))/x(1)/2.4e7]);

[t,x]=ode45(f,[0 .15],[1 1 16e6]);

subplot(1,2,1),plot(t,x(:,3))
xlabel('t'),ylabel('p1')
subplot(1,2,2),plot(t,x(:,1))
xlabel('t'),ylabel('x')

推荐
猜你喜欢
© 2026 79432.Com All Rights Reserved.
电脑版|手机版