Jump to content

Time to periapsis in hyperbolic orbit?


Stef Morojna

Recommended Posts

I have been trying to find the formula that gives me the time ( or MeanAnomaly, same thing) to periapsis in a hyerbolic orbit.

I spend some time searching google, wiki etc ( Totally didn't spend 6h searching...) and I found some info, but I can't figure out how to use it in code:

https://en.wikipedia.org/wiki/Hyperbola

http://conicsectionjpg.blogspot.si/2012/10/true-anomaly-of-hyperbola_2603.html

This is my code right now:  

something to note is that I already have all other parameters calculated ( eccentricty, semiMajorAxis etc)

Spoiler

 if (eccentricity < 1.0){    // Elliptical
            trueAnomalyAtStart = Math.Acos (Double3.Dot (_eccV, posIn) / (eccentricity * Double3.Magnitude (posIn)));

            eccentricAnomalyAtStart = 2.0 * Math.Atan (Math.Tan (trueAnomalyAtStart / 2d) / Math.Sqrt ((1d + eccentricity) / (1d - eccentricity)));

            meanAnomalyToPeriapsis = (eccentricAnomalyAtStart - eccentricity * Math.Sin (eccentricAnomalyAtStart));
            // ^ this is the anomaly to periapsis, this is what I actually use to determine the start pos of the orbit

            timeToPeriapsis = meanAnomalyToPeriapsis * meanMotion; // This is just to show the time

     }   else if ( eccentricity >= 1.0){  // Hyperbolic

           // This are the formulas that i'm missing

            trueAnomalyAtStart =  ? ;

            eccentricAnomalyAtStart =  ? ;

            meanAnomalyToPeriapsis =  ? ;

            timeToPeriapsis = meanAnomalyToPeriapsis * meanMotion; // I already have Mean Motion calculated for hyperbolic
    }

 

If someone who knows the formulas could help me, I would Really apreciate it.

Edited by Stef Morojna
Link to comment
Share on other sites

OhioBob's website has the required formulae for hyperbolic trajectories: http://www.braeunig.us/space/orbmech.htm#hyperbolic

I used the details from that page to write something in kOS which works well. I can share that if you like.

The calculation of true anomaly and mean motion is the same, it's the conversion from true anomaly to mean anomaly (via eccentric anomaly) that is different between hyperbolic and elliptical orbits.

Edited by ElWanderer
Had to hit post early as my son was trying to grab my phone!
Link to comment
Share on other sites

59 minutes ago, ElWanderer said:

OhioBob's website has the required formulae for hyperbolic trajectories: http://www.braeunig.us/space/orbmech.htm#hyperbolic

I used the details from that page to write something in kOS which works well. I can share that if you like.

The calculation of true anomaly and mean motion is the same, it's the conversion from true anomaly to mean anomaly (via eccentric anomaly) that is different between hyperbolic and elliptical orbits.

So if I understood correctly, in this article the variable are:

v = True anomaly

r 0 = Periapsis

p = semiLatusRectum

a = semiMajorAxis

Is that correct?

Edited by Stef Morojna
Link to comment
Share on other sites

Yes. It's equations 4.86 and 4.87 that are of particular interest, which only need the semimajoraxis, eccentricity,  true anomaly and gravitational parameter.

It does require being able to calculate sinh() and inverse cosh(), which kOS doesn't have native functions for, so I had to look those up on Wikipedia.

Oh, and the calculation of true anomaly based on radius is in equation 4.82, though as said before this is the same as for an elliptical orbit.

Link to comment
Share on other sites

4 hours ago, ElWanderer said:

Yes. It's equations 4.86 and 4.87 that are of particular interest, which only need the semimajoraxis, eccentricity,  true anomaly and gravitational parameter.

It does require being able to calculate sinh() and inverse cosh(), which kOS doesn't have native functions for, so I had to look those up on Wikipedia.

Oh, and the calculation of true anomaly based on radius is in equation 4.82, though as said before this is the same as for an elliptical orbit.

Ok so this is where I am right now:

Spoiler

            double r0 = _periapsis; // Renamed it for less confusion

            double v = Math.Acos ((semiMajorAxis * (1.0 - (eccentricity * eccentricity) - r0)) / (eccentricity * r0)); // True anomaly, I hope this is correct, i'm not sure if "er" means e * r

            double F =  //eccentricity * Math.Cos(v) / (1.0 + eccentricity * Math.Cos(v));  Problem is here

            eccentricAnomalyAtStart =  eccentricity * Math.Sinh (F) - F; // - F) - (); // I removed "F0" because my "F0" is 0 so it would do nothing

            /*meanAnomalyToPeriapsis =  ? ;

            timeToPeriapsis = meanAnomalyToPeriapsis * meanMotion; // I already calculated Mean Motion for hyperbolic

So the problem is here:

eq4-87.gif

To make this work in code, I would have to move the  "cosh" to the left, I tryed Pow ( cosh(), -1), but it dosen't work.

Edited by Stef Morojna
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...