Bug in ProfileThrustPropulsionModel?

Hi all,

I have a buggy behavior using ProfileThrustPropulsionModel and I cannot tell why.
I’ve made a small test to reproduce the problem:
CompareContinuousManeuvers.java (7.5 KB)
I’m comparing two propagations with the same maneuver:

  • The first propagation uses a ConstantThrustManeuver
  • The second propagation uses a Maneuver with a constant ProfileThrustPropulsionModel
  • Both maneuvers last 300s and have the same properties
  • The thrust and isp are made so that the mass consumption is 1mg per time step of my RK4 integrator

After propagation, the first propagator (with constant thrust) has consumed a mass of fuel of dm_1 = 300 / step mg, which is what I would expect.
But the second propagator has consumed a mass of fuel of dm_2 = 300 / step - 0.16667 mg.
I don’t get where that discrepancy of 166.667 µg (=500/3 µg) comes from…
The misfiring duration is always of step/6 s
If I use a 60s step this represents a misfiring of 10s, which is a lot!

Everything seems to be happening at the end of the maneuver with the ProfileThrustPropulsionModel .
I’ve used a step handler in the uploaded file, and the mass consumptions are fine until the last step.

Am I doing something wrong?

Maxime

I wonder if you’re TimeSpanMap::addValidBetween should set a data just after (e.g. by 1ms) your intended end date?

Thanks @PeaDubYa!

I came to the same conclusion this weekend.
It indeed fixes the issue for one single maneuver :+1:

Also, using a variable time step improves the result since the step before the end of the maneuver is much smaller. But the propagation gets very slow.

My problem is that I have a few thousand maneuvers with some maneuvering arcs comprised of several joined ProfileThrustPropulsionModel. So I don’t know if I should slightly shift the beginning of the arc or the end…

Good news!
Its an open interval, so the end time is not included in your specification.
My guess is that the segments are being interpolated and you are trying to represent a discontinuous profile with a smooth interpolation, where it seems the interpolation points are set by the integrator rather than you (I confess I have not looked at the code, just your symptom :slight_smile:, so it is a guess).
Short of digging deeper into the code, perhaps if you want to control the region over which thrust level interpolates, you could try adding in new short “boundary” PolynomialThurstSegment between the segments of different constant level, which is short enough for you not to mind rescinding control over the region of interpolation?

Yes thats’ exactly what’s happening I think.

That’s a very good idea, I’ll try doing that and tell you what I end up with.

Thanks!

Hi again @PeaDubYa,

Some thoughts:

  • Adding short segments to control the interpolation didn’t work quite well and slows down the propagation, it can even freeze it (infinite loop in Hipparchus DetectorBasedEventState) if the segment is small enough
  • If I try with one single ProfileThrustPropulsionModel to model thrusting and coasting (i.e. without thrust) arcs, I have interpolation errors.
  • The only workaround I found to have a proper computation of my thrusting and coasting arcs is to design one Maneuver with one ProfileThrustPropulsionModel per thrusting arc with the trick of adding a small overshoot (say 1ns) to the last segment of my thrusting arc.
1 Like