I tried something…
I tried to let TimeSpanMap extending CopyOnWriteArrayList and removed the syncronized keys (I maybe removed too much synchronized but I wonder CopyOnWriteArrayList is thread safe). Thanks to that, the propagation duration is divided by 2
=============
Propagation start: 2000-01-01T11:58:55.816Z
Propagation end: 2000-01-08T11:58:55.816Z
Number of maneuvers: 8
Propagation duration: 0.139
=============
Propagation start: 2000-01-01T11:58:55.816Z
Propagation end: 2000-01-08T11:58:55.816Z
Number of maneuvers: 158
Propagation duration: 0.519
=============
Propagation start: 2000-01-01T11:58:55.816Z
Propagation end: 2000-01-08T11:58:55.816Z
Number of maneuvers: 658
Propagation duration: 2.6310000000000002
It does not fully solved the problem. But it is something interesting for simulations containing a lot of maneuvers.
Just so that I fully understand: do you (or @pauline) have “active” (selected) parameter drivers (for partial derivatives either directly or indirectly via OD)? If yes which ones? On the thrust vector only, the start/stop dates only, or both?
Ok so in that case, the following code is basically identical to a single ConstantThrustManeuver and should be much faster:
final double thrustMagnitude = 1.;
final Vector3D thrustDirection = Vector3D.PLUS_I;
final Vector3D thrustVector = thrustDirection.scalarMultiply(thrustMagnitude);
final ThrustVectorProvider thrustVectorProvider = new ThrustVectorProvider() {
@Override
public Vector3D getThrustVector(AbsoluteDate date, double mass) {
return thrustVector;
}
@Override
public <T extends CalculusFieldElement<T>> FieldVector3D<T> getThrustVector(FieldAbsoluteDate<T> date, T mass) {
return null;
}
};
final TimeSpanMap<ThrustVectorProvider> timeSpanMap = new TimeSpanMap<>(thrustVectorProvider);
final double isp = 100.;
final ProfileThrustPropulsionModel propulsionModel = new ProfileThrustPropulsionModel(timeSpanMap, isp, "");
final AbsoluteDate startDate = AbsoluteDate.ARBITRARY_EPOCH;
final AbsoluteDate endDate = startDate.shiftedBy(10);
final TimeInterval timeInterval = TimeInterval.of(startDate, endDate);
final TimeIntervalsManeuverTrigger trigger = TimeIntervalsManeuverTrigger.of(timeInterval);
final Maneuver maneuver = new Maneuver(null, trigger, propulsionModel);
As such it requires the develop branch, but the trigger could also be reimplemened fairly easily, the point is just to have no ParameterDriver. The nice thing with TimeIntervalsManeuverTrigger though is that it generalizes to N burns, with a single ForceModel.