lorenz.ode 765 B

123456789101112131415161718192021222324252627282930313233
  1. # This example displays a beautiful strange attractor: the Lorenz
  2. # attractor.
  3. # You may run this example by doing:
  4. #
  5. # ode < lorenz.ode | graph -T X -C
  6. #
  7. # or alternatively, to get a real-time plot,
  8. #
  9. # ode < lorenz.ode | graph -T X -C -x -10 10 -y -10 10
  10. #
  11. # You may also produce and print a Postscript version by doing
  12. #
  13. # ode < lorenz.ode | graph -T ps -C -x -10 10 -y -10 10 -W 0 | lpr
  14. #
  15. # The `-W 0' sets the line width for the Postscript plot to
  16. # be zero. That means that the thinnest line possible will be used.
  17. # The Lorenz model, a third order system.
  18. # Interesting cases are r = 26, 2.5<t<30, x = z = 0, y = 1
  19. # and r = 17, 1<t<50, x = z = 0, y = 1.
  20. x' = -3*(x-y)
  21. y' = -x*z+r*x-y
  22. z' = x*y-z
  23. r = 26
  24. x = 0
  25. y = 1
  26. z = 0
  27. print x, y
  28. step 0, 200