bead.ode 535 B

123456789101112131415161718192021222324
  1. # This example simulates a bead sliding on a smooth circular wire. The
  2. # output displays the height of the bead as a function of time.
  3. #
  4. # You may run this example by doing:
  5. #
  6. # ode < bead.ode | graph -T X -C
  7. #
  8. # or alternatively, to get a real-time plot,
  9. #
  10. # ode < bead.ode | graph -T X -C -x 0 5 -y 0 2.5
  11. #
  12. a = 1 # radius of circular wire
  13. g = 10 # acceleration due to gravity
  14. w = 10 # angular velocity of circular wire
  15. the' = vthe
  16. vthe' = (w^2)*sin(the)*cos(the) - (g/a)*sin(the)
  17. the = 0.1
  18. vthe = 0
  19. print t, the
  20. step 0,5