I'm trying to model a halo orbit at low altitude (10m from surface). The satellite is using propulsion to trace the circular halo path. It looks like this "from the top" (the blue ball is Earth and the yellow circle is the path traced by the satellite as it goes around the halo orbit):
Here is the code and an online simulation you can run on the browser: https://trinket.io/glowscript/b4fcc6b248
In the simulation, the satellite is subject to 2 forces:
- gravity, which pulls it towards Earth, and
- a centripetal force, which pushes it towards the center of the halo orbit
The simulation works, but given only the initial parameters, the orbit eventually becomes unstable and diverges
If the initial speed is too fast, the satellite will "shoot out" away from the planet (like in the picture below)
If the initial speed is too slow, the satellite will "fall to Earth" (the bodies are not solid in the simulation, so it goes through the planet to the other side)
This is the code that calculates the gravitational force between the bodies:
F12=-G*earth.m*satellite.m*norm(r12)/mag(r12)**2
From the equation: F = GMm/r^2
And here's the Centripetal force:
v = satellite.p/satellite.m
rv = rotate(v, angle=pi/2, axis=satellite.pos)
Fc = norm(rv)*(satellite.m*mag(v)**2)/halo_orbit_radius
Which comes from the Centripetal force formula: F = mv^2/r
r in this case is the radius of the halo orbit
rv is a vector that is perpendicular to the satellite's tangential velocity on the halo orbit plane (it points towards the inside of the halo orbit), it is produced by rotating the v velocity vector 90ยบ (pi/2)
Are there better equations to simulate this?
Thank you
I know I could technically just have the satellite simply trace a circle. But I want that behavior to "emerge" from the equations that model the forces acting on the system
I also found this, but it's for a Lagrange point orbit, and apparently the equations are way more complicated: James Webb Space Telescope's halo orbit at Lagrange point L2


