Hi all,
I am currently implementing a custom DSST maneuver as a PythonAbstractGaussianContribution and wrapped around a base maneuver class which uses a custom PythonThrustPropulsionModel. This propulsion model works as intended with a numerical propagator, however when implementing it in the DSST maneuver class, there is no change in satellite mass even though I have a mass derivative and flow rate (the thrust and thrust direction work properly). In fact, it appears that these methods do not get called during the DSST propagation. As an aside, I am wondering if I am implementing the getLLimits method for the DSST maneuver correctly in terms of the lMin and lMax I am returning.
propulsion_model = PropulsionModel(thrustDirectionProvider, self.thrusterAxisInSatelliteFrame, self.thrust_max, self.isp)
maneuver = Maneuver(thrustDirProvider, man_triggers, propulsion_model)
if isinstance(self.propagator,DSSTPropagator):
maneuver = DSSTManeuver(maneuver)
class DSSTManeuver(PythonAbstractGaussianContribution):
def __init__(self, maneuver):
self.maneuver = maneuver
super(DSSTManeuver, self).__init__("DSST-maneuver-", 1e-8, maneuver, Constants.WGS84_EARTH_MU)
def getLLimits(self, state, auxiliaryElements) -> list:
lMin = state.getLv() - np.pi
lMax = state.getLv() + np.pi
return [lMin, lMax]
def getEventsDetectors(self):
return list(self.maneuver.getEventsDetectors().toArray())
def getParametersDriversWithoutMu(self):
return self.maneuver.getParametersDrivers()
def getParametersDrivers(self):
return self.maneuver.getParametersDrivers()
class PropulsionModel(PythonThrustPropulsionModel):
def __init__(self, thrustDirectionProvider, thrusterAxisInSatelliteFrame, *prop_params):
super().__init__()
self.thrustDirectionProvider = thrustDirectionProvider
self.thrusterAxisInSatelliteFrame = thrusterAxisInSatelliteFrame
self.prop_params = prop_params
if prop_params:
self.thrust_max = prop_params[0]
self.isp = prop_params[1]
def init(self, spacecraftState, absoluteDate):
pass
def getParametersDrivers(self):
return Collections.emptyList()
def getDirection(self, s):
direction = Vector3D.MINUS_I
return direction
def getFlowRate(self, s, parameters):
thrust_mag, _ = self.thrustDirectionProvider.computeThrust(s, self.prop_params)
if self.prop_params:
if self.isp > 0:
flow_rate = - thrust_mag / (self.isp * 9.80665)
else:
flow_rate = 0
else:
flow_rate = 0
return float(flow_rate)
def getIsp(self, s):
if self.prop_params:
return float(self.isp)
else:
return float(0)
def getMassDerivatives(self, s, doubleArray):
thrust_mag, _ = self.thrustDirectionProvider.computeThrust(s, self.prop_params)
flow_rate = - thrust_mag / (self.isp * 9.80665)
return float(flow_rate)
def getThrust(self, s):
thrust_mag, _ = self.thrustDirectionProvider.computeThrust(s, self.prop_params)
return thrust_mag
def getThrustVector(self, s, parameters):
thrust_mag, _ = self.thrustDirectionProvider.computeThrust(s, self.prop_params)
# propulsion vector in spacecraft frame
thrust_vec_u = self.thrusterAxisInSatelliteFrame.toArray()[:]
thrust_vec = thrust_mag * np.array(thrust_vec_u)
if thrust_mag == 0:
thrust_vec = Vector3D(-1e-20,0.0,0.0)
else:
thrust_vec = Vector3D(float(thrust_vec[0]),float(thrust_vec[1]),float(thrust_vec[2]))
return thrust_vec