Ball script circular orbit setup #985
Replies: 3 comments 1 reply
-
Hi, Sean,
Yes, it’s very possible that things got switched around. I’ll try and take a look at it soon, but can’t get to it today.
Jon
|
Beta Was this translation helpful? Give feedback.
-
So I had a quick look at calculating the orbital velocity. https://en.wikipedia.org/wiki/Vis-viva_equation Given a circular orbit jsbsim/src/models/FGInertial.cpp Lines 58 to 62 in 5c31c25 Using the Vis-viva equation: >>> import math
>>>
>>> alt = 800000
>>> GM = 14.0764417572e15
>>> earth_a = 20925646.32546
>>>
>>> r = earth_a + alt
>>> r
21725646.32546
>>>
>>> v = math.sqrt(GM*(2/r - 1/r))
>>>
>>> v
25454.237455218088
>>> Which is a much higher velocity. So I must be missing something in terms of calculating the required orbital velocity. I double-checked my calculation for jsbsim/src/models/FGPropagate.cpp Lines 499 to 502 in 5c31c25 Which matches my calculation of VState.vInertialPosition
{data=0x00000000006f9c20 {21725646.325459998, 0.0000000000000000, 0.0000000000000000} } |
Beta Was this translation helpful? Give feedback.
-
Ah, thanks @bcoconni. Although there is still the mix-up in the initial conditions file between which one is the correct one to use for WGS84. Specifying a couple more decimal places for the velocity decreases the eccentricity even closer to 0. v = 23869.978340 Eccentricity = 5.2821191864893535e-11
v = 23869.97834067227 Eccentricity = 6.6613381477509392e-16 I'll update the initial conditions file. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
@jonsberndt while debugging the issue with regards to the argument of perigee I noticed that the eccentricity for the ball script wasn't 0, it was 0.0015. The code use 1e-8 as a cut-off in determining whether the eccentricity is close enough to 0 or not.
I sort of wondered/assumed you had tried to set up a perfect circular equatorial orbit, but wasn't 100% certain if that was your intention and/or whether there was some floating point lack of precision playing a part. I didn't pursue it too much at the time.
However taking another look now I noticed the following when looking more closely at the ball script etc.
In
ball_orbit.xml
you specifically set the gravity model to 1, which is the WGS84 ellipse model.jsbsim/scripts/ball_orbit.xml
Line 23 in 5c31c25
Which is the default gravity model.
jsbsim/src/models/FGInertial.cpp
Lines 56 to 62 in 5c31c25
Then in
reset00_v2.xml
there are the following values and comments with regards to setting the initial velocity.jsbsim/aircraft/ball/reset00_v2.xml
Lines 16 to 19 in 5c31c25
If I simply switch the x velocity to use the value calculated supposedly for the spherical earth gravity model then the eccentricity drops down to effectively 0.
So are the two x velocity values and their comments simply switched around, mixed up in
reset00_v2.xml
?@bcoconni I noticed that you tweaked the values in the last commit for this file in 2016, although you were simply tweaking the values after the decimal point - 36de9ac
Beta Was this translation helpful? Give feedback.
All reactions