]> permondes.de Git - Analog_Engine.git/blob - scripts/Gravity-2-dimensional.LACE
Focus on potential fields
[Analog_Engine.git] / scripts / Gravity-2-dimensional.LACE
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
9 include CompoundFunctions.LACE # idivide
10
11 coefficient(1): +1 -> r0' # -1 to move initially towards M, +1 to move away from it
12 coefficient(2): -1 -> -r0 # initial distance of m to M
13 coefficient(3): +1 -> phi0'
14 coefficient(4): -1 -> -phi0
15 coefficient(5): +1 -> gamma*M
16
17 iintegrate r*phi'^2, -gamma*M/r^2 -> -r' # input is r''
18 IC: r0'
19 iintegrate -r' -> r
20 IC: -r0
21
22 iintegrate -r'/r*phi', -r'/r*phi' -> -phi' # input is phi''
23 IC: phi0'
24 iintegrate -phi' -> phi
25 IC: -phi0
26
27 multiply r, -phi' -> -r*phi'
28 multiply -r*phi', -phi' -> r*phi'^2
29 multiply r, r -> r^2
30 idivide gamma*M, r^2 -> -gamma*M/r^2
31
32 idivide -r', -r*phi' -> r'/r*phi'
33 invert r'/r*phi' -> -r'/r*phi'
34
35 output(x): r # distance
36 output(y): phi # angle