solve 3 order differential equations

1 次查看(过去 30 天)
error : Not enough input arguments.
MATLAB code:
function dx = eq62(t,x)
u = -(2*x(2)-8*x(1)+6*x(3)+8*x(1)*x(3)-(x(3)-2)*(x(1)-x(2)+x(3))+x(1)*(x(1)-1))/(x(1)+1);
dx = [-x(1)+x(2)-x(3);-x(1)*x(3)-x(2)+u;-x(1)+u]
how yo solve this problem , thanks

回答(1 个)

Star Strider
Star Strider 2020-11-28
Without seeing your ODE solver call, I cannot determine what the problem is.
This runs without error for me (in R2020b):
function dx = eq62(t,x)
u = -(2*x(2)-8*x(1)+6*x(3)+8*x(1)*x(3)-(x(3)-2)*(x(1)-x(2)+x(3))+x(1)*(x(1)-1))/(x(1)+1);
dx = [-x(1)+x(2)-x(3);-x(1)*x(3)-x(2)+u;-x(1)+u];
end
[t,x] = ode45(@eq62, [0 5], [0 0 1]);
figure
plot(t,x)
grid
.

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by