3
$\begingroup$

I'm simulating the orbit of an object multiple times and it works perfectly most of the time, but sometimes this error appears and I don't know how to fix it.

NAN found in derivative for PointMassForce force element 3, Value is -nan(ind)
NAN found in derivative for PointMassForce force element 4, Value is -nan(ind)
NAN found in derivative for PointMassForce force element 5, Value is -nan(ind)
ODEModel Exception Thrown: The ForceModel DeepSpaceProp_ForceModel generated a derivative that is not a number

The initial ephemeris of the object is taken from a SPICE SPK kernel and the only thing I'm changing between each simulation run is the starting epoch. The mission sequence starts off with an SPK propagator which just loads the initial ephemeris at the epoch I set. The stopping condition for the SPK propagator is ElapsedSecs = 0 so it immediately moves on to the deep space propagator which is giving me the error. (I'm not just using the SPK propagator because the path of the object is going to be changed).

Here are the settings for the deep space propagator:

Create Propagator DeepSpaceProp;
GMAT DeepSpaceProp.FM = DeepSpaceProp_ForceModel;
GMAT DeepSpaceProp.Type = PrinceDormand78;
GMAT DeepSpaceProp.InitialStepSize = 600;
GMAT DeepSpaceProp.Accuracy = 1e-10;
GMAT DeepSpaceProp.MinStep = 0;
GMAT DeepSpaceProp.MaxStep = 864000;
GMAT DeepSpaceProp.MaxStepAttempts = 50;
GMAT DeepSpaceProp.StopIfAccuracyIsViolated = true;

EDIT

The error goes away when the SPK propagator is run for 1 second instead of immediately stopping. I'm not sure why this works since for most epochs this isn't a problem.

Just to clarify, changing the starting epoch only affects the object's starting ephemeris.

$\endgroup$
4
  • $\begingroup$ Welcome to Space Stack Exchange! Just to clarify the starting point, where you say (i) "it works perfectly most of the time" (ii) "the only thing I'm changing between each simulation run is the starting epoch" what do you see as the room for unexpected change between runs? e.g. is the ephemeris/reference frame defined in such a way that the orbit could be non-physical on changing the starting epoch? $\endgroup$
    – Puffin
    Commented Nov 3 at 11:42
  • $\begingroup$ @Puffin sorry but I'm not quite sure what you meant by "the room for unexpected change between runs" but your comment did give me an idea to try letting the SPK propagator run for 1 second before handing it off to the deep space propagator and it worked for some reason? Though this doesn't make sense to me because it works normally on all the other starting epochs. Also another thing, is this method of loading ephemeris data from an SPK kernel by propagating it for 0 seconds even a valid thing to do? $\endgroup$
    – Natalius
    Commented Nov 3 at 14:05
  • $\begingroup$ OK, I just meant what scope is there for the change of epoch to be affecting other parts of the set-up. I can't help on your other news, I don't know Astrogator and was just applying experience from using other propagators. It might help to edit these points in to the question - e.g. put in a bold sub heading "EDIT" at the bottom of the question so that returning readers can quickly see what has changed. $\endgroup$
    – Puffin
    Commented Nov 3 at 14:30
  • 2
    $\begingroup$ @Puffin ty for the reminder! I've added the extra info to the original question $\endgroup$
    – Natalius
    Commented Nov 3 at 16:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.