Jump to content

Math Illiterate needs help with a Molniya Orbit.


Recommended Posts

Hello all - Unfortunately I am pretty much a Math illiterate.. I did not really learn math as a kid in School.. I had some bad teachers. I've actually learned more math playing KSP and being a Soldier than I ever did in school :confused: Actually I never understod what a square root was before playing with orbits and satelites in KSP. :D

Being a math illiterate is not all bad when you guys are so awesome at giving out math equations were you can just plot in the relevant numbers and get the result you want. How ever.. I am at an impasse.

I am attempting to setup a Molniya orbit around Duna. I know that since there are no oblateness in the bodies in KSP dont have to be specific with my inclination - and thus I have decided on a flat 60° inclination.

I know that I will be using 3 satelites - I will use a satelite carrier to space them evenly around the planet at 100 or 150km altitude (depending on Ike SOI). Right now I am trying to find out how high my AP should be... So I can be sure I have enough Δv on the satelite - and that their orbital period will be correct.

I found this youtube movie that explained how to calculate the semi major axis as well as the AP:

 

I also found this post that explains the math a little different.


How ever.. I dont know how to insert the numbers correct in the formula it seems.

I got really weird numbers for Duna - so I tried to just follow the guy in the youtube movie and punch in his numbers into the formula to see if I would get the same result.. and I did not get the same result as him:

iEH0Dzi.png

Can someone help me understand how to write this formula into a calculator? And better yet.. can someone could walk me through the math on how to calculate the Molniya Orbit..? I would be really grateful - and I would love to be able to just use a formula and be able to make Molniya orbits for what ever body I find.

Thx in Advance.

Edited by BechMeister
Link to comment
Share on other sites

Although you are asking about orbits in the game, I believe the math and physics involved will be the real science, once adjusted for scale. I've therefore moved your question to the Science sub where I suspect more of the mathy type people will see it. Good luck. :) 

Link to comment
Share on other sites

19 minutes ago, Vanamonde said:

Although you are asking about orbits in the game, I believe the math and physics involved will be the real science, once adjusted for scale. I've therefore moved your question to the Science sub where I suspect more of the mathy type people will see it. Good luck. :) 

Thank you Vanamonde.

3 minutes ago, mikegarrison said:

I suspect you will have trouble avoiding Ike, because Duna is more like a double planet than it is like Mars.

Well I wont know before I know how to calculate my Apoapsis.. I can lower the Periapsis if needed. Or I will have to change the orbital period? But I wonder If I will need 6 satellites then. In any case.. I cannot check this this as long as I dont know how to calculate it. :/

Link to comment
Share on other sites

As you pointed out, there is nothing special about Molniya orbits in KSP. All you're really looking for is an orbit whose period is a simple fraction of the planet's sidereal period. That would ensure that after some number of orbits around the planet, the satellite is at its PE or AP (as desired) over the exact same point. For Molniya specifically, that ratio is 1/2, meaning that after two orbits of the satellite, the planet below makes one full revolution. But you can build around a different fraction if you find, for example, that some celestial body gets in the way, or some other problem arises with the numbers you get. You can go for 2/3 for a higher orbit or a 1/3 for a lower one, for example, giving you the repeat point every 3 orbits in either two or one revolution of the planet respectively.

The rest is pretty straight forward. First you just look up the sidereal period of the planet or moon you're interested in. Duna's is listed as 65,517.859s. If you're going for a 1/2 ratio of the Molniya, you're going for half of that: 32,758.93s. That's your satellite's orbital period T. You plug that into the orbital period formula.

T = 2π(a3/μ)1/2

Here, a is the semi-major axis of the orbit and μ = GM is the gravitational parameter. You can look up gravitational constant G (which is the same as real world) and mass of the planet M separately, but KSP wiki lists the μ directly, which for Duna is 3.0136321×1011m3/s2

You can rearrange the formula above to solve for the semi-major axis.

a = (μ T2/(2π))1/3

And we can now substitute this into the Google calculator as follows.

(3.0136321E11m^3/s^2 * (32758.93s)^2 / (2 * pi))^(1/3)

I'm using the scientific notation for the gravitational parameter, with E11 equivalent to x1011. I'm also using all of the units as an extra check, but these are optional, and the value of pi is left for Google to deduce. If you're punching that into the ordinary calculator, you might have to enter pi manually. Likewise, there might not be a simple way to enter the gravitational parameter, in which case you'll just have to type out the long form.

Anyways, Google does the heavy lifting here, so that gets us the answer 3,719.831km (or 3,719,831m)

 

Note that this is the semi-major axis. It means the distance between AP and PE is going to be twice that number. And because the distance between AP and PE has the entire planet in between, and the values for AP and PE are reported from datum (sea level or arbitrary elevation for barren worlds like Duna), you have to subtract the diameter. In short, if you want to know AP for a give PE, you'd use the following formula:

AP = 2a - 2R - PE.

Here, R is the planet's radius, which, again, courtesy of wiki, is 320km for Duna.

So say you want a Molniya orbit with a PE of 100km. Plugging that into the equation above like this.

2 * 3,719.831km - 2 * 320km - 100km

And you get 6,699.662km. You can probably round that to 6,700km without significant loss of precision.

Link to comment
Share on other sites

Posted (edited)

Thank you so much @K^2 - I think what every one did, because it was so obvious, that I didnt see. Was that they retracted the diameter of the planet. Also you knowing how to make google calculate the things in the right order helped. I kept getting graphs instead of a number :D 

Just to be sure - this works for any planet in KSP right? So if I do these steps and lift the numbers off the wiki for respective bodies. It will just work right?

Also another question if you will allow me. When I tried myself I never knew if I should take the Sidereal rotation period or the Sidereal Orbital Period. I can see you took the Sidereal Rotation Period.

Just because I know I remember better if I understand the difference - what is the difference?

Edited by BechMeister
Link to comment
Share on other sites

1 hour ago, BechMeister said:

Also you knowing how to make google calculate the things in the right order helped. I kept getting graphs instead of a number

They really keep making that feature work worse and worse, but usually, when you have an expression with units, it just gives you an answer. Of course, that also doesn't always work. One day I'll get fed up with it and write my own. I really just need a simple expressions evaluator that has physics constants and units pre-programmed, which isn't that hard to make. But that's a tangent, sorry.

1 hour ago, BechMeister said:

Just to be sure - this works for any planet in KSP right? So if I do these steps and lift the numbers off the wiki for respective bodies. It will just work right?

Yeah. The only weird thing that I can think of in KSP is that you might get AP that's above the SoI cutoff, which would make that orbit impossible. I don't know if anything in the game rotates slow enough for that to be a problem. But in that case, just go to a lower fraction, like 1/3, 1/4, etc. It means you'll only be hitting correct spot over the planet/moon once in that many orbits, but that shouldn't be a big deal. You might just need more satellites for coverage in these cases. Again, I don't know if that'd even come up, but just in case.

1 hour ago, BechMeister said:

Also another question if you will allow me. When I tried myself I never knew if I should take the Sidereal rotation period or the Sidereal Orbital Period. I can see you took the Sidereal Rotation Period.

Just because I know I remember better if I understand the difference - what is the difference?

Orbit is for the path the whole body takes, while rotation is referencing the object turning around its own axis. So an orbital period of a planet is that planet's year, while rotational period is that planet's day.

The word "sidereal" in both of these means that we're taking far away stars as a reference point. The distinction is most obvious when you think about the rotation period of a planet, like Earth. As the Earth rotates around its own axis, it's also moving around the Sun. So after making a full (sidereal) revolution, the Earth will be in the same orientation with respect to the stars, but the Sun will now be at a different angle. As a result, a full solar day takes a sidereal rotation period plus a little bit.

When you're looking for any kind of synchronous orbit, what you're really doing is matching the sidereal orbital period of a satellite to a sidereal rotational period of the planet. Because then, both end up at the same orientation with respect to the stars and, consequently, with each other, which is what you want.

Link to comment
Share on other sites

Posted (edited)
1 hour ago, K^2 said:

Yeah. The only weird thing that I can think of in KSP is that you might get AP that's above the SoI cutoff, which would make that orbit impossible. I don't know if anything in the game rotates slow enough for that to be a problem. But in that case, just go to a lower fraction, like 1/3, 1/4, etc. It means you'll only be hitting correct spot over the planet/moon once in that many orbits, but that shouldn't be a big deal. You might just need more satellites for coverage in these cases. Again, I don't know if that'd even come up, but just in case.

That makes sense - just like a geostationary orbit around the Mun is impossible.  x)

1 hour ago, K^2 said:

Orbit is for the path the whole body takes, while rotation is referencing the object turning around its own axis. So an orbital period of a planet is that planet's year, while rotational period is that planet's day.

That makes a lot of sense - So the first number is a Sidereal year for Duna, and the second number is for, what ever object, in question you put in a sidereal orbit - gotcha.

1 hour ago, K^2 said:

As a result, a full solar day takes a sidereal rotation period plus a little bit.

Yeah that makes sense. 

I am currently writing my progression In a Mission Report for KSP2 - I want to write down the math rundown so other people can reference it (and I can find it myself easy) - Do you mind If I credited you for the help in that post? (I know that some people don't enjoy being pinged left and right)

 

Edited by BechMeister
Link to comment
Share on other sites

I was about to write the explanation for what you showed me (I have found that if I explain the process in my own words I understand it better)  and it did reveal some things that I am not quite sure.

17 hours ago, K^2 said:

a = (μ T2/(2π))1/3

in this equation. Is the there something missing? I can see that in the calculation:

(3.0136321E11m^3/s^2 * (32758.93s)^2 / (2 * pi))^(1/3)

you're taking μ and multiply it with T- correct?  is the equation supposed to be a = (μ *T2/(2π))1/3 ?

Second question:

3.0136321E11m^3/s^2 - what happens when you divide with s? Is S calculator shorthand for something, like  E11 is calculator language for *1011 ?

 

Link to comment
Share on other sites

/s^2 is ' per second per second'

This is a unit used in acceleration.

Then Multiplying it by s^2 turns it into a static(not time dependent) unit.

 

 

Link to comment
Share on other sites

3 hours ago, BechMeister said:

you're taking μ and multiply it with T- correct?  is the equation supposed to be a = (μ *T2/(2π))1/3 ?

Yeah. It's common to skip multiplication signs in algebraic notation, but it has to be explicitly typed out in an expression you feed to something like Google Calculator. So when writing an algebraic formula, I might write something like xy2, but in a calculator it'd become x * y^2.

(Some algebraic engines, like Mathematica, can handle algebraic notation exactly as written, but that's another tangent.)

Link to comment
Share on other sites

11 hours ago, Terwin said:

/s^2 is ' per second per second'

This is a unit used in acceleration.

And the calculator just knows this? Does it translate S into another formula or? - Sorry if I am asking really dumb questions... I really appriacte both you and @K^2 taking your time to explain this to me x)

11 hours ago, Terwin said:

Then Multiplying it by s^2 turns it into a static(not time dependent) unit.

Okay - So maybe I got a graph because I forgot to do the S^2 first? I just assumed I should remove the S's because they were not numbers.

Link to comment
Share on other sites

Posted (edited)

There is a thing called "dimensional analysis".

For example: F = ma

F is force, which has units of mass*length/time*time

m is mass, which is just mass (we'll skip over relativity)

a is acceleration, which is length/time*time

So the dimensions match up, because we have mass*length/time*time on one side of the equation and also on the other side.

In the equation you are discussing, you can't really ignore the dimensions like seconds even though you don't plug them into the calculator. You still have to make sure that they match up on both sides of the equation.

Edited by mikegarrison
Link to comment
Share on other sites

Posted (edited)
41 minutes ago, mikegarrison said:

In the equation you are discussing, you can't really ignore the dimensions like seconds even though you don't plug them into the calculator. You still have to make sure that they match up on both sides of the equation.

Okay - is this what @K^2 talks about when he mentions that this has been done for us in the numbers the Wiki provides us here:

On 5/1/2024 at 4:00 AM, K^2 said:

Here, a is the semi-major axis of the orbit and μ = GM is the gravitational parameter. You can look up gravitational constant G (which is the same as real world) and mass of the planet M separately, but KSP wiki lists the μ directly, which for Duna is 3.0136321×1011m3/s2

 

But I still don't understand what the S i underlined substitutes: (3.0136321E11m^3/s^2 * (32758.93s)^2 / (2 * pi))^(1/3) - Because It is my understanding that letters in equations always substitutes some number, or equation? I guess my problem in my head is that I see that part as being divided by a (to me) unknown number.. I have a feeling its something very obvious - like how I did not understand that I should subtract the planets diameter to the semi major axis :D

Because the equation collapses if I remove the s right? (3.0136321E11 * (32758.93)^2 / (2 * pi))^(1/3) - oh wait it does not... - I got the same result hah argh. :blush: Okay.. So the m³/s² is literally just to show that Its square meter pr. second cubed... So we know what the number is.. its for us not the calculator.

Well even though I answer my own questions I'll still post this in case some one else sees it and have the same questions.

Thank you all.

Edited by BechMeister
Link to comment
Share on other sites

4 minutes ago, BechMeister said:

So we know what the number is.. its for us not the calculator.

Well, in this case both. Google's calculator already "understands" units, so you can just put numbers in with the units they are in, and it will take that into consideration when doing math.

For a simple example, lets say you're traveling at 5m/s for 2 hours and you want to know how far you traveled in miles. Distance is just speed times time, so d = v * t, but you can't just multiply 5 * 2 here, because units don't match. Normally, you'd have to convert hours into seconds, then do the multiplication, and then you'd still have result in meters, which you need to convert into miles.

Instead, Google lets you to just type in the following.

5m/s * 2 hours to miles

And it will spit out 22.369 miles as an answer. It's the correct result and in units you wanted.

 

Under the hood it's doing the same thing that maybe you recall from school science class, where there would be fractions inserted to cancel the units. It would look something like this

(5 m/s) * (2 hours) * (3600 s/hour) * (1 mile / (1609.34 m))

and then you'd go through and cancel the seconds, hours, and meters (because they show up in numerator and denominator the same number of times) and you'd be left with

(5 * 2 * 3600 / 1609.34) miles

And if you multiply out just the numerical part here, you'll get 22.369. Google's calculator does all of that for you, so you don't have to put in unit conversion factors so long as you put everything else in with the correct units.

Link to comment
Share on other sites

Posted (edited)

Since I am European I actually never had to do that.. as far as I recall, its been a few years now since I had science classes x) But we used meters etc. already - if we did it, its only been for the novelty of doing it.. and it did not stick with me.

I think i've only ever done it when going from grams to liters (with stuff that isn't liquids of course) in physics maybe? but its for far in the past that I can remember...

Any way.. Now I just wonder why the equation works with and without the m³/s²?

Edited by BechMeister
Link to comment
Share on other sites

12 hours ago, BechMeister said:

Any way.. Now I just wonder why the equation works with and without the m³/s²?

Because all of the units are already matching. You can do all of the math here with numbers separately and units separately. If you evaluate the units only, the expression simplifies as follows.

(m3/s2 * s2)1/3 = (m3)1/3 = m3 * 1/3 = m

So this tells us that the answer will be in meters, which is what we want. And then the numerical part can be done by just multiplying the numbers together, which is why you get the same numerical answer.

The reason to put in the units anyways is basically a self-check. If you made a mistake in the formula, you'll either get strange units out or an error. For example, if you were to forget to square the period, you'd end up with (m3/s)1/3 = m/s1/3, and because cube root of seconds (s1/3) isn't a physical unit, you'd get some form of an error. Which is preferable, in my opinion, to getting a number that's completely wrong, using it without realizing, and ending up having to scrap the mission.

The other reason is convenience. Even if you're in metric, you might be dealing with hours or kilometers, not just seconds and meters. Google calculator will make that conversion for you.

Link to comment
Share on other sites

K ninja’d me (and did a better job, as usual).

There are two kinds of letters in these equations: Variables and Units.

”How much” and “of what”

If all the units are compatible with your final result, you can ignore them and just put the numbers in. The units only need to be accounted for if they’re mixed.

For instance, if you wanted the end result for semimajor axis in km, you’d have to convert the gravitational parameter to km^3/s^2. (I messed this up the first time I started calculating orbits.)

3.01x10^11 m^3/s^2 * (1km / 10^3m)^3 = 3.01x10^2 km^3/s^2.

Exponent rules:

(10^3)^3 = 10^9 (Exponent to an exponent multiplies)

10^11 / 10^9 = 10^2 (Exponent divided by exponent subtracts, multiplied adds)

 

Link to comment
Share on other sites

On 5/1/2024 at 1:20 AM, K^2 said:

One day I'll get fed up with it and write my own. I really just need a simple expressions evaluator that has physics constants and units pre-programmed, which isn't that hard to make.

This is how I know you don’t own an HP48. :D 

My SX could do this in 1994. There’s a shortcut on the keyboard for the units menu.

(Also, you can troll TI84 users by putting it in the soft case and punting it 100ft down the hallway of the math building. The 84’s suffer a full memory reset if you drop them a couple feet.)

Absolutely glorious pieces of hardware—Every nerd should try one. I need to steal mine back from my dad.

Link to comment
Share on other sites

6 hours ago, K^2 said:

The reason to put in the units anyways is basically a self-check. If you made a mistake in the formula, you'll either get strange units out or an error. For example, if you were to forget to square the period, you'd end up with (m3/s)1/3 = m/s1/3, and because cube root of seconds (s1/3) isn't a physical unit, you'd get some form of an error. Which is preferable, in my opinion, to getting a number that's completely wrong, using it without realizing, and ending up having to scrap the mission.

thank you all. I think I finaly understand it.. to a user level. Its funny how KSP has been a better math teacher than my math teacher. I always just assumed I was dumb when it comes to math. But when people take the time to sit down and answer my questions. I get along in the end x)

 

1 hour ago, FleshJeb said:

My SX could do this in 1994. There’s a shortcut on the keyboard for the units menu.

This quote reminds me of when my father talk about how he prefere win95 xl to the new one - he says it makes some errors that 95 xl didnt.. I always just shrug - I dont ever think I asked xl to do anything advanced enough to figure out x)

But man.. people bantering about calculators is why I love this forum.

Link to comment
Share on other sites

5 hours ago, FleshJeb said:

This is how I know you don’t own an HP48. :D 

You right, I don't. I have owned, and still do, actually, a number of Ti calculators, including the infamous 92.  89 and 92 are both capable of some symbolic math and do handle units reasonably well, but there are also a lot of rough edges.

Plus, I don't want to carry a calculator with me in the modern age. If I'm going to make this, it's going to be a JS app hosted through github in all likelihood. That way I can run it from desktop or a phone wherever I am.

Link to comment
Share on other sites

I just wanted to say That I "succesfully" made a "Molniya" orbit thx to you guys - The timing is a bit off I think.. but the period is correct at least x) I posted some pictures and gifs of the process in this blog:

 

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...