home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 3.ddi / DEMOS.DI$ / LORENZ.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  1.0 KB  |  51 lines

  1. %LORENZ    Plot the orbit around the Lorenz chaotic attractor.
  2.  
  3. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  4.  
  5. clf
  6. clc
  7. echo on
  8.  
  9. % Solve the ordinary differential equation describing the
  10. % Lorenz chaotic attractor.  The equations are defined in
  11. % an M-file, lorenzeq.m.
  12.  
  13. type lorenzeq
  14.  
  15. % Press any key to continue after pauses.
  16. pause
  17.  
  18. clc
  19.  
  20. % The values of the global parameters are
  21.  
  22. global SIGMA RHO BETA
  23. SIGMA = 10.;
  24. RHO = 28.;
  25. BETA = 8./3.;
  26.  
  27. pause
  28.  
  29. % The graphics axis limits are set to values known to contain the solution.
  30.  
  31. axis([10 40 -20 20 -20 20])
  32. view(3)
  33. hold on
  34. title('Lorenz Attractor')
  35.  
  36. pause
  37.  
  38. clc
  39.  
  40. % The orbit ranges chaotically back and forth around two different points,
  41. % or attractors.  It is bounded, but not periodic and not convergent.
  42. % The numerical integration, and the display of the evolving solution,
  43. % are handled by the function ODE23P.
  44. %
  45. % This will run for quite a while; hit <ctrl-C> to break out sooner.
  46.  
  47. y0 = [0 0 eps];
  48. tfinal = 100;
  49. y = ode23p('lorenzeq',0,tfinal,y0) 
  50. echo off
  51.