Gravity Engine 2 5.1
|
Gravity engine uses NBody units (nbu) (https://en.wikipedia.org/wiki/N-body_units) internally. This allows the numerical integration to work with values without worring about loss of precision due to odd choices of scale (e.g. galaxy simulation in cm). More...
Classes | |
struct | GEScaler |
Public Types | |
enum | Units { DL , SI , SI_km , AU , CR3BP_SCALE } |
Units Length Unit Time Unit Velocity DL SI m sec. m/sec SI_km km sec. km/sec AU 1 AU sec. km/sec CR3BP 1.0. More... | |
Static Public Member Functions | |
static double | DistanceConversion (Units from, Units to, CR3BP.CR3BPSystemData crsbpSysData=null) |
static string | DistanceShortForm (Units unit) |
static double double geTimePerGameSec | GetGandTimescale (Units units, double orbitScale, double orbitMass, double gameSecPerOrbit) |
static double | GForUnits (Units units) |
static string | MassShortForm (Units unit) |
static double | VelocityConversion (Units from, Units to, CR3BP.CR3BPSystemData crsbpSysData=null) |
static string | VelocityShortForm (Units unit) |
Gravity engine uses NBody units (nbu) (https://en.wikipedia.org/wiki/N-body_units) internally. This allows the numerical integration to work with values without worring about loss of precision due to odd choices of scale (e.g. galaxy simulation in cm).
These units rescale such that inside GECore: M=1 R=1 G=1 M => All world masses are scaled by the total mass of the system R => Divide all distance by the size of the reference orbit (in true nbu this would be the virial radius of a cluster of bodies, since the lineage of nbu is stellar cluster modelling) G => this is a choice. By choosing G=1, time scale is affected.
See https://nbodyphysics.com/ge2/html/scaling.html
Since this is always somewhat confusing, consider a concrete example: Earth satellite, in orbit of 7000km in SI units. Me = 5.972E24 kg, R=7E6 m, V=7531 m/s G_si = 6.674E-11 m^3/(kg s^2)
World => GE Earth mass => Me/Me = 1 Orbit radius = Rorbit/Rref = 1 V * Sqrt(R/(G_si M)) = 7512 * 1.33E-4 = 1
GE => World Mass => * M Distance => *R Velocity => * Sqrt(G_si M/R) Time => * Sqrt(R^3/(G_si M)) 1 s => 931.8 world sec
One orbit period for R=1, M=1, G=1 takes T=2 Pi. The integration step size in GE is typically chosen as 1000 steps per orbit or 2 Pi/1000 = 0.00628. This corresponds to a world time of 5.85 sec.
The orbit above has a period of 5851 sec. or about 1.63 hours.
Units Length Unit Time Unit Velocity DL
SI m sec. m/sec SI_km km sec. km/sec AU 1 AU sec. km/sec CR3BP 1.0.
CR3BP is scaled for a specific circular restricted 3-body system in which the scale length has been set to one, and the timescale (inverse of angular freq. of the system, which is period/2Pi). The position and velocity are defined in the co-rotating coordinate system.