File: bead.ode

package info (click to toggle)
plotutils 2.0-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 5,964 kB
  • ctags: 2,522
  • sloc: ansic: 38,416; sh: 1,853; yacc: 856; makefile: 181; lex: 144
file content (23 lines) | stat: -rw-r--r-- 531 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# This example simulates a bead sliding on a smooth circular wire.  The
# output displays the height of the bead as a function of time.
#
# You may run this example by doing:
#
#    <bead.ode ode | graph -TX -C
# 
# or alternatively, to get a real-time plot,
#
#    <bead.ode ode | graph -TX -C -x 0 5 -y 0 2.5
#

a = 1  # radius of circular wire
g = 10 # acceleration due to gravity
w = 10 # angular velocity of circular wire

the' = vthe
vthe' = (w^2)*sin(the)*cos(the) - (g/a)*sin(the)
the = 0.1
vthe = 0

print t, the
step 0,5