|
From: Bogdan U. <bog...@vi...> - 2023-08-20 01:23:19
|
Aloha GMAT Team,
I have a question about reporting a user-defined variable at each propagator step. I have a requirement to determine the angle between the servicer, client, and miscellaneous celestial bodies. I have just found the wonderful GMAT Angle function that allows me to calculate them angles on the fly. For example,
GMAT sunAngle = Angle( Client, Servicer, Sun );
GMAT lunaAngle = Angle( Client, Servicer, Luna );
where Client and Servicer are the two spacecraft in my simulation.
I would like to output the angles in a report, at each step of the propagator, with a ReportFile defined like so:
Create ReportFile anglesRep;
GMAT anglesRep.SolverIterations = Current;
GMAT anglesRep.UpperLeft = [ 0 0 ];
GMAT anglesRep.Size = [ 0 0 ];
GMAT anglesRep.RelativeZOrder = 0;
GMAT anglesRep.Maximized = false;
GMAT anglesRep.Filename = 'Angles.txt';
GMAT anglesRep.Precision = 16;
GMAT anglesRep.Add = {Servicer.ElapsedSecs, sunAngle, lunaAngle};
GMAT anglesRep.WriteHeaders = true;
GMAT anglesRep.LeftJustify = On;
GMAT anglesRep.ZeroFill = Off;
GMAT anglesRep.FixedWidth = true;
GMAT anglesRep.Delimiter = ' ';
GMAT anglesRep.ColumnWidth = 23;
GMAT anglesRep.WriteReport = true;
This obviously doesn't work because the propagator doesn't know how to calculate the angles. The report returns zero for the angles, i.e., the values that I have initialized sunAngle and lunaAngle.
I have read the GMAT help files and looked at several tutorials, but I haven't been able to find a way to report a user-defined variable at each propagator step.
I am writing to ask if there's a way to report a user-defined variable at each propagator step.
Right now, the only workaround is to output (to file) the position vector of the servicer and a celestial body in, say, the LVLH reference frame of the client and calculate the angle from those.
Thank you,
BU
|