ConstantThrustManeuver and ParameterDriver

Hi all,

I’m using a propagator to simulate electric propulsion by using the class ConstantThrustManeuver. I’ve been using it a lot by predefining all the maneuvers I wanted to do, but this time I was hoping to only implement one maneuver for the whole duration of the simulation and only play with the level of thrust “on the fly” but setting the value of the ParameterDriver thrust as follows:

for (ForceModel fm : propagator.getAllForceModels()) {
	if (fm.isSupported("thrustthrust")) {
		fm.getParameterDriver("thrustthrust").setValue(thrustEst);
	}
}

It changes the value just fine but I’m not sure it does exactly what I intend to as it seems like the update of the value of thrust does not impact the value of the mass flow rate which stays constant to zero as I’m initializing the force with a null thrust:

ConstantThrustManeuver thrust = new ConstantThrustManeuver(iniDate.shiftedBy(1e-15),
				Double.POSITIVE_INFINITY,
				0,
				ispSat,
				Vector3D.MINUS_K,
				"thrust");

propagator.addForceModel(thrust);

for (ForceModel fm : propagator.getAllForceModels()) {
	if (fm.isSupported("thrustthrust")) {
		fm.getParameterDriver("thrustXthrust").setSelected(true);
	}
}

Would you have any idea on how to update the whole force? (thrust + flow rate) Or is there sthg I forgot to do when updating the value of the parameter driver ?

Thank you very much for your help !

Kind regards,

B.

Hi @benoist,

If I understand well you want to update the flow rate but keep a constant Isp for your maneuver, right ?

Two options:

  1. Manual update: do the same for the flow rate as what you do for the thrust.
    fm.getParameterDriver("flow rate").setValue(-thrustEst / (g0 * ispSat));
    Beware that you cannot use ConstantThrustManeuver.getIsp() to get ispSat. You need to keep this value as it is at the beginning (see below why).

  2. Automatic update: I think you will have to design your own force model for this.
    It will be largely based on the ConstantThrustManeuver class though.
    The way it works in Orekit is that the flow rate q is initialized with q = -thrust / (g_0.Isp).
    So in your case q = 0.
    Then you have to choose to either estimate the thrust or the flow rate (the 2 parameters depend on each other).
    Since you’re estimating the thrust, you cannot estimate the flow rate.
    Thus your flow rate is never updated and always 0.
    I wonder what happens if you call method getIsp in your case, you must probably get a NaN since it involves a division by 0.
    To do it simply, in your new model:

    • Add an attribute isp that you set in the constructor to the wanted value;
    • Remove the flowRateDriver and all reference to it, and change getFlowRate with return -getThrust() / (Constants.G0_STANDARD_GRAVITY * isp);
    • in both addContribution methods, change the line:
      adder.addMassDerivative(parameters[1]);
      With:
      adder.addMassDerivative(-parameters[0] / (Constants.G0_STANDARD_GRAVITY * isp));
      Note: You’ll need to adapt the last line for the “field” method.
      That way your flow rate will depend on your thrust level and your isp will stay the same.

Tell us how this worked for you.

Have a good day,
Maxime

Hi Maxime,

Thank you very much for your help. I’ve implemented what you suggested and it works great. I have an additional question then, I’d be interested to use that new class to simulate errors on the two axis perpendicular to the thrust (X,Y if Z is the thrust axis).

If I make sure the flow rate remains positive (by taking the absolute value of the thrust) do you think the propagation will perform correctly handling negative thrust? I’ve set the minimum and maximum value of the thrust to -1 and +1.

Kind regards,

B.

Hi benoist,

This new model is in the branch maneuver-package in the Git repository.
It is not official nor fully validated yet; but you can try using it.
I’d like to work on it but unfortunately I have no time these days…
The propulsion model you need is the ScaledConstantThrustPropulsionModel class.
It will estimate 3 scale factors (on X Y and Z components of your initial thrust). Note that this class does not estimate the flow rate (design choice).
You can constrain the value of the scale factors using the dedicated constructor.

Is this question related to the classical ConstantThrustManeuver of Orekit or to the new (draft) maneuver package ? I’m a bit lost.
The flow rate should be negative (you’re losing mass when maneuvering, not gaining mass).
With the classical ConstantThrustManeuver you’ll end up with a negative Isp if you are using a negative thrust. The thrust in this model must be understood as the norm of the thrust, not the algebraic value of the thrust. Thus it doesn’t make sense, mathematically speaking, to set it to a negative value.
With the new model the 3 components of the thrust can vary freely in a 3D space (so negative components are ok). And the flow rate will remain constant and negative.

Does that answer your question(s) ?

Maxime

Hi Maxime,

Thank you very much for your answer! I’ll try this class you’re mentionning.

And indeed I meant negative earlier.

Kind regards,

B.