]> permondes.de Git - Analog_Engine.git/blob - scripts/EP1 10.02 Forced Harmonic Oscillator.LACE
6e51b649e26718d59d6c7a30c15aa90f79033d59
[Analog_Engine.git] / scripts / EP1 10.02 Forced Harmonic Oscillator.LACE
1 # Forced Damped_Harmonic Oscillator
2 # x'' + 2*delta*x' + omega.0^2*x = A cos (omega.f t)
3
4 # generating oscillation with omega.f
5 # f'' = -omega.f^2*f
6 coefficient.1(-1) -> -f0 # amplitude
7 coefficient.2 -> omega^2
8 iintegrate f'' -> -f'
9 iintegrate -f' -> f
10 IC: -f0
11 cmultiply f, omega^2 -> omega^2*f
12 invert omega^2*f -> -omega^2*f
13 assign -omega^2*f -> f''
14 invert f -> -f
15 output f -> y
16
17 # forced damped harmonic oscillation
18 # x'' = -(2*delta*x' + omega.0^2*x) + A cos (omega.f t)
19 coefficient.5(-1) -> -x0 # amplitude of oscillation
20 coefficient.6 -> 2*delta # attenuation
21 coefficient.7 -> omega.0^2 # Eigenfrequency of this oscillator, ^2
22
23 iintegrate x'' -> -x'
24 invert -x' -> x'
25 cmultiply x', 2*delta -> 2*delta*x'
26
27 iintegrate -x' -> x
28 IC: -x0
29 cmultiply x, omega.0^2 -> omega.0^2*x
30 isum 2*delta*x', omega.0^2*x, -f -> -(2*delta*x'+omega.0^2*x)-f
31 assign -(2*delta*x'+omega.0^2*x)-f -> x''
32
33 output(x) -> x