]> permondes.de Git - Analog_Engine.git/blame - scripts/Gravity-2-dimensional.LACE
Potentials and Motion
[Analog_Engine.git] / scripts / Gravity-2-dimensional.LACE
CommitLineData
e25ae380
P
1# Gravity–2-dimensional.LACE
2
3# The small mass m moves within the gravitational potential of a mass M.
4# The situation is analysed in polar coordinates.
5
6# r'' = r * phi'^2 - gamma*M/r^2
7# phi'' = -2* r' / r * phi'
8
9include CompoundFunctions.LACE # idivide
10
11coefficient(1): +1 -> r0' # -1 to move initially towards M, +1 to move away from it
12coefficient(2): -1 -> -r0 # initial distance of m to M
13coefficient(3): +1 -> phi0'
14coefficient(4): -1 -> -phi0
15coefficient(5): +1 -> gamma*M
16
17iintegrate r*phi'^2, -gamma*M/r^2 -> -r' # input is r''
18 IC: r0'
19iintegrate -r' -> r
20 IC: -r0
21
22iintegrate -r'/r*phi', -r'/r*phi' -> -phi' # input is phi''
23 IC: phi0'
24iintegrate -phi' -> phi
25 IC: -phi0
26
27multiply r, -phi' -> -r*phi'
28multiply -r*phi', -phi' -> r*phi'^2
29multiply r, r -> r^2
30idivide gamma*M, r^2 -> -gamma*M/r^2
31
32idivide -r', -r*phi' -> r'/r*phi'
33invert r'/r*phi' -> -r'/r*phi'
34
35output(x): r # distance
36output(y): phi # angle