current position:Home>Butterfly effect problem, insufficient number of input parameters

Butterfly effect problem, insufficient number of input parameters

2022-02-03 00:38:57 CSDN Q & A

function r=hudie3(t,x)

global a;

global b;

global c;

a=8/3;b=10;c=28;

r=zeros(3,1);

r(1)=-a*x(1)+x(2)*x(3);

r(2)=-bx(2)+bx(3);

r(3)=-x(1)x(2)+cx(2)-x(3);

end




Refer to the answer 1:

As like as two peas on the Internet , But you forgot to add some arithmetic symbols

a=8/3;b=10;c=28;t0=[0,100];f0=[0,0,1e-10]; [t,x]=ode45('hudie3',t0,f0); plot3(x(:,1),x(:,2),x(:,3)); title('Lorenz Model ');xlabel('x');ylabel('y');zlabel('z'); grid onfunction r=hudie3(t,x)global a;global b;global c; a=8/3;b=10;c=28;r=zeros(3,1);r(1)=-a*x(1)+x(2)*x(3);r(2)=-b*x(2)+b*x(3);r(3)=-x(1)*x(2)+c*x(2)-x(3);end

img




Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202030038552169.html

Random recommended