File: pend.ode

package info (click to toggle)
xppaut 8.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,332 kB
  • sloc: ansic: 74,690; makefile: 127; sh: 92
file content (21 lines) | stat: -rwxr-xr-x 507 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
# damped pendulum pend.ode
dx/dt = xp
dxp/dt = (-mu*xp-m*g*sin(x))/(m*l)
pe=m*g*(1-cos(x))
ke=.5*m*l*xp^2
aux P.E.=pe
aux K.E.=ke
aux T.E=pe+ke
# MKS units
# 
param m=10,mu=2,g=9.8,l=1
param scale=0.0083333
@ xp=x,yp=xp,xlo=-4,xhi=4,ylo=-8,yhi=8
@ bounds=1000
x(0)=2
# click on numerics colorize color via T.e
# choose min=0, max=400
# click dir fld - colorize - grid=80
# click on the slider and choose g, gravity start at 9.8, min=0,max=20
# watch the energy landscape change as you move the slider!
done