Hello again everyone
I’m trying to set up DragForce
to emulate the behavior of TimeSpanDragForce
. I created my own DragSensitive
model where the drivers are now TimeSpanMap
instances instead just numbers. This works fine when propagating, however, when I use the force model in my OD, the CDs estimated are wrong, already from the first iteration. Any idea of where the problem could come from?
This is my DragSensitive
model (in Python):
class MyDragSensitive(PythonDragSensitive):
def __init__(self, cd, area, dates):
SCALE = FastMath.scalb(1.0, -3)
dragCoef = float(cd)
dragArea = float(area)
drivers = ArrayList().of_(ParameterDriver)
drivers.add(ParameterDriver(DragSensitive.GLOBAL_DRAG_FACTOR,
1.0, SCALE,
0.0, Double.POSITIVE_INFINITY))
namesMap = TimeSpanMap('drag before')
valueMap = TimeSpanMap(Double(dragCoef))
for ii, date in enumerate(dates):
name = 'Cd%02d'%ii
namesMap.addValidAfter(name, date, False)
valueMap.addValidAfter(Double(dragCoef), date, False)
drivers.add(ParameterDriver('Cd',
namesMap, valueMap,
dragCoef, SCALE,
Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY))
# drivers.add(ParameterDriver('drag coefficient',
# dragCoef, SCALE,
# Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY))
self.area = area
self.drivers = drivers
super().__init__()
def dependsOnAttitudeRate(self):
return False
def dragAcceleration(self, state, rho, relVel, params):
mass = state.getMass()
if isinstance(relVel, Vector3D):
cdA = params[0]*params[1]*self.area
val = self.ore.Vector3D(relVel.getNorm()*rho*cdA/(mass*2), relVel)
else:
cdA = params[0].multiply(params[1].multiply(self.area))
val = FieldVector3D(relVel.getNorm().multiply(rho.multiply(cdA)).divide(mass.multiply(2)), relVel)
# print(val)
return val
def getDragParametersDrivers(self):
return self.drivers
Edit: Never mind, found the issue… I forgot that since I now have to estimate all of the CDs, the first one when instantiating the TimeSpanMap
will also be estimated. The way I was constructing it before, that CD had no GNSS data during the OD