Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orbit propagation consistency #120

Open
fe-de opened this issue May 19, 2023 · 8 comments
Open

Orbit propagation consistency #120

fe-de opened this issue May 19, 2023 · 8 comments

Comments

@fe-de
Copy link

fe-de commented May 19, 2023

Hello Eric!
I'm currently struggling to understand how to correctly propagate the orbit dynamics in 42 and I'd like your help in solving some doubts.
I'll report here the results for a 6U satellite (no sensor or actuator modeled, only a single body) in LEO using only the spherical harmonics gravitational field and no other perturbations. I've compared the results obtained with 42 with the ones given by GMAT in the same testing conditions (LEO orbit, simulation over 90 days using a 10s integration step, EGM96 gravity field model, max degree 2, RK4 numerical integrator).
I've done different tests in 42 considering different configurations for the input files and for the integration options, but none of them provides reasonable results in terms of orbital parameters profile. As I was mentioning, 42 simulation is pretty straightforward as I'm considering a simple satellite equipped with the PASSIVE_FSW. For each simulation test in 42, I retrieve the keplerian parameters from the output files PosN and VelN and I compare their profile with GMAT.

In the attached folder the following set of test results is available:

  • Test 0: only the Secular Orbit Drift due to J2 in the orbit file is set to TRUE, while the Gravity Perturbation Forces are FALSE. The results here seem acceptable, as only the secular drift is included (in the zip folder I included also the input files that I used to generate the results)
  • Test 1: the Secular Orbit Drift due to J2 is now set to FALSE, while the Gravity Perturbation Forces are TRUE, considering the Earth Gravity model with N=2 and M=2; the Orbit Prop is set to ENCKE. As it can be seen in the plot, the parameters profile is quite strange if compared to GMAT
  • Test 2: same perturbations as the previous test but with the Orbit Prop is set to COWELL. Also here, the result is quite strange. While the eccentricity profile seems okay, the SMA and INC profiles are wrong

Here the zip folder containing the results:
42_orbit_propagation.zip

I've done a lot of other tests considering different inputs (by changing the Dynamics Flags options, activating both the secular drift and the gravity perturbation forces) but none of them seem to provide reasonable outputs. Am I missing something? How should I propagate the orbital dynamics of a LEO satellite to take into account correctly the gravity perturbation forces?

Thanks
-Fede

@ericstoneking
Copy link
Owner

Hi Fede,

Thanks for the data. I see what you're talking about. I'll have to squirrel this away till I have some time to devote to it.

In the meantime, the easiest way to get 42 to agree with GMAT is to use GMAT outputs as 42's inputs. I've done this in the past for three-body orbits, and most of the code is in place for central orbits as well. Looking at the code, it appears that there's one or two missing connections. Search 42init.c for INP_SPLINE, and 42ephem.c around line 500, and you'll see what I mean. I should be able to get this done within a week.

Regards,
-Eric

@fe-de
Copy link
Author

fe-de commented May 25, 2023

Hi Eric,

thank you for checking the data and for your answer.
I'll try to use directly GMAT inputs as you suggested while waiting for the updates on 42 code.

Thanks
-Fede

@ericstoneking
Copy link
Owner

Hi Fede,

I just committed changes so that you can ingest an orbit and interpolate it using a cubic spline. Look for Demo/EllipSpline.txt and Demo/Orb_Ellipse.txt as an example.

@fe-de
Copy link
Author

fe-de commented May 26, 2023

Hi Eric,
thank you very much for the adjustments to the code.

Since I would really like to use 42 also to simulate orbital maneuvers, do you have a rough estimate of the time that you'll need to fix the propagation core in 42? I was considering to interface 42 with another propagator to simulate the orbital propagation step by step by adding also the propulsion force. But it seems a useless effort for many reasons.

Thanks
-Fede

@ericstoneking
Copy link
Owner

Hi Fede,

"Fixing the propagation core in 42" is a months-if-ever timeframe. This is not my day job, and the only sure way to achieve 100% agreement with GMAT is to reverse-engineer it. (Old saying: "He with one watch knows what time it is; he with two watches is never sure.")

Let me make a suggestion, though, that might be made to fit your needs. The Orb_ input file defines the Reference Orbit. The spacecraft can wander from its reference orbit under the influence of whatever forces aren't bookkept by the reference orbit. So whatever GMAT can model, put those influences in the reference orbit, and apply the leftover forces (thrusters, solar sails, etc) to the S/C, with "Orb Prop" set to ENCKE. This plays to the strengths of both GMAT and 42, and, if it fits your requirements, you're good to go today.

Regards,
-Eric (he/him)

@mhmodayman
Copy link

mhmodayman commented May 28, 2023

Hello @ericstoneking and @f-e-d-e

@ericstoneking, First, I would like to thank you, you already helped me a lot with issues I encountered while using your code.

After reading your discussion, I want to confirm my understanding that orbit propagation is not accurate in 42.
Is this the case that the propagator has issues, causing inaccuracies in orbit propagation within 42?

@ericstoneking, I am using your code as part of my work, so it is very important for me to have the correct results.

Regards
Mahmoud

@fe-de
Copy link
Author

fe-de commented Jun 9, 2023

Hi Eric,

I followed your suggestion and I'm using GMAT splines in the Orb file to initialize the reference orbit.
I include the main orbital perturbations inside GMAT (gravity, drag, ...) while I use 42 to add forces to simulate the thrust effects. However, something does not work as expected.
I use the PROTOTYPE_FSW to maintain the attitude aligned with the velocity vector of a 6U S/C and I implemented a second controller to apply an ideal force in the S/C CoM (through the IdealFrc) to simulate a constant low-thrust force.
By performing a simple simulation with a reference orbit coming from GMAT that only includes J2 perturbations and a constant force (of 2.5mN) applied direclty in 42 and fixed on the velocity vector, the result shows the strange behavior reported below.
Here is the simple propagation obtained from GMAT (J2 perturbation) without any force added in 42
Immagine 2023-06-09 113032
Here, instead, is the simulation with the constant force applied
Immagine 2023-06-09 112809

As it is possible to notice from the simple propagation, the reference orbit is loaded correctly from 42, but the problem arises when I try to include an external force in the model.
Do you have any suggestions on what I am missing?

Thanks,
-Fede

@ericstoneking
Copy link
Owner

One thing to check: are you exerting your Ideal Actuator force in B[0] or N? Looking at 42actuators.c, it's expected to be expressed in B[0].

Beyond that, you might be on your own. I threw together a quick example on my installation, and I get plausible results. But I'm not pushing it as hard as you are, so your mileage may vary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants