AVSLab / basilisk

Astrodynamics simulation framework
https://hanspeterschaub.info/basilisk
ISC License
147 stars 61 forks source link

Bug/thruster state effector isp factor #759

Closed andrewmorell closed 3 months ago

andrewmorell commented 3 months ago

Description

A hard coded value is removed from the thrusterStateEffector that was erroneously forcing mass depletion always on. Then mass depletion logic is updated to check ThrustFactorto see if a thruster is firing rather than IspFactor which is unused by the thrusterStateEffector. Additionally, the mass depletion is changed to now scale its expenditure according to the scaled value of thrust following ramp up/down.

Verification

The FuelTank mass depletion unit test already produces plots of the fuel expenditure for a thruster dynamic and state effector, and the state effector's plots for mass and massDot vs. time now accurately reflect the firing pattern. While mass depletion was being plotted, no assertions were made as to accuracy of the values, so two assertions have been added to the fuel tank's mass depletion unit test checking that massDot is ramped up when the thruster is firing and ramped down when the thruster is commanded off.

Additionally, the thrusterStateEffector unit test is updated to scale the thrust by its ramp up/down factor when computing truth values for massDot comparison when toggled on for mass depletion force contributions.

Documentation

No documentation is invalidated by these changes, just fixing code to match what the documentation outlines. Release notes and known issues have been updated to identify this issue and resolution.