File: waterwheel.ode

package info (click to toggle)
xppaut 5.85-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 11,552 kB
  • ctags: 7,725
  • sloc: ansic: 80,633; cpp: 965; makefile: 265
file content (21 lines) | stat: -rw-r--r-- 592 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# the waterwheel ala Lorenz but discrete
ff(u)=heav(cos(u)-cos(pi/n))
flow[0..9]=flow*ff(theta-2*pi*[j]/n)
cp[0..9]=flow[j]-mu*c[j]
m[0..9]=c[j]+mc/n
c[0..9]'=cp[j]
mdot=sum(0,9)of(shift(cp0,i'))
m=sum(0,9)of(shift(c0,i'))+mc
theta'=thetap
thetap'=(-nu*thetap-l*l*mdot*thetap+l*sum(0,9)of(shift(m0,i')*sin(theta-2*pi*i'/n)))/(m*l*l)
par flow=.5,mu=.1,n=10,l=.15,mc=2,nu=.1
init theta=.05
### some stuf for animation
x[0..9]=.3*sin(theta-2*pi*[j]/n)+.4
y[0..9]=.3*cos(theta-2*pi*[j]/n)+.4
yc[0..9]=.3*cos(theta-2*pi*[j]/n)+.4+.1*c[j]/2
@ total=200,dt=.05,meth=cvode,tol=1e-5,atol=1e-4
done