test_exponentialAtmosphereStepLag
Test that the atmosphere base class evaluates the spacecraft state extrapolated to the step midpoint.
- test_exponentialAtmosphereStepLag.test_density_is_evaluated_at_extrapolated_position()[source]
Verify the density uses the state advanced by half of the message age.
A state with a radial velocity, written at the start of the simulation and rewritten one step later, must give the density of the position advanced by v * dt / 2. The same state written at the current time, or a zero velocity, is not advanced.
- test_exponentialAtmosphereStepLag.test_first_update_is_not_extrapolated_before_the_task_period_is_known()[source]
Verify the extrapolation waits for two spacecraft write times.
The state is written at 0 s and rewritten at 10 s. The update at 10 s has seen one write time only and is not extrapolated; the update at 20 s has seen an interval equal to the module period and is.
- test_exponentialAtmosphereStepLag.test_message_written_at_the_module_update_is_not_extrapolated(moduleStep, writeTimes, stopSeconds)[source]
Verify a message written at the time of the module update is used as written.
A spacecraft that runs before the module in the task, with a different task period, writes its message at the time of the module update. The message has no age, so it needs no extrapolation, and the sampled write times cannot show the task period mismatch. The density must be that of the written position.
- test_exponentialAtmosphereStepLag.test_one_mismatched_spacecraft_disables_the_extrapolation_of_all()[source]
Verify the extrapolation is applied to all spacecraft of a module or to none.
The planet state is shared by all spacecraft, so moving it for one spacecraft would make the geometry of another one inconsistent. With both messages written at the previous module update (0 s) the first spacecraft is extrapolated. If the second message was last written at 15 s, which is not the previous module update, the first spacecraft is not extrapolated either.
- test_exponentialAtmosphereStepLag.test_stale_message_is_never_extrapolated()[source]
Verify a state written once at the start of the simulation is not extrapolated.
The module updates at 0, 10 and 20 s. A state that is never rewritten has no observed spacecraft task period and is stale after the first update, so the density must be that of the written position.
- test_exponentialAtmosphereStepLag.test_task_period_mismatch_disables_the_extrapolation(moduleStep, writeTimes, stopSeconds)[source]
Verify a spacecraft updated faster or slower than the module is not extrapolated.
The state written by the spacecraft is not the output of the previous module update, so half of its age is not the middle of the module interval. The density must be that of the written position, whichever direction the task period mismatch goes.
- test_exponentialAtmosphereStepLag.test_translating_planet_does_not_change_the_density()[source]
Verify the spacecraft and the planet are evaluated at the same epoch at every update, including the startup.
The spacecraft and the planet move together at 30 km/s, so the altitude is constant. At every update the planet message is written at the current time while the spacecraft message is one step old. Before the task period of the spacecraft is known (the first updates) the spacecraft is not extrapolated, so the planet must be moved back to the epoch of the spacecraft message. Extrapolating only one of them would shift the relative position by up to v * dt and change the density. The density is checked at the update at 0 s, at the first positive-time update and at all the following ones.