]> permondes.de Git - Analog_Engine.git/blame_incremental - scripts/Pendulum.LACE
Further examples of harmonic oscillation
[Analog_Engine.git] / scripts / Pendulum.LACE
... / ...
CommitLineData
1# Pendulum: Comparing Harmonic Oscillator with 4th order Taylor approximation
2
3### Taylor 4 approximation: phi'' = - g/r * (phi - 1/6 * phi^3)
4# fortunately, the components of orders 0, 2 and 4 are zero
5
6coefficient.1 -> g/r
7coefficient.2 -> 1/6 # set to 0,167 or 0 (for harmonic solution)
8coefficient.3(-1) -> -phi0
9
10iintegrate phi'' -> -phi'
11iintegrate -phi' -> phi
12 IC: -phi0
13
14multiply phi, phi -> phi^2
15multiply phi^2, phi -> phi^3
16invert phi^3 -> -phi^3
17
18cmultiply 1/6, -phi^3 -> -1/6*phi^3
19isum phi, -1/6*phi^3 -> -(phi-1/6*phi^3)
20cmultiply -(phi-1/6*phi^3), g/r -> -g/r*(phi-1/6*phi^3)
21assign -g/r*(phi-1/6*phi^3) -> phi''
22
23output phi -> out.x
24
25### Harmonic oscillator: phi'' = - g/r * phi
26coefficient.5 -> g/r_h # identical to g/r
27coefficient.7(-1) -> -phi0_h # identical to -phi0
28
29iintegrate phi_h'' -> -phi_h'
30iintegrate -phi_h' -> phi_h
31 IC: -phi0_h
32invert phi_h -> -phi_h
33
34cmultiply -phi_h, g/r_h -> -g/r*phi_h
35assign -g/r*phi_h -> phi_h''
36
37output phi_h -> out.y