lorenz
سیستم آشوبی جاذب لورنز یک مدل ریاضی است که اولین بار توسط ریاضیدان و هواشناس ادوارد لورنز مورد مطالعه قرار گرفت و برای توصیف رفتار سیستمهای پویا و غیرخطی استفاده میشود. این مدل بر اساس معادلات دیفرانسیل نوشته شده است و در مهندسی، فیزیک و ریاضیات کاربرد دارد.
.
.
% Lorenz Differential Equations Solver
% x1=x
% x2=y
% x3=z
% dx/dt=sigma(y-x)
% dy/dt=x(rho-z)-y
% dz/dt=x*y-beta*z
% xdot(1)=sigma(x2-x1)
% xdot(2)=x1(rho-x3)-x2
% xdot(3)=x1*x2-beta*x3
% Define a function named 'lorenz'
function lorenz
clc;clear;close all
% Set the value of the parameters
rho = 28;
sigma = 10;
beta = 8/3;
[t,x] = ode45(@lorenz_eq,[0 100],[0.1 0 0]);
figure(1)
plot3(x(:,1),x(:,2),x(:,3))
title('Lorenz equation')
grid
% This plot shows the trajectory of the solution in 3D space, with each axis representing one of the variables (x, y, z)
figure(2)
plot([x(:,1) x(:,2) x(:,3)])
title('Lorenz equation')
grid
% This plot shows how each variable (x, y, z) changes over time. Each variable is plotted as a separate line on the same graph.
function xdot = lorenz_eq(t,x) % Define a nested function to represent the Lorenz differential equations
xdot = zeros(3,1); % Initialize the output vector
xdot(1) = sigma*(x(2)-x(1)); % Compute the first component of the output vector
xdot(2) = x(1)*(rho-x(3))-x(2); % Compute the second component of the output vector
xdot(3) = x(1)*x(2)-beta*x(3); % Compute the third component of the output vector
end
end


