ملتقى الفيزيائيين العرب - عرض مشاركة واحدة - Lorenz attractor
الموضوع: Lorenz attractor
عرض مشاركة واحدة
  #2  
قديم 09-02-2017, 15:24
الصورة الرمزية Petro2
Petro2
غير متواجد
فيزيائي نشط
 
تاريخ التسجيل: Feb 2017
المشاركات: 64
افتراضي

MATLAB simulation[edit]
%Solution for the Lorenz equations in the time interval [0,100] with initial conditions [1,1,1].
sigma=10;
beta=8/3;
rho=28;
f = @(t,a) [-sigma*a(1) + sigma*a(2); rho*a(1) - a(2) - a(1)*a(3); -beta*a(3) + a(1)*a(2)];
%'f' is the set of differential equations and 'a' is an array containing values of x,y, and z variables.
%'t' is the time variable
[t,a] = ode45(f,[0 100],[1 1 1]);%'ode45' uses adaptive Runge-Kutta method of 4th and 5th order to solve differential equations
plot3(a(:,1),a(:,2),a(:,3)) %'plot3' is the command to make 3D plot
رد مع اقتباس