Problem with Numerical Propagator Tolerances


#1

I am following an example in setting up a numerical propagator in Python:

Adaptive step integrator

with a minimum step of 0.001 and a maximum step of 1000

minStep = 0.001
maxStep = 1000.0
positionTolerance = 10.0
propagationType = OrbitType.KEPLERIAN
tolerances = NumericalPropagator.tolerances(positionTolerance,initialOrbit,propagationType)
absTolerance = tolerances[0]
relTolerance = tolerances[1]

Variable Step Dormand Prince Integration

integrator = DormandPrince853Integrator(minStep,maxStep,absTolerance,relTolerance)

When I try to examine the values for tolerances, I get the following message:

tolerances
JArray[<Object: [D@2131229e>, <Object: [D@34577542>]

What is odd is my similar implementation in Matlab runs fine. Any help would be appreciated.


#2

Hi,

Yes, the python wrapper/JCC has some quirks with double arrays and one needs to cast them explicitly using the cast_ operator.

An example of this is shown in the example notebbok:

section

integrator = DormandPrince853Integrator(minStep, maxstep, 
    JArray_double.cast_(tol[0]),  # Double array of doubles needs to be casted in Python
    JArray_double.cast_(tol[1]))
integrator.setInitialStepSize(initStep)

Regards


#3

Thanks. That fixed the issue. I will peruse the examples in the future if I have other issues.