拓端tecdat|matlab代写的Lorenz系统仿真可视化

原文链接:http://tecdat.cn/?p=12307


 

我使用MATLAB解决以下Lorenz初始值问题:

我编写了一个函数LorenzRK4IVP(),该函数将三个微分方程组作为输入,并使用 带有步长的Runge-Kutta方法求解该系统。我使用MATLAB生成了解决方案的GIF。

 

 

 

%   Inputs:
%      f1,f2,f3 = y'(t,y) as a string
%            y0 = initial condition
%         inter = interval
%             h = step size

 
% call function to solve Lorenz equations
L=LorenzRK('-10*y1+10*y2','-y1*y3+28*y1-y2','y1*y2-(8/3)*y3',[0,50],[5,5,5],.01)
 
% plot Lorenz solutions
plot3(L(:,2),L(:,3),L(:,4))
     
% create GIF source: 

 
L=LorenzRK('-10*y1+10*y2','-y1*y3+28*y1-y2','y1*y2-(8/3)*y3',[0,50],[5,5,5],.01)
posted @ 2020-05-01 14:32  拓端tecdat  阅读(480)  评论(0编辑  收藏  举报