tecdat

原文链接: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)

分类:

技术点:

相关文章:

  • 2021-11-19
  • 2022-12-23
  • 2021-11-01
  • 2021-05-06
  • 2021-12-03
  • 2021-06-01
  • 2021-11-19
  • 2022-12-23
猜你喜欢
  • 2021-04-30
  • 2022-12-23
  • 2022-12-23
  • 2021-04-19
  • 2021-06-26
  • 2021-07-24
  • 2021-10-18
相关资源
相似解决方案