Jump to content

calculate dark side period


Recommended Posts

I'm trying to practice much tighter engineering, so I'm beginning to design my rockets/vessels to just reach design specifications.

One that I've run into is battery life. I'd like to know if there's a way to calculate my satellite's time in the dark according to gravity and altitude.

Edited by purpletarget
Link to comment
Share on other sites

Easy enough. You want to find the orbital period of the spacecraft and then divide it in half, as you'll be in darkness for half of an orbit.

The formula for orbital period is as follows:

Pi*2 (squareroot) (A^3/U)

Where:

Pi = 3.14

A = Semi Major Axis of the orbit.

U = Gravitational Parameter of parent body.

So pretending you're on Kerbin, we can calculate orbital period. I'll do this as an example for you. It works anywhere, but you have to have the right values. IE: Gravitational parameter is different with each planet.

So say we have a satellite in a 92x74km orbbit.

To find semi major axis, we have to do another equation. Also easy enough. The diameter of Kerbin is 1200km. Add the periapsis and apoapsis to that and then divide the total sum in half.

Semi Major Axis is 683 kilometers.

We know Kerbin's gravitational parameter. It's 3530.461 km^3/s^2 (those units won't even be used)

So the total equation for orbital period of a 92x74km orbit is this:

pi*2 [squareroot] (683^3/3530.461)

So we then have our orbital period in seconds. It's 1,887.510248 seconds. But minutes is a much nicer value. Divide that by sixty.

Orbital Period of our orbit is 31.46 minutes.

Now if we want to know how much time will be spent in darkness, it's actually not 100% accurate for eccentric orbits (as you might be moving faster or slower on the dark side depending on the longitude of your AP/PE) but it will give you a pretty good idea.

In that orbit, we'd spend APPROXIMATELY 15.73 minutes in darkness.

Link to comment
Share on other sites

mmmmm math :). by far my favorite part of playing this game. No other game gives you a chance to sit down and bust out some fun equations like this one.

Yeah I know. Last year around this time, I flew some real time Kerbin Orbit missions in a capsule and kept myself busy by testing out orbital mechanics theory in the game. Things like orbital energy, period, transfer delta-v, etc.

Link to comment
Share on other sites

Determining the orbital period is part of the process, but depending on the size of the orbit, it can be much less than half the time. LPO orbits are close enough that it's around half, but out at a semi or Geo Stationary, it can be a lot less.

So, it helps to split the planet, and orbit down the middle and do some quick trig...

The Semi-Major axis from the centre of the planet, to the orbit of your satellite, as AncientAstronaut described is your hypotenuse side and the shadow zone forms a right angle that can be only as wide as the planet's radius...so 600km. Take the sin of that angle, and you'll have 1/2 of the orbit angle that will be spent in darkness. Double the angle for the other side of the planet, and you'll have a full angle out of 360, which will give you the proper fraction of your orbit in darkness.

So, LKO orbit at 80km + R 600km, = aSin (600/680) = ~62 degrees, double for the other side of the planet for 124/360 degrees times 31min orbital period and we're closer to 11 minutes.

At KSO, with SA around 2868km = 3468km. aSin (600/3468) = 10 degrees, so 20/360 of 6 hours will give us 20 minutes in darkness.

Link to comment
Share on other sites

  • 2 years later...

What the hell. This is actually exactly what I am trying to solve. - But the solutions here aren't exactly correct.

Being in the shadow is nothing like the "half of the orbit" - that's a ridiculous over estimation, and only even close for LKO - for any other orbit it's off by a mile. (for KEO it's about 8-10 times as little). An image that shows how the calculation works:

D31E7.png

Where the sun would be to the far left.

For a circular orbit this is quite easy to calculate. The image should show the basic equation already (remember to add 600km to the altitude to get the radius).

gif.latex?r_%7Borbit%7D%20%5Csin%20%5Ctheta%20%3D%20R_%7Bkerbin%7D

And the time can be calculated from:

gif.latex?t%3DT%5Cfrac%7B%5Ctheta%7D%7B%5Cpi%7D

Where T is the orbital period:

39a113020f05c658deef664318c4814b.png

And here mu stands for the gravitational parameter (and r is again the altitude + 600 km, radius kerbin).

Now for a generic-an orbit that is not a circle this is quite involving to calculate. At Physics.SE and Math.SE I've got two questions running to solve this problem, anyone who could help me is more than welcome. :).

Link to comment
Share on other sites

@jbakes:

If you know the specific orbit (meaning you know Apoapsis and Periapsis) then you can calculate the orbital period. (See https://en.wikipedia.org/wiki/Orbital_period)

@paul23:

The longest possible time the ship spends in the shadow is when the apoapsis of the ships orbit is in the shadow.

The calculation for this shadow-duration is explained in

http://wiki.kerbalspaceprogram.com/wiki/Orbit_darkness_time

or you might have a look in chapter 9.2 of my physics of KSP documentation.

Link to comment
Share on other sites

@mhoram: actually I'd like to see proof for that function. - I have tested it by running a "simulation" and calculating the time in eclipse at several (kind of many) points in the eclipse. Using the simple mathematics I've shown in the stackexchange posts:

231iCCA.png

This is done using kerbin gravitational constant & radius. And an semi major axis of 1E7, an eccentricity of 0.925.

As you can see the "maxima" are not coinciding with the sun in the apoapsis, rather the maxima are slightly before/after that point. Now the point in apoapsis is quite close and for nearly any other orbit it is correct: but for the highly elliptical (e > 0.8), very low periapsis orbits (pe < 800km) this is incorrect and the numerical solution shows it. - If you like I'll upload the python script used to make above graph.

Link to comment
Share on other sites

Well, those calculations are only valid if the orbital plane lies on the vector between Kerbol and Kerbin. Otherwise, you'd spend less time in the shadow down to nothing if it is normal to it.

My test have also been all 0 inclination.

Link to comment
Share on other sites

@mhoram: actually I'd like to see proof for that function. - I have tested it by running a "simulation" and calculating the time in eclipse at several (kind of many) points in the eclipse. Using the simple mathematics I've shown in the stackexchange posts:

http://i.imgur.com/231iCCA.png

This is done using kerbin gravitational constant & radius. And an semi major axis of 1E7, an eccentricity of 0.925.

As you can see the "maxima" are not coinciding with the sun in the apoapsis, rather the maxima are slightly before/after that point. Now the point in apoapsis is quite close and for nearly any other orbit it is correct: but for the highly elliptical (e > 0.8), very low periapsis orbits (pe < 800km) this is incorrect and the numerical solution shows it. - If you like I'll upload the python script used to make above graph.

Great info. Thanks for making me see what I did wrong.

This basically means that in the following picture on the orbit the duration for the path through the green area is shorter than the duration for the path through the red area. (Edit: see post below)

And since you asked, yes I would like to get my hands on the script you used.

r2xQ1Ze.png

Edited by mhoram
Link to comment
Share on other sites

Oh Jesus, this is compicated math.

I would have guessed that the worst case darkness time of an elliptical orbit would be in a situation where Sun, PE, Body and AP where aligned in that order (like in the green area) but now with seeing the picture, i'd like to correct my opionion on that, may i take a guess, just to verify i got that right:

- Ap is the where you move the slowest in your orbit.

- in the green area (all points of interest in one line), you do spend 50% of your darkness time losing speed (until Ap) and the other 50% gaining speed (after Ap)

So the worst case would be where the Ap is right at the end of your darkness time, because i keep losing speed during all my time in darkness? (Assuming a clockwise orbit in the picture above)

As im writing, i start to wonder what average speed/time i spend in those areas, because the speed where i enter the shadow is higher in the red area. So i have to consider which is slower/longer in total: getting slower from a higher speed until you reach your lowest velocity (red), or a decreasing and increasing velocity, but starting from a slower speed).

This, gentlemen is the point where my brain slowly starts melting, because the longer i think about it, the more factors i see that have to be considered.

Link to comment
Share on other sites

This basically means that in the following picture on the orbit the duration for the path through the green area is shorter than the duration for the path through the red area.

Not exactly. Kepler's second law counts from the planet (i.e. one of the focus of the ellipse), not from the center.

Link to comment
Share on other sites

Actually I made a major mistake, looking through the calculation I made the utterly stupid mistake of stating for mean anomaly vs eccentric: "M = E + e*sin(E)" instead of "M = E - e*sin(E)" - the longest time in shadow is when the sun is in the apoapsis, and the object in periapsis. You can find the code which is used to calculate it:

[URL="https://github.com/pulli23/KSP_helper"]In this github repository[/URL]. It requires (obviously) matplotlib and numpy/scipy. It works by simply running main.py.
I've extended it a bit so it now plots for several different eccentricities (all ignoring inclination though):

[IMG]http://i.imgur.com/IR2xABv.png[/IMG]
All orbits have a semimajor axis of 10000km, and the final one with an eccentricity of 0.94 has a periapsis that coincides with the surface of the earth. The time is the "time in eclipse"


Made me wonder though, for the eclipse calculations, what is used: the planet radius - or the radius + atmospheric height?
Link to comment
Share on other sites

  • 6 months later...

Hi guys I am facing a problem

when my spacecraft moves over to the dark side of the mun , i have LOS loss of signal 

i need a way to calculate :- (1) when my craft will enter the shadow region 

                                            (2) for how many time my craft will stay in the shadow region

                                            (3) when my craft will reappear form shadow region

if you want can give you my orbital parameters

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