Explicit solution could not be found

3 visualizzazioni (ultimi 30 giorni)
Stefan
Stefan il 20 Nov 2014
Commentato: Stefan il 22 Nov 2014
I'm trying to solve a system of 3 ODE's with initial conditions. When I attempt to run the code, I get the "Explicit solution could not be found" error message. I'm not sure exactly what is wrong with the code. Any help at all would be great!
omega = 10;
b = 8/3;
r = 28;
inits = 'x(0)=0,y(0)=1,z(0)=0';
[x,y,z] = dsolve('Dx=omega(y-x)','Dy=(r*x)-y-(x*z)','Dz=(x*y)-(b*z)')
Thank you!

Risposte (1)

MA
MA il 20 Nov 2014
Modificato: MA il 20 Nov 2014
<<
>>
These are lorenz equations and you should solve them numerically, for example with ode45, here the solution:
function:
function dx=sae(t,x)
dx=zeros(3,1);
dx(1)=10*(x(2)-x(1));
dx(2)=(28*x(1))-x(2)-(x(1)*x(3));
dx(3)=(x(1)*x(2))-((8/3)*x(3));
end
solver:
[T X]=ode45(@sae,[0 20],[0 1 0]);
plot(T,X(:,1),T,X(:,2),T,X(:,3))
legend('x','y','z')
you can use:
[T X]=ode45(@sae,[0 20],[0 1 0]);
plot3(X(:,1),X(:,2),X(:,3))
  2 Commenti
Stefan
Stefan il 22 Nov 2014
Do I have to place the solver inside the function? Whenever I try to run this code, it tells me "This statement is not inside any function."
Stefan
Stefan il 22 Nov 2014
also, I get "Undefined function or variable 't'." inside sae(t,x)

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by