Explicit solution could not be found

1 次查看(过去 30 天)
Stefan
Stefan 2014-11-20
评论: Stefan 2014-11-22
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!

回答(1 个)

MA
MA 2014-11-20
编辑:MA 2014-11-20
<<
>>
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 个评论
Stefan
Stefan 2014-11-22
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 2014-11-22
also, I get "Undefined function or variable 't'." inside sae(t,x)

请先登录,再进行评论。

类别

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