|
|
|
@ -38,6 +38,10 @@ Mat3 mat3_rotation_orbital(double omega, double i, double Omega); |
|
|
|
Vec3 calculate_acceleration(Vec3 force, double mass); |
|
|
|
Vec3 calculate_acceleration(Vec3 force, double mass); |
|
|
|
|
|
|
|
|
|
|
|
// Physics integration functions
|
|
|
|
// Physics integration functions
|
|
|
|
|
|
|
|
// RK4 inferior to analytical propagation for orbit simulation
|
|
|
|
|
|
|
|
// In our specific simulation (2-body with SOI patched conics):
|
|
|
|
|
|
|
|
// Analytical: <1e-12 energy drift vs RK4: 2e-7 to 5e-3
|
|
|
|
|
|
|
|
// See tests/test_hybrid_energy_conservation.cpp for comparison
|
|
|
|
void rk4_step(Vec3* position, Vec3* velocity, double dt, |
|
|
|
void rk4_step(Vec3* position, Vec3* velocity, double dt, |
|
|
|
double body_mass, double parent_mass); |
|
|
|
double body_mass, double parent_mass); |
|
|
|
Vec3 evaluate_acceleration(Vec3 relative_pos, double body_mass, double parent_mass); |
|
|
|
Vec3 evaluate_acceleration(Vec3 relative_pos, double body_mass, double parent_mass); |
|
|
|
|