MATLAB Answers

solve 3 order differential equations

1 view (last 30 days)
P46081322@mail.ncku.edu.tw
Answered: Star Strider on 28 Nov 2020
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

  0 Comments

Sign in to comment.

Answers (1)

Star Strider
Star Strider on 28 Nov 2020
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
.

  0 Comments

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!