+IDENTIFICATION DIVISION
+PROGRAM-ID FallingParticle
+VERSION 20240225
+COMMENT Calculate the deflection from the vertical caused by the Earth's rotation of a particle falling freely from rest from a height h.
+COMMENT Differential Equations:
+COMMENT x''=-bz'+ay' # x-axis is along latitude, directed to east
+COMMENT y''=-ax' # y-axis is along longitude, directed to north
+COMMENT z''=-g+ax' # z-axis is perpendicular to the surface of earth
+COMMENT g: gravitational acceleration = 9,81 m/s²
+COMMENT a: 2*omega*sin(phi)
+COMMENT b: 2*omega*cos(phi)
+COMMENT omega: rotation velocity of the earth = 2*pi/day
+COMMENT phi: Latitude of location (0-90°)
+COMMENT Initial Condition: z(0)=h
+COMMENT The full solution requires 6 INTEGRATORs, Anabrid-THAT just has 5. The deflection to longitude (y) is neglegible and can be omitted (marked #*).
+COMMENT It could also be solved in a separated algorithm omitting x.
+
+ENVIRONMENT DIVISION
+ENGINE Anabrid-THAT
+TIMEBASE 1ms
+REQUIRES COEFFICIENT 5, INTEGRATOR 5, SUMMER 1, INVERTER 1
+
+DATA DIVISION
+OUTPUT OUTPUT.X x
+OUTPUT OUTPUT.Y y
+OUTPUT OUTPUT.Z z
+COEFFICIENT.1 AY # 2*2pi/day*sin(phi)
+COEFFICIENT.2 AX # = AY
+COEFFICIENT.3 B # 2*2pi/day*cos(phi)
+COEFFICIENT.4 G # gravitational acceleration = 0,981 da-m/s²
+COEFFICIENT.5 H # height h [da-m]
+
+PROGRAM DIVISION
+-1 -> COEFFICIENT.H -> -h
+
+-bz',ay' -> INTEGRATOR -> -x' # Input is x''
+-x' -> INTEGRATOR -> x
+
+y'' -> INTEGRATOR -> -y'
+#* -y' -> INTEGRATOR -> y
+
+z'' -> INTEGRATOR -> -z'
+-z', IC:-h, SJ:limiter -> INTEGRATOR -> z
+CAT:z -> DIODE -> limiter # limit z to >= 0
+
+-x' -> COEFFICIENT.AX -> -ax'=y''
+-y' -> COEFFICIENT.AY -> -ay'
+-ay' -> INVERTER -> ay'
+-z' -> COEFFICIENT.B -> -bz'
++1 -> COEFFICIENT.G -> g
+-ax', g -> SUMMER -> -g+ax'=z''
+
+OPERATION DIVISION
+MODE REPEAT
+OP-TIME 7,3ms