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

Argument of perigee only valid if both inclination and eccentricity are non-zero #981

Merged
merged 1 commit into from
Nov 11, 2023

Conversation

seanmcleod
Copy link
Member

Issued raised here - #834 (comment)

@heshpdx
Copy link
Contributor

heshpdx commented Nov 8, 2023

@bowers and I confirm that this patch allows the ball orbit script to produce the same exact output on linux and windows. Thank you!

@seanmcleod
Copy link
Member Author

Yep, I'm just waiting for @jonsberndt to review my logic and the changes to make sure that they make logical sense. Just because we're getting the same results via gcc and MSVC doesn't mean my logic is correct 😉

Also, @bcoconni and @agodemar could potentially also double-check the orbital mechanics logic I've gone with.

@agodemar
Copy link
Contributor

agodemar commented Nov 8, 2023

@seanmcleod this pull request is fine to me. Thanks for the improvement
-a

@seanmcleod
Copy link
Member Author

@agodemar I'm not sure why you're referencing @jentron in terms of the pull request, I submitted the pull request 😉

@agodemar
Copy link
Contributor

agodemar commented Nov 8, 2023

@seanmcleod pardon my lapsus ;-)

@jonsberndt
Copy link
Contributor

Yep, I'm just waiting for @jonsberndt to review my logic and the changes to make sure that they make logical sense. Just because we're getting the same results via gcc and MSVC doesn't mean my logic is correct 😉

Also, @bcoconni and @agodemar could potentially also double-check the orbital mechanics logic I've gone with.

Hi, @seanmcleod,

Sorry it took so long for me to respond. I think your logic is correct and seems like you have solved the problem. I don't have any objections to this.

I may be taking a look at my astrodynamics book this evening and will see if I can find something more specific for argument of perigee in equatorial orbits. It also makes me ask the question if our calculations are robust enough to also handle polar orbits.

@seanmcleod seanmcleod merged commit 44a3acd into JSBSim-Team:master Nov 11, 2023
27 checks passed
@jonsberndt
Copy link
Contributor

One more comment: In "Fundamentals of Astrodynamics (2nd ed.) there is this on page 48:

"If there is no ascending node (equatorial orbit) then both ω and u₀ are undefined."

ω - argument of perigee
u₀ - argument of latitude at epoch

So the question is: what's the best approach to assigning values to argument of perigee in an equatorial orbit? Is a value of 0.0 incorrect or misleading? Can a value of #undef (whatever that might be) be assigned? Does that make sense, or is it even legal?

@seanmcleod
Copy link
Member Author

Yep, my understanding is that the argument of perigee isn't defined in this case and so set it to 0, although 0could be misleading. Setting it to 0 was partly also based on there being existing code which set it to 0 if the eccentricity was < 1e-8.

I guess one option is to return a floating point nan to make it clear it's not defined, although other code may not handle nan potentially causing exceptions etc.

@seanmcleod
Copy link
Member Author

One more comment: In "Fundamentals of Astrodynamics (2nd ed.) there is this on page 48:

I have the first edition from 1971. Found the same sentence on page 60.

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

Successfully merging this pull request may close these issues.

4 participants