GMATFunction issue with EarthFixed state & longitude

Post here for assistance in troubleshooting a problem using GMAT

GMATFunction issue with EarthFixed state & longitude

Postby JMSanchezPerez » Mon Oct 17, 2016 4:29 pm

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
Attachments
test3.gmf
(693 Bytes) Downloaded 208 times
test2.gmf
(667 Bytes) Downloaded 203 times
test1.gmf
(530 Bytes) Downloaded 208 times
test-GMATfunctions.script
(7.96 KiB) Downloaded 187 times
JMSanchezPerez
 
Posts: 1
Joined: Mon Oct 17, 2016 3:53 pm

Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 2 guests

cron