Explicit solution could not be found

3 ビュー (過去 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 Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by