Borrar filtros
Borrar filtros

Explicit solution could not be found

1 visualización (últimos 30 días)
Stefan
Stefan el 20 de Nov. de 2014
Comentada: Stefan el 22 de Nov. de 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!

Respuestas (1)

MA
MA el 20 de Nov. de 2014
Editada: MA el 20 de Nov. de 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 comentarios
Stefan
Stefan el 22 de Nov. de 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 el 22 de Nov. de 2014
also, I get "Undefined function or variable 't'." inside sae(t,x)

Iniciar sesión para comentar.

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by