Jacobian matrix specific to a force model

Spacecraft, Thruster, Tank, Propagator, CoordinateSystem, etc.

Jacobian matrix specific to a force model

Postby prince » Tue Jul 03, 2012 9:47 pm

Is there a way in GMAT to get access to the jacobian matrix of a force model used in a particular propagator? I know other packages like JAT/ODTBX have similar functions to return it.
prince
 
Posts: 16
Joined: Mon Jul 02, 2012 8:02 pm

Re: Jacobian matrix specific to a force model

Postby jjkparker » Thu Jul 05, 2012 2:34 pm

Yes, there is a way (used by ODTBX, in fact). We have an experimental C interface to GMAT that allows you to propagate a spacecraft and get the Jacobian back. Here are the details from an ODTBX perspective: https://sourceforge.net/apps/trac/odtbx/wiki/GmatInterface

But I have to warn you, the C interface currently has bug GMT-2854 that prevents it from working in the newer versions (including R2012a).

If you really want to explore this option, I can provide you with a development build from last year that works.
Joel J. K. Parker
Flight dynamics engineer, GMAT team
http://gmatcentral.org
jjkparker
 
Posts: 617
Joined: Thu Jan 07, 2010 9:48 pm
Location: NASA Goddard Space Flight Center, Greenbelt, MD

Re: Jacobian matrix specific to a force model

Postby jjkparker » Thu Jul 05, 2012 2:35 pm

Here's a reference to the functions exposed by the interface: http://gmat.sourceforge.net/docs/R2012a/capi/_c_interface_functions_8h.html
Joel J. K. Parker
Flight dynamics engineer, GMAT team
http://gmatcentral.org
jjkparker
 
Posts: 617
Joined: Thu Jan 07, 2010 9:48 pm
Location: NASA Goddard Space Flight Center, Greenbelt, MD

Re: Jacobian matrix specific to a force model

Postby prince » Thu Jul 05, 2012 5:32 pm

Thanks! So the only option I have is to use the GMAT C interface. Currently for my application I am calling my custom Matlab functions from GMAT i.e. the GMAT script is acting as the "main" function. I am not sure what is the best way to integrate the C code which will make GMAT C interface calls with the rest of my code. May be I can make a Matlab MEX function for C code which I can call from GMAT script. Any suggestions?
prince
 
Posts: 16
Joined: Mon Jul 02, 2012 8:02 pm

Re: Jacobian matrix specific to a force model

Postby jjkparker » Fri Jul 06, 2012 1:32 pm

Well, you can access the C interface from C (like from a MEX function), or directly from MATLAB using the loadlibrary function. This second method is what ODTBX uses. If you're curious, you can look at the gmatforces_km.m file they use to see how it works.

As for how to structure it, I guess it depends what you're trying to do. ODTBX uses GMAT solely for the Jacobian, so they start in MATLAB and use MATLAB integrators to do the propagation.

Also, if you really just need the state transition matrix (not the Jacobian), GMAT has that built-in.
Joel J. K. Parker
Flight dynamics engineer, GMAT team
http://gmatcentral.org
jjkparker
 
Posts: 617
Joined: Thu Jan 07, 2010 9:48 pm
Location: NASA Goddard Space Flight Center, Greenbelt, MD

Re: Jacobian matrix specific to a force model

Postby prince » Fri Jul 06, 2012 6:14 pm

Thanks a lot. I think "calllib" Matlab function will work fine for my case too as it is in ODTBX.

I actually need jacobian at this time but I got curious on how to access the state transition matrix in my GMAT script, which I might need later in case I want to implement a custom differential corrector scheme. I understand there is a built-in differential corrector solver in GMAT and it can write its internal state at each iteration in the report file automatically but is it possible to access the state transition matrix value after each iteration in GMAT script? I guess the answer may be same: using the libC interface!
prince
 
Posts: 16
Joined: Mon Jul 02, 2012 8:02 pm

Re: Jacobian matrix specific to a force model

Postby jjkparker » Fri Jul 06, 2012 7:56 pm

Check out this topic for an answer to your STM question. Reporting the STM does not need the C interface.

http://gmat.ed-pages.com/forum/viewtopic.php?f=16&t=43527
Joel J. K. Parker
Flight dynamics engineer, GMAT team
http://gmatcentral.org
jjkparker
 
Posts: 617
Joined: Thu Jan 07, 2010 9:48 pm
Location: NASA Goddard Space Flight Center, Greenbelt, MD


Return to GMAT Resources

Who is online

Users browsing this forum: No registered users and 2 guests

cron