]> permondes.de Git - Analog_Engine.git/blob - scripts/TP1 05.15 Comet.AESL
fc83617b7bca0a19f0555fe6fb92056f8e998243
[Analog_Engine.git] / scripts / TP1 05.15 Comet.AESL
1 IDENTIFICATION DIVISION
2 PROGRAM-ID Comet
3 VERSION 20240205
4 COMMENT A comet moves on a parabolic orbit in the gravitational field of the stationary sun.
5 COMMENT Its orbital plane coincides with the plane of the Earth's orbit, which is assumed to be circular.
6 COMMENT The perihelion distance is one third of the Earth's orbital radius R.E.
7 COMMENT How long does the comet move within the Earth's orbit?
8 COMMENT t(r)=root(2/(gamma*m(sun))*integral from 1/3RE to RE (r/root(r-1/3 RE)) dr
9
10 ENVIRONMENT DIVISION
11 ENGINE Anabrid-THAT
12 TIMEBASE 100ms # use SLOW on both integrators
13 REQUIRES COEFFICIENT 3, INTEGRATOR 2, COMPARATOR 1, SUMMER 1, OPEN-AMP 2, MULTIPLIER 2, INVERTER 1
14
15 DATA DIVISION
16 OUTPUT OUTPUT.X -xlimited
17 OUTPUT OUTPUT.Y result
18 COEFFICIENT.1 Factor # root(2/(gamma*m)), scaled to 0,142 10kd/Tm^3/2
19 COEFFICIENT.2 RE # Earth's orbital radius, scaled to 0,150 Tm
20 COEFFICIENT.3 1/3RE # note: dependent on RE, scaled to 0,05 Tm
21
22 PROGRAM DIVISION
23 +1 -> COEFFICIENT.RE -> RE
24 +1 -> COEFFICIENT.1/3RE -> 1/3RE
25
26 # obtaining x through integration of 1, starting at 1/3RE
27 +1, IC:1/3RE -> INTEGRATOR -> -x
28
29 # limiting x to the upper limit of the integral RE and set x=0 if beyond
30 A:-x, B:RE, GT0:-x -> COMPARATOR -> -xlimited
31
32 -xlimited, 1/3RE -> SUMMER -> -(-x+1/3RE)=x-1/3RE
33
34 # root of x-1/3RE
35 ## first invert because the input of a root has to be negative
36 x-1/3RE -> INVERTER -> -(x-1/3RE)
37 ## now make sure the input is never >0 (which causes the circuit to error)
38 A:-(x-1/3RE), LT0:-(x-1/3RE) -> COMPARATOR -> -(x-1/3RE)limited
39 ## now calculate the root
40 -(x-1/3RE)limited, OA1 -> OPEN-AMP -> root
41 root, root -> MULTIPLIER -> OA1
42
43 # x/root
44 -xlimited, OA2 -> OPEN-AMP -> x/root
45 x/root, root -> MULTIPLIER -> OA2
46
47 # integral
48 x/root -> INTEGRATOR -> integral
49 integral -> COEFFICIENT.Factor -> result
50
51 OPERATION DIVISION
52 MODE REPEAT
53 OP-TIME 111ms