Hi,
I am using GMAT R2015a on Windows 7 (32-bit) and I am encountering a strange behavior when calling GMATFunction.
The spacecraft Earth longitude and the EarthFixed state inside the GMATFunction change if I don't declare the spacecraft as global or if I create any local variable inside the GMATFunction. The spacecraft epoch and inertial state (for instance EarthMJ2000Eq) look however the same.
I attach a minimal script and functions for you to reproduce the issue. I include 3 GMATFunctions that are called by the script sequentially:
test1 - I pass the spacecraft as input to the function. It works well only if I don't include the "Create Spacecraft SC" command, but with it the printout in the report shows me a different state as in the main script. Also the ElapsedSecs is set to 0.
test2 - Declares the spacecraft as Global and it seems to work well.
test3 - Also declares spacecraft as Global, but includes the Creation of a dummy local variable and it fails again to printout the correct EarthFixed state and longitude.
I would appreciate any help or advice.
Thank you,
JM