henon.ode 662 B

123456789101112131415161718192021222324252627282930
  1. # You may run this example by doing:
  2. #
  3. # ode < henon.ode | graph -T X -C
  4. #
  5. # or alternatively, to get a real-time plot,
  6. #
  7. # ode < henon.ode | graph -T X -C -x -0.6 0.6 -y -0.6 0.6
  8. #
  9. # This example shows a simple center with complicated orbits:
  10. # the system investigated by Henon and Heiles.
  11. # The Poincare plot is a graph of p1(t) vs. q1(t).
  12. # Initial condations:
  13. # stable: p1 = 1/3, q1 = 1/4, p2 = 0.1293144, q2 = 1/5
  14. # unstable: p1 = 0.1, q1 = 0.1, p2 = 0.467618, q2 = 0.1
  15. qone' = pone
  16. qtwo' = ptwo
  17. pone' = -qone - 2*qone*qtwo
  18. ptwo' = -qtwo - qone*qone + qtwo*qtwo
  19. pone = 1/3
  20. qone = 1/4
  21. ptwo = 0.1293144
  22. qtwo = 1/5
  23. print pone, qone
  24. step 0,250