examp7_9.m
来自「东北大学 薛定谔的高等应用数学问题MATLAB求解的源代码」· M 代码 · 共 22 行
M
22 行
t_final=100; x0=[0;0;1e-10];
b1=8/3; r1=10; s1=28; % 并不要求变量名必须是 beta 等
[t,x]=ode45('lorenz1',[0,t_final],x0,[],b1,r1,s1);
plot(t,x),
figure; plot3(x(:,1),x(:,2),x(:,3)); axis([10 42 -20 20 -20 25]);
t_final=100; x0=[0;0;1e-10];
b2=2; r2=5; s2=20;
[t2,x2]=ode45('lorenz1',[0,t_final],x0,[],b2,r2,s2);
plot(t2,x2),
figure; plot3(x2(:,1),x2(:,2),x2(:,3)); axis([0 72 -20 22 -35 40]);
f2=inline(['[-beta*x(1)+x(2)*x(3); -rho*x(2)+rho*x(3);',...
'-x(1)*x(2)+sigma*x(2)-x(3)]'],'t','x','flag','beta','rho','sigma');
t_final=100; x0=[0;0;1e-10];
b2=2; r2=5; s2=20;
[t2,x2]=ode45(f2,[0,t_final],x0,[],b2,r2,s2);
plot(t2,x2),
figure; plot3(x2(:,1),x2(:,2),x2(:,3)); axis([0 72 -20 22 -35 40]);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?