We're updating the issue view to help you get more done. 

Finite Burn Modeling needs to use Current State

Description

In some calculations, the GMAT finite burn models use the state and epoch data from the spacecraft rather than from the propagator. This produced subtly incorrect accelerations that may grow over time, resulting in poor modeling of the trajectory. The issue is that the numerical integrators evaluate forces at intermediate states during propagation ("stages" for the Runge-Kuttas and , and in the "predictor" code for the ABM). The spacecraft state, mass, and epoch are not updated at these stages, so code that calls the spacecraft for those settings returns the wrong values.

Here is a list of places that use this approach:

FiniteBurn.cpp:

Definite Issue:

bool FiniteBurn::Fire(Real burnData, Real epoch, bool /*backwards/)
{
...
tMass = spacecraft->GetRealParameter("TotalMass");

(Likely of no consequence, but need to be checked):

bool FiniteBurn::TakeAction(const std::string& action,
const std::string& actionData)
{
...
else if (action == "SetData")
{
if (spacecraft)
{
// Load starting data into the data buffer
Real epoch = spacecraft->GetEpoch();

PowerSystem.cpp:

Definite Issue:

Real PowerSystem::GetBasePower() const
{
Real atEpoch = spacecraft->GetEpoch();

Real PowerSystem::GetSpacecraftBusPower() const
{
Real atEpoch = spacecraft->GetEpoch();
Real *state = (spacecraft->GetState()).GetState();

Real PowerSystem::GetThrustPower() const
{
Real atEpoch = spacecraft->GetEpoch();

Real PowerSystem::GetSunToSCDistance(Real atEpoch) const
{
Real *state = (spacecraft->GetState()).GetState(); // wrt Earth NOT wrt Origin

SolarPowerSystem.cpp:

Definite Issue:

Real SolarPowerSystem::GetPowerGenerated() const
{
...
// Get the spacecraft epoch and state
Real atEpoch = spacecraft->GetEpoch();

Real *stateRelToEarth = (spacecraft->GetState()).GetState();

Thruster.cpp:

Calls made to (check that the epoch is correct):

void Thruster::ConvertDirectionToInertial(Real *dir, Real *dirInertial, Real epoch)
{
...
Rmatrix33 inertialToBody = spacecraft->GetAttitude(epoch);

(Likely of no consequence, but need to be checked):

bool Thruster::Initialize()
{
...
// Convert direction to inertial coord system
Real epoch = spacecraft->GetRealParameter("A1Epoch");

The FiniteThrust model calls FiniteBurn, which then calls the hardware elements. The current code does not pass the stage state data into the "Fire" call used to get the thrust and mass flow data. That method needs to pass in the data, and then the FiniteFrust force needs to use that data and pass it into the hardware.

Note that the thrust history file does not have this issue because it implements the acceleration as a force directly, rather than through calls to other objects.

Environment

None

Activity

Show:
djc@thinksysinc.com
January 1, 2021, 5:50 AM

Note: Thinking Systems has an approach for fixing this code that is implemented in an internal build based on R2020a. I can merge that change as needed.

Steve Cooley
5 days ago

DJC thinks for a long burn, GOES needs this.

Assignee

djc@thinksysinc.com

Reporter

djc@thinksysinc.com

Labels

Development Build

None

Components

Fix versions

Priority

P1
Configure