Getter for the stepsize in fixed step integrators

Hello,

I was wondering why the method getStepSize of integrators is protected. This prevents the initialisation of a ClassicalRungeKuttaFieldIntegrator from a given ClassicalRungeKuttaIntegrator. Or am I missing something?

Cheers,
Romain.

Hi,

I also don’t see why this method should be protected ? I would say +1 to make this method public.

Cheers,
Vincent

Hi,
Agreed, however getStepSize gives the current step size so it would return the current step size for an adaptative step size integrator and the fixed step size (so current also…) for a classical RK integrator.
I don’t know if this is an issue or should be documented appropriately.
Another option would be to return the constant attribute step in RungeKutta(Field)Integrator to avoid any misunderstanding.
But maybe I’m just quibbling…

1 Like

Hello,

It might be indeed a bit risky to add a getter to adaptive stepsize schemes. My point mostly stands for fixed step ones, where it’d be handy to be able to retrieve the original step given at construction. Note: I believe it is possible for a fixed step integrator to use different sizes in a given run, as the last step usually needs to be smaller?

Cheers,
Romain.

You’re right I didn’t think of the last step.
So +1 for your initial solution.
Maybe we should ask the opinion to actual Hipparchus developer ;).
@luc, @bcazabonne any objection to opening this issue ?

AbstractIntegrator already has a getCurrentSignedStepsize method. Maybe this should be moved upward to the top level interface?

In fact it is already in the interface.

Thanks Luc :sweat_smile:
Guess we should have dug a little bit deeper…

Beware at start it is probably Double.NaN (mainly for adaptive stepsize integrators). I did not look when exactly the setter is called.

I’m afraid that doesn’t satisfy my need because:
1/ as hinted by Luc, it is only initialized after a first run so null at construction
2/ I believe it will be equal to the last step in general, so a smaller size than the rest for fixed step schemes
I think the simplest thing would be to add a getter in RungeKutta(Field)Integrator for the value passed to the constructor

Best,
Romain.

So… Are we ok to add a getter for the stepsize given originally to the constructor?
Also, it’d be nice to be able to retrieve the integrator scheme (maybe even just its name) from an integrated propagator in Orekit, but that’s another story…

Cheers,
Romain.

Sure.
Contribution welcome!

1 Like