]> permondes.de Git - Analog_Engine.git/blame - scripts/Superposition of oscillations.LACE
Further examples of harmonic oscillation
[Analog_Engine.git] / scripts / Superposition of oscillations.LACE
CommitLineData
92b24062
P
1# Superposition of the oscillation of two undamped harmonic oscillators
2# x1'' = -omega1^2*x1
3# x2'' = -omega2^2*x2
4
5coefficient.1(-1) -> -x10 # amplitude of 1
6coefficient.2 -> omega1^2
7coefficient.5(-1) -> -x20 # amplitude of 2
8coefficient.6 -> omega2^2
9
10# 1st oscillator
11iintegrate x1'' -> -x1'
12iintegrate -x1' -> x1
13 IC: -x10
14cmultiply x1, omega1^2 -> omega1^2*x1
15invert omega1^2*x1 -> -omega1^2*x1
16assign -omega1^2*x1 -> x1''
17output x1 -> out.x
18
19# 2nd oscillator
20iintegrate x2'' -> -x2'
21iintegrate -x2' -> x2
22 IC: -x20
23cmultiply x2, omega2^2 -> omega2^2*x2
24invert omega2^2*x2 -> -omega2^2*x2
25assign -omega2^2*x2 -> x2''
26output x2 -> out.y
27
28# Sum
29isum x1, x2 -> -(x1+x2)
30invert -(x1+x2) -> x1+x2
31output x1+x2 -> out.z