problem w ith GetMJ2000Acceleration method?

Development related to the GMAT core and GUI

problem w ith GetMJ2000Acceleration method?

Postby marchand » Tue Dec 31, 2013 4:16 am

I was trying to figure out, in the GMAT source code, how to extract - at any given epoch - the derivative of the spacecraft state vector, to retrieve the accelerations basically. The first thing I tried was using the GetMJ2000Acceleration method of the SpacePoint class. I used the ObjectReferencedAxes and the LibrationPoint class in GMAT as my models for how to use the method, since they both employ it in their underlying calculations. When I stepped in with the debugger, into both of these classes, I noticed something strange. Regardless of the epoch specified, the method ALWAYS returns zeros. That struck me as odd, and possibly wrong, but I'm not sure what ya'll meant for the method to really do.

Anyway, I gave up on that and tried a different approach. There is a GetDerivativesForSpacecraft method in the ODEModel class. That actually returns unique non-zero values for each epoch requested, but I'm not sure what values those are supposed to be. What is the origin and the reference axes, that is. I assume the results are expressed in terms of an MJ2000Eq system that is centered at the primary body specified in the Propagator's force model, and that the units are in km and km/sec^2. Can someone confirm that is in fact correct? Basically, what I need, at any given value of time, is the result of this evaluation:

dx(t)/dt = f(t,x)?

where x is the state vector, t is the time, and f represents the equatiosn that GMAT numerically integrates during the propagation.

As for the GetMJ2000Acceleration method issue, in case you're curious, I verified it always returns zero by editing the LibrationPoint class and replacing these lines:

Code: Select all
Rvector3 a    = (secondaryBody->GetMJ2000Acceleration(atTime)) -

with these:
Code: Select all
Rvector3 a2 = secondaryBody->GetMJ2000Acceleration(atTime);
Rvector3 a1 = primaryBody->GetMJ2000Acceleration(atTime);

Real a21 = a2.Get(0);
Real a22 = a2.Get(1);
Real a23 = a2.Get(2);

Real a11 = a1.Get(0);
Real a12 = a1.Get(1);
Real a13 = a1.Get(2);

Rvector3 a = a2-a1;

When I added a21, a22, a23, a11, a12 and a13 to the VS2010 variable watch, they were always zero. Is that method "broken" or is this what you expect it to return? Can you explain what the result is supposed to be, if not the body-centered MJ2000Eq accelerations of the SpacePoint itself?
Posts: 86
Joined: Tue Feb 21, 2012 2:42 pm

Return to Core Development

Who is online

Users browsing this forum: Bing [Bot] and 1 guest