test_lambertSolver
- test_lambertSolver.lambertSolverTestFunction(show_plots, p1_solver, p2_revs, p3_times, p4_eccs, p5_angles, p6_align, accuracy)[source]
Compare one module update with independently constructed reference velocities.
- test_lambertSolver.test_lambertSolver(show_plots, p1_solver, p2_revs, p3_times, p4_eccs, p5_angles, p6_align, accuracy)[source]
Validation Test Description
Check both Lambert algorithms over revolution counts, flight times, conic eccentricities, transfer angles, and alignment thresholds. Zero-revolution reference velocities come from classical orbital elements through
orbitalMotion, independently of the Lambert outputs. Multi-revolution reference velocities come from the external Python Izzo implementation.Test Parameters
- Parameters:
show_plots – Plotting flag supplied by the shared test interface.
p1_solver – Lambert solver algorithm.
p2_revs – Number of complete revolutions.
p3_times – Multi-revolution flight time in seconds; derived from the reference orbit for zero revolutions.
p4_eccs – Dimensionless eccentricity of the reference orbit.
p5_angles – Transfer angle in degrees, reduced modulo 360 for the endpoint geometry.
p6_align – Alignment rejection threshold in degrees.
accuracy – Absolute tolerance for velocities in m/s and the dimensionless multi-revolution roots.
Description of Variables Being Tested
Both endpoint velocities and both validity flags are checked. For zero revolutions, flight time follows Kepler’s equation for ellipses and hyperbolas, and Barker’s equation for parabolas. Elliptic mean-anomaly differences are wrapped forward into one revolution so long arcs and negative or greater-than-360-degree input angles retain the intended orbit. The expected endpoint velocities are retained separately from the recorded module outputs. These analytical checks require no numerical propagation.
Multi-revolution cases also check the free variable
xagainst the external reference. Rejected alignment or infeasible flight time must produce zero velocities and cleared validity flags in both slots.
- test_lambertSolver.test_zero_revolution_rejects_corrupted_velocities(monkeypatch, solver_name, eccentricity, velocity_field)[source]
Require the independent reference to detect an error in either endpoint velocity.
Perturb only the recorded solver output by 1 m/s, leaving the orbit-derived reference untouched. This must fail the corresponding velocity assertion for both algorithms and all four conics; a self-comparison would pass.