Lorenz Chaos

Off topic discussion zone.

Moderators: winston, another_commander, Cody

Post Reply
User avatar
CommRLock78
---- E L I T E ----
---- E L I T E ----
Posts: 1138
Joined: Sat Apr 07, 2012 7:35 pm
Location: US
Contact:

Lorenz Chaos

Post by CommRLock78 »

I wrote this Matlab script of Lorenz's chaos for an assignment. Save as lorenz.m to run [NOTE: If you want to use GNU Octave, then the two functions must be split into two files, lorenz.m and Lchaos.m]

The equations are as follows:
x' = s(y - x)
y' = x(t - z) - y
z' = xy - bz

Code: Select all

% HW 4 Problem 1 - Lorenz Chaos
%-------------------------------------------------------
function lorenz;
[t x] = ode45(@Lchaos,[0 50],[5;5;5]); % Initial conditions are the last matrix.
figure(1)
plot(t,x(:,1)),xlabel('t'),ylabel('x'),title('x(t)')
figure(2)
plot(t,x(:,2)),xlabel('t'),ylabel('y'),title('y(t)')
figure(3)
plot(t,x(:,3)),xlabel('t'),ylabel('z'),title('z(t)')
figure(4)
plot(t,x),xlabel('t'),ylabel('x,y,z'),legend('x(t)','y(t)','z(t)')
figure(5)
plot(x(:,1),x(:,2)),xlabel('x'),ylabel('y'),title('xy Phase Plane')
figure(6)
plot(x(:,1),x(:,3)),xlabel('x'),ylabel('z'),title('xz Phase Plane')
figure(7)
plot(x(:,2),x(:,3)),xlabel('y'),ylabel('z'),title('yz Phase Plane')
figure(8)
plot3(x(:,1),x(:,2),x(:,3)),xlabel('x'),ylabel('y'),zlabel('z')

function xprime = Lchaos(t,x);
sig = 10;,tau = 28;,bet = 8/3; % PARAMETERS -- THESE AND INITIAL CONDITIONS CAN BE ADJUSTED
xprime = zeros(3,1);
xprime(1) = sig*(x(2) - x(1));
xprime(2) = x(1)*(tau - x(3)) - x(2);
xprime(3) = x(1)*x(2) - bet*x(3);
For (5,5,5) as the initial conditions, as set in the code above, these two plots struck me as being particularly neat:

Image

Image
"I'll laser the mark all while munching a fistful of popcorn." - Markgräf von Ededleen, Marquess, Brutal Great One, Assassins' Guild Exterminator
---------------------------
At the helm of the Caduceus Omega, 'Murderous Morrígan'
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Lorenz Chaos

Post by Diziet Sma »

I love Chaos Theory.. did you ever read James Gleick's book on the subject? Fascinating overview.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
CommRLock78
---- E L I T E ----
---- E L I T E ----
Posts: 1138
Joined: Sat Apr 07, 2012 7:35 pm
Location: US
Contact:

Re: Lorenz Chaos

Post by CommRLock78 »

Diziet Sma wrote:
I love Chaos Theory.. did you ever read James Gleick's book on the subject? Fascinating overview.
I must confess that any technical knowledge I now have of Chaos theory is only days old - but I understand there have been many many books written about it :).
"I'll laser the mark all while munching a fistful of popcorn." - Markgräf von Ededleen, Marquess, Brutal Great One, Assassins' Guild Exterminator
---------------------------
At the helm of the Caduceus Omega, 'Murderous Morrígan'
User avatar
Tricky
---- E L I T E ----
---- E L I T E ----
Posts: 821
Joined: Sun May 13, 2012 11:12 pm
Location: Bradford, UK. (Anarchic)

Re: Lorenz Chaos

Post by Tricky »

CommRLock78 wrote:
Diziet Sma wrote:
I love Chaos Theory.. did you ever read James Gleick's book on the subject? Fascinating overview.
I must confess that any technical knowledge I now have of Chaos theory is only days old - but I understand there have been many many books written about it :).
Read up on the works of [Wikipedia] Benoit Mandelbrot. Also [Wikipedia] J. Glieck as Dizzy has mentioned.

[Wikipedia] Butterfly effect.
Post Reply