]> permondes.de Git - Analog_Engine.git/blob - scripts/EP1 10.03 Coupled Pendulums.LACE
5ef05172f17e0e0cab4e3bdfd3d93b842615e105
[Analog_Engine.git] / scripts / EP1 10.03 Coupled Pendulums.LACE
1 # 2 coupled pendulums
2 # x1'' = -k1*x1 + k*(x2-x1)
3 # x2'' = -k2*x2 - k*(x2-x1)
4 # xi are the displacement of the pendulum to its resting position
5
6 coefficient.1 -> k1
7 coefficient.2 -> k2
8 coefficient.3 -> k
9 coefficient.5(-1) -> -x10 # initial displacement x1
10 coefficient.6(-1) -> -x20 # initial displacement x2
11
12 iintegrate x1'' -> -x1'
13 iintegrate -x1' -> x1
14 IC: -x10
15
16 iintegrate x2'' -> -x2'
17 iintegrate -x2' -> x2
18 IC: -x20
19
20 cmultiply x1, k1 -> k1*x1
21 cmultiply x2, k2 -> k2*x2
22
23 invert x1 -> -x1
24 isum x2, -x1 -> -(x2-x1)
25 cmultiply -(x2-x1), k -> -k*(x2-x1)
26
27 isum k1*x1, -k*(x2-x1) -> -k1*x1+k*(x2-x1)
28 assign -k1*x1+k*(x2-x1) -> x1''
29 invert -k*(x2-x1) -> k*(x2-x1)
30 isum k2*x2, k*(x2-x1) -> -k2*x2-k*(x2-x1)
31 assign -k2*x2-k*(x2-x1) -> x2''
32
33 output x1 -> out.x
34 output x2 -> out.y