Lorenz Attractor 3D

Lorenz Attractor 3D preview image

1 collaborator

Tags

Visible to everyone | Changeable by everyone
Model was written in NetLogo 3D 6.0.1 • Viewed 302 times • Downloaded 11 times • Run 0 times
Download the 'Lorenz Attractor 3D' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


NB: Since NetLogo Web does not support ‘.nlogo3d’ files you can run this model only on your PC after downloading it.

## WHAT IS IT?

This is a model of the phase-space of a system consisting of three ordinary differential equations, known as Lorenz system.

It has chaotic solutions for certain parameter values. A particular set of chaotic solutions of the Lorenz system when plotted, resembles a butterfly or figure eight and is presented as Lorenz attractor.

The model is intended to visualize Lorenz attractor in 3D view with the possibility of changing one of the key parameters (i.e. rho-parameter)

## HOW IT WORKS

It is a system of three ordinary differential equations:

dX/dt = σ (Y-X)

dY/dt = X (ρ - Z) - Y

dZ/dt = XY - βZ

where σ, ρ and β are positive system parameters. Lorenz used the values ρ=28, σ=10, β=8/3

In the actual model σ=10, β=8/3 and ρ can take a value between 10 and 50.

Governed by these equations and calculations a phase-space is created: with each calculation a turtle is generated and plotted in space with respective coordinates (X, Y, Z).

## HOW TO USE IT

(1) Setup: creates basic conditions for the model to run (i.e. erases data from previous runs, generates X, Y and Z axes, etc.).

(2) Go: starts running the model with generation of new points (turtles) in accordance with numeric values as a result of calculations, performed every time-step.

(3) 'Rho-slider' is used to change ρ-value (before a new run)

Buttons (3) and (4) Zoom, (5) and (6) Orbit L&R, (7) and (8) Orbit Up&Down can be used for adjusting the 3D view

(9) The plot shows X, Y, Z values on each time-step/tick.

## THINGS TO NOTICE

The system was developed by Edward Lorenz as a simplified mathematical model for atmospheric convection. It is a toy-model, but a very interesting one in a mathematical sense and can help to understand some very complex behavior.

After the model starts it looks like points are generated in a chaotic manner but after some time it becomes evident that their trajectories are placed around two attractors.

## THINGS TO TRY

You can change rho-parameter value and perform new runs. How this influences the 'butterfly' shape?

## EXTENDING THE MODEL

An optimization of the code for a faster model run would be an option.

## NETLOGO FEATURES

Initially the model was built with the use of NetLogo System Dynamics Modeler, then it was converted from ‘System Dynamics’ version to a ‘regular’ one by recompiling the code and adding new pieces of the code with respective changes/additions in the model interface (buttons, sliders, etc.). Finally it was wrapped using NetLogo 3D-application.

## RELATED MODELS

* Turtle and Observer Motion Example 3D

* Turtle Perspective Example 3D

* Rossler Attractor Model

First two models can be seen in NetLogo library. The last one is part of a suit of models created to visualize some key concepts of Chaos Theory and Dynamical Systems. Most of the models are available on http://modelingcommons.org/account/models/2495

## CREDITS AND REFERENCES

This simple abstract model was developed by Victor Iapascurta, MD. At time of development he was in the Department of Anesthesia and Intensive Care at University of Medicine and Pharmacy in Chisinau, Moldova / ICU at City Emergency Hospital in Chisinau. Please email any questions or comments to viapascurta@yahoo.com

The model was created in NetLogo 6.0.1, Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

This model was inspired by Introduction to Dynamical Systems and Chaos (Fall, 2017) MOOC by David Feldman @ Complexity Explorer (https://www.complexityexplorer.org/courses).

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [
mylist-x
mylist-y
mylist-z
  g
  X
  Y
  Z
  dt
]

to setup
  clear-all
  draw-axes

  set mylist-x list 0 (X)
  set mylist-y list 0 (Y)
  set mylist-z list 0 (Z)
  zoom 20
  orbit-up 5
  orbit-right 10
  system-dynamics-setup
  system-dynamics-do-plot
end 

to draw-axes
  create-turtles 1 [ set shape "line"
          set heading 90
          set color red
          set size world-width
          stamp
          die ]
  create-turtles 1 [ set shape "line"
          set color yellow
          set heading 0
          set size world-height
          stamp
          die ]
  create-turtles 1 [ set shape "line"
          set pitch 90
          set color blue
          set size world-depth
          stamp
          die ]
  ask patch max-pxcor 0 0 [ set plabel "x-axis" ]
  ask patch 0 max-pycor 0 [ set plabel "y-axis" ]
  ask patch 0 0 max-pzcor [ set plabel "z-axis" ]
end 

to system-dynamics-setup
  reset-ticks
  set dt 0.01
  set g 10
  set X 1
  set Y 0
  set z 0
end 

to go
  system-dynamics-go
  system-dynamics-do-plot
  set mylist-x lput result-x mylist-x
  set mylist-y lput result-y mylist-y
  set mylist-z lput result-z mylist-z

  crt 1 [
  set color green
  set xcor (last mylist-x ) * 0.2
  set ycor (last mylist-y ) * 0.2
  set zcor (last mylist-z ) * 0.2
  set size 0.2
  set shape "circle"
  ]
end 

to system-dynamics-go

  let local-b b
  let local-r r
  let local-inflow inflow
  let local-inflow1 inflow1
  let local-inflow2 inflow2


  let new-X ( X + local-inflow1 )
  let new-Y ( Y + local-inflow )
  let new-Z ( Z + local-inflow2 )
  set X new-X
  set Y new-Y
  set Z new-Z

  tick-advance dt
end 

to-report result-x
  report X
end 

to-report result-y
    report Y
end 

to-report result-z
    report Z
end 

to-report inflow
  report ( X * ( r - Z ) - Y
  ) * dt
end 

to-report inflow1
  report ( g * ( Y - X )
  ) * dt
end 

to-report inflow2
  report ( X * Y - b * Z
  ) * dt
end 

to-report b
  report 8 / 3
end 

to-report r
  report rho-slider
end 

to system-dynamics-do-plot
  if plot-pen-exists? "X" [
    set-current-plot-pen "X"
    plotxy ticks X
  ]
  if plot-pen-exists? "Y" [
    set-current-plot-pen "Y"
    plotxy ticks Y
  ]
  if plot-pen-exists? "z" [
    set-current-plot-pen "z"
    plotxy ticks z
  ]
end 

There is only one version of this model, created over 1 year ago by Victor Iapascurta.

Attached files

File Type Description Last updated
Lorenz Attractor 3D.png preview Preview for 'Lorenz Attractor 3D' over 1 year ago, by Victor Iapascurta Download

This model does not have any ancestors.

This model does not have any descendants.