Engineering Math - Chaos Theory

 

 

 

 

Chaos - Lorenz Attractor

 

Lorenz attractor is abtained by solving a system of non-linear differential equation numerically as shown below. If you plot the solution of each single variable (fuction) on time domain (i.e, x(t), y(t), z(t)) you would see a pretty much radom like plots, but if you plot any of the two variables (or 3 variables) in parametric plot, you would see some pattern as shown below. The exact trajectory for each function(variable) changes very unpredictable way as you change the initial value by even very small degree, you would still see very similar overall plot. This is why the solution of the system equation is called as an attractor.

 

 

 

    %Save the following contents in a .m file and run the .m file

    % this is tested only in Matlab, not in Octave

    P = 10;

    r = 28;

    b = 8/3;

     

    dy_dt = @(t,y) [-P*y(1)+P*y(2);...

                        r.*y(1)-y(2)-y(1)*y(3);...

                        y(1)*y(2)-b.*y(3)];

     

    odeopt = odeset ('RelTol', 0.00001, 'AbsTol', 0.00001,'InitialStep',0.5,'MaxStep',0.5);

    [t,y] = ode45(dy_dt,[0 250], [1.0 1.0 1.0],odeopt);

     

    subplot(1,3,1);plot(y(:,1),y(:,2),'r-'); xlabel('y(1)'); ylabel('y(2)');

    subplot(1,3,2);plot(y(:,2),y(:,3),'g-'); xlabel('y(2)'); ylabel('y(3)');

    subplot(1,3,3);plot(y(:,1),y(:,3),'b-'); xlabel('y(1)'); ylabel('y(3)');