Saturday, August 11, 2012

Pre-Requisites: Orbital Dynamics

There are two big areas that will be very, very helpful to know about in my engineering discussions here. Orbital Dynamics, and Space Propulsion Engineering (i.e. rocket science).

You don't have to know them perfectly, just at the bare minimum at least get a general idea of what's going on, here.

In fact, the numbers aren't even really all that important, just so long as you understand the concepts.

I'll post the Space Propulsion Engineering part later, for now, we'll cover Orbital Dynamics.

BIG IMPORTANT NOTE:
The math is not vital! You can go as math-heavy as you like. Some people will want it all to do their own sims and such, and others just want to know how these things work.

If you're one that just wants to get an idea of how things go, then feel free to not get bogged down in the math.

Because some of this math can get very, very boggy!


Orbital Dynamics


First, we need to get rid of that idea that there isn't gravity in space, 'cause there is.


Gravity


Gravitational acceleration, how fast gravity accelerates you, is given by the equation:
f = GM/r^2

Where f is in meters per second per second (or m/s^2, which means every second, it'll change your speed by that many meters per second), G is the gravitational constant, 6.67e-11 (e-11 is shorthand for *10^-11. Also note I'll use the asterisk (*) to denote multiplication.), M is the mass of both bodies (the planet, and the object being pulled) in kilograms, and r is the distance in-between the center of the two objects, in meters.

When it comes to spaceships and other small objects, though, we simply ignore their mass, simply because: the largest rocket to ever fly could loft 120 tons into orbit. That's not even a drop in the ocean, nevermind a drop in the bucket, compared to the mass of Earth, 5.97e21 tons. That's 5,970,000,000,000,000,000,000 tons! Which is 49,750 million thousand thousand thousand times greater than 120 tons. In other words, the mass of any spacecraft is far too small to make any discernible difference, maybe it might make a tiny difference if we need to work the math for orbiting an asteroid or some other tiny body, but for moons, planets, or anything large enough for it's gravity to make it round, we ignore the spacecraft's mass.

Anyways, that means the gravity from a celestial body goes like this, using the Earth as an example:


The inner circle on the above chart is Earth's surface, the outer circle is the maximum altitude the Space Shuttle can reach.
"A" is Earth's surface, where the gravity is ~9.82 m/s^2
"B" is the altitude at which the International Space Station (ISS) roughly orbits. (It varies from ~400 to 340 km)

Because the equation says GM/r^2, and "r" is squared, the line is a curve. If you go twice as far away from a planet, the gravity is only 1/4th as strong. If you go 3x as far away, 1/9th as strong, 4x, 1/16th, etc. etc.

So, technically, the gravity of the planet is NEVER zero. In fact, when calculating the trajectory of interplanetary probes, or even satellites, engineers take into account the gravity of the moon, sun and other planets for extreme precision. Their pull is extremely small, but it exists, even from here.



Anyways, because there's division by a squared number (GM/r^2, GM divide by r^2), this is part of the "inverse-square law".

This is vital. This means it's possible to escape from a planet's gravity. How so?

Well, gravity gets weaker as you go farther away, but never ends. If it weren't a square, but GM/r instead, then no matter how fast you go, the planet's gravity would pull you back, because, as I said, you can never truly ESCAPE a planet's gravity, you'll always feel it, and over eternity, it would eventually pull you back no matter how fast you go.

But, that isn't the case. It's GM/r^2, not GM/r. Because of this, there's a certain "escape velocity". Gravity will pull on you forever, but it will get weaker and weaker so quickly that it will never stop you.

If you're going above escape velocity, than the speed that gravity pulls back on you, would never cancel out the speed you're flying away with, despite pulling on you for eternity.

It seems baffling that something can pull on you forever, yet never stop you. It seems that after an infinite amount of some finite amount of pull, it'd add up to infinity. But because of the inverse-square law, it doesn't.

This is why:
Imagine a square. Cut if it in half. Do it again. Do it an infinite number of times, and you'll get an infinite number of pieces, yet when you add the area of all those pieces together, you'll get the area of the entire square, not infinity.

All those pieces are like the amount of pull you feel from gravity each second. Gravity will pull on you an infinite number of times, yet when you add all it's pull together, you get a finite amount. This is the escape velocity.

The Maths


Because gravity is stronger near a planet, you have more gravity to overcome when you're closer. So the escape velocity depends on your distance from a planet, and the size of the planet according to this equation:

Vescape = Sqrt(2GM/r)




So now you know a few things about gravity.


The Circular Orbit


Okay, imagine I have a ball and a plate. I set the plate down, and drop the ball on the plate, and it falls straight down and hits the plate.

Now, let's try again, this time, I throw the ball sideways a little. It misses the plate.

Now, let's say that the entire planet Earth is the "plate".



Given enough speed, I could miss the entire planet.

But, because gravity doesn't always go to the bottom of the picture, but gravity pulls to the center of the Earth, then if I got the speed right, then this will happen:



Gravity has pulled it "down" (towards the bottom of the picture), and it's fallen so far, it's now going just as fast "down", as fast as I had thrown it sideways in the first picture, so once again, it'll miss the Earth.

And once it misses the Earth again, the same thing will happen again, and again, and again.

Something very important to note about orbital dynamics, though, is that it will always wind up in the same place I threw it from, in the first picture. As long as it doesn't hit the ground, or change it's speed, it will always circle around back to frame 1.

This is a circular orbit.

It will fall towards the planet forever, and always miss.

An object that's in orbit, is in a perpetual state of free-fall. That's why astronauts are weightless in orbit, not because of a lack of gravity, but because they're free-falling. The same is true for when they fly from planet to planet, to the moon, orbit the moon, or whatever they do in space. There's no ground underneath their feet unless they're landed, so unless the engine is pushing on them, then they're in free-fall.

(Also note, because an orbit is a free-fall, you don't have to fire the engines the whole time. Bothers the heck outta me when spaceships fall out of orbit in movies...)

When you're sitting on the ground, you feel gravity because you're trying to fall towards Earth's center, but the ground is in the way. The ground doesn't fall because, well, more ground is in the way, lol. So gravity pushes you into the ground, and you feel it because the ground ain't movin'.

But in spaceflight, you, and the entire spacecraft, are free-falling together, and you and your spaceship ARE moving. So it doesn't matter if you're going from one planet to another, doing a fly-by of a planet, or whatever, as long as those engines aren't pushing on the spacecraft, then you'll be weightless just the same.

Well, at least until you hit the ground XP


And I keep mentioning the engine as an exception: Ever have someone stand up in a bus, or a car, and when the vehicle accelerates forward they're thrown back? It's the same as feeling acceleration when you pump the gas and you're driving.

The engine drives the vehicle forward, and the vehicle, in turn, pushes you forward.

When the engines are firing in a spaceship, the effect is exactly the same, and it feels exactly the same as gravity. The engines push the spaceship, and the spaceship, in turn, pushes on you.

If you stand in a bus, you only have to lean forward, because Earth's gravity is much stronger than the bus' acceleration, so you're still mostly feeling that pull of Earth's gravity.

But if you don't feel Earth's gravity because you're freefalling, and the engines fire up, then you won't be just leaning forward, you'll just go straight towards the wall. Or rather, the ship's engines will push the spaceship, and thus the wall, into you, haha.

And as that wall pushes into you, it will feel just exactly the same as gravity would (so you had might as well call it the floor until the engines shut off).


Once again, though, as I said, don't forget that an orbit is a free-fall. The engines should be off, unless you want to go a little faster, and "miss" the planet by more, or slow yourself down, and "miss" the planet by less, to get closer to the ground...

The Maths


Back to my ball-and-planet analogy, the speed I must throw the ball at to do this depends on a few things. The mass of the planet, and my distance from it.

The sideways speed to go for any circular orbit is given by:

v = Sqrt(GM/r)

All the variables are the same as for the earlier equation.

Btw, for a Low Earth Orbit, this speed is about 7,800 m/s, which is, somewhere about:
Mach 27
5 miles per second
17,500 mph

The time it takes to complete an orbit, in seconds, is

T = 2pi * Sqrt(r^3/(GM))

For a Low Earth Orbit (LEO), this is about 90 minutes. In other words, anything in LEO, circles the Earth every hour and a half.


Elliptical Orbits


Okay, now let's throw the ball a lot faster!

Not escape velocity, but much faster than mach 27!

(This time, we'll throw it "up", from the "left" of the Earth)

This happens:

(Minor illustration error note: When going perfectly sideways (i.e, perfectly horizontal with the ground beneath us, our starting point in this example), we're going a lot faster than a circular orbit, so we'll shoot off away from the planet. As such, the closest point to the planet will be our starting point in this picture. The illustration is slightly off in that respect)

The green arrows represent the pull of Earth's gravity.

Remember, we're not going fast enough to break free, so gravity wins, and will pull us back down.

Frame2:

Remember how I said above, that no matter what, we'll end up back at frame 1?

Here we go:


If I illustrated this perfectly (which I didn't), then it would look like this:


This orbit is an ellipse.

There's a few terms that are important to know, though:

Periapsis: The closest point to the planet, moon, sun, whatever's being orbited. It's on the left side of this picture. As I illustrated, you're going fastest at this point, faster than circular orbit speed. That's faster than mach 27! So as you get near the ground, and are going very fast, think "peri-haps I should reconsider this..."

Apoapsis: The furthest point. You're going very slow at this point, it's the slowest point in any orbit. It's going to be quiet awhile before you come back, so hopefully you packed lunch... Apples for Apoapsis. Apples to Applapsis?

Whatever, I hope those awful puns help you remember, haha.

Semi-Major Axis: It's the average of Periapsis and Appleapsis Apoapsis. This is a very important number for calculating just about anything really useful in an orbit. For a circular orbit, it's the radius.

Here's also something important to remember:  If I throw the ball too slow to make a circular orbit, then it's in an elliptical orbit, and the starting point is the apoapsis, so it'll start at "Frame2", illustrated above.

And yes, this technically still applies even if the ball is going so slow, that orbit's path, aka trajectory, takes the ball straight into the ground. That's a sub-orbital trajectory.

And, as you saw, if I throw it too fast, it makes an elliptical orbit, too.



The Maths


Because your speed changes through an elliptical orbit, the equation is a lot more complicated.

To find the object's speed, you need to know it's radius (distance from center of the object it's orbiting), semi-major axis (always abbreviated "a"), and of course, the mass of the planet.

This is called the Vis-Viva Equation.

v^2 = GM((2/r) - (1/a))
so
v = Sqrt(GM((2/r) - (1/a)))

More equations here. If you're interested in building your own simulations, then some digging around will find you the flight-path angle.


Hyperbolic Orbits


It's a bit confusing, but technically, a fly-by is considered an orbit, even if you don't actually get caught in an orbit, but just fly by a body.

This happens when you exceed escape velocity.

Your path isn't an ellipse or a circle in this case, of course, but instead a Hyperbola.

Which simply means you'll fly in, abruptly get turned by gravity, then fly off.

The slower you go, the more time you spend being pulled on by the planet's gravity, so the more it will bend your trajectory.

Also, the closer you get to the planet, the more it will bend your trajectory, because gravity is stronger closer to the planet.

The absolute minimum speed possible to do a flyby at is escape velocity. If your speed is exactly escape velocity, then your path is a parabola.

Any slower than that, and you slow down into an elliptical orbit.

The Maths


The only math I have for you here is:
Vp^2 = Ve^2 + Vh^2

Where Vp is your speed at your closest point to the planet, Ve is the escape velocity at that closest point, and Vh is your "hyperbolic velocity".

Remember how I said at the beginning, in the "gravity" section, that it will pull on you forever and add up to that amount? 

Your Hyperbolic velocity is the speed you'd be going after gravity got done pulling on you forever. So you'll never slow down to Hyperbolic Velocity, but you'll get very close, very quickly, and keep slowing down to it forever, but never quiet reach it.


Atmosphere: You're Such a Drag!


Earth has a significant atmosphere (no duh). One thing about an atmosphere, is it doesn't just abruptly cut off. It gets thinner and thinner, but there's never zero drag.

When going orbital velocity, there may be so little air the sky is pitch black, and it's effectively a vacuum, but it's still enough air to cause a noticeable amount of drag at orbital velocity. And drag, of course, slows you down, so you'll fall out of orbit.

At ~70 km, there's enough air to cause a fiery re-entry. Technically, it's a big orange ball of plasma, but you get the idea. LOTS of drag.

The Space Shuttle's main engines cut off at an altitude of 109 km. The shuttle goes on to increase it's speed. 100 km is tolerable only for an extremely short amount of time. Spend a few hours at that altitude, and you'll de-orbit.

150 km is around the lowest the Shuttle's ever passed during it's on-orbit missions, other than landing and launch, of course.

The International Space Station sits in-between 340 - 400 km. At 400 km, it needs a boost every few months.

At 1,000 km, you can start forgetting about microdrag (which is what it's called in space).

This graph shows it's altitude over the years.

Application


So what does all this mean?

Let's start with the first spaceflights and work our way up:

The first rockets couldn't reach orbital speed, but they could still go pretty darn fast.

Under rocket power, they'd climb against gravity, and shoot up, then pitch sideways into a sub-orbital trajectory that would take the payload into space, before coming back down under Earth's gravity.

Then, came rockets that could put satellites up.

Remember how the orbit changed when I threw the ball at different speeds?

The orbit a vehicle is in depends on it's speed. So to change your orbit, you fire your engines to change your speed. Slowing down, firing "retrograde", or facing tail-first so you're looking backwards from the direction you're flying in (very easy to do in a vacuum) and firing your engines, will slow you down, so you don't "miss" the planet as much, and your orbit lowers. It will become elliptical, where your current point is the highest point.

Firing the engine "prograde", so you're facing forward like an airplane, will speed you up, so you'll "miss" the planet by more, and go to a higher orbit. Once again, elliptical, but this time, where your current point is the lowest point.

Here's something counter-intuitive to note, though: as you go higher, you slow down (just like someone on a swing, too), so that means, if you fire your engines from a circular orbit, then you'll go into an elliptical orbit. As you climb, though, you'll go slower. So ironically, firing your engines to speed up, will, over the course of your orbit, slow you down, as well as increasing your altitude. Then, over time, you'll fall back down again and return to your original faster speed to repeat the cycle.

Same applies in reverse: firing your engine in retrofire, will lower your orbit, and as you fall, you'll speed up.

Back to some application, though. Let's present some missions.

Let's say a rocket has just placed our spacecraft into a circular orbit at a mere 150 km altitude. The most efficient way to climb to 300 km altitude is to do two engine burns:

The first changes our speed (let's cover this: the mathematical term for "change" is "delta". Velocity is almost always represented with "v". So when we fire the engines, or ever change our speed, that's "delta-vee"), speeds us up into an elliptical orbit, where the apoapsis is at 300 km altitude, and our periapsis is at 150 km altitude.

(I'm mentioning altitude - but when working the math, don't forget that "r" and "a" are altitude + radius of Earth)

Once in that transfer orbit, you wait until you're at apoapsis, at 300 km altitude, then fire the engine again to speed up to circular orbital velocity. This will raise the periapsis to 300 km altitude, and the orbit will become circular.

What we just did is called a  Hohmann Transfer Orbit. It is the most energy-efficient way to gain the most altitude using the least delta-vee.

However, it is also the slowest. Doing a Hohmann Transfer Orbit (HTO) to Mars, for example, takes about 8 1/2 months. But there is a way to speed this up.

You can speed up into a huge elliptical orbit. Of course you'll be going a lot faster, so you'll make the trip a lot quicker.

Your apoapsis will be much higher than you want to go, so when you reach the altitude you want, you've got to get rid of your upwards (away from the planet) velocity, so you stop climbing, and at the same time, increase velocity horizontally to reach circular orbital velocity.

Overall, it requires a lot more delta-vee, but saves time, and may be necessary to catch up with something in that orbit, like a space station you're trying to dock to.

The Maths

The equations for an HTO are quiet complicated...

Only dare to tread forward if you're brave and eager to run your own calculations!
(Otherwise, skip ahead)

The delta-vee needed to break the first circular orbit and make the HTO are:

dv(1) = Sqrt(u/r1) * (Sqrt((2*r2)/(r1 + r2)) - 1)

Where u is G*M (as defined earlier)
r1 is the radius of the smaller orbit
r2 is the radius of the larger orbit.

And the second burn, to accelerate to circular orbit velocity once at apoapsis, is:

dv(2) = Sqrt(u/r2) * (1 - Sqrt((2*r1)/(r1+r2))).

Keep in mind, this actually works both ways. If you're in a lower orbit, and want to go to a higher orbit, then this'll work like
In lower orbit, do dv(1), in elliptical, do dv(2), in higher orbit.

Or,

In higher orbit, do dv(2), in elliptical, do dv(1), in lower orbit.

And the time it takes to do an HTO is given by (in seconds)

T = Pi * Sqrt((r1+r2)^3/(8*u))

Now, that other transfer orbit. This is a bit more complex. First, the dv(1) equation is the same, except r2 will be replaced with your apoapsis radius.

Utilize the vis-viva equation to find your velocity at the radius you want your higher orbit to be.

v = Sqrt( u * ((2/r) - (1/a)))

Now, finding the delta-vee to get into that higher orbit is a lot more complex.

Now, find the flight angle:

o = acos( Sqrt( Pe * Ap ) * Sqrt( u / a ) * r * v)

Pe is the radius (distance from body's center) to your periapsis
Ap is the radius of the apoapsis
a is the semi-major axis (average of Pe and Ap)
r is the current radius
u is G*M
v is velocity
acos() is the arccosine, the function that undoes a cosine.

And finally, o, is the flightpath angle. This is the angle in-between the local horizon (draw a straight line from you to the body's center. The "local horizon" is level with the ground down there) and the angle you're flying at. In a circular orbit, or in a elliptical orbit only at apoapsis and at periapsis, your flightpath angle is zero.

Split your velocity into components:
v * sin(o) = dh
and
v * cos(o) = Vh

Where dh is your vertical speed (delta-height), and Vh is your horizontal speed (don't confuse this with "Hyperbolic Velocity" from earlier).

To go into a circular orbit, you have to get rid of dh, and make your Vh equal to orbital velocity at that height:

Vorb = Sqrt(GM/r)

So your delta-vee (to go into a circular orbit from here) is:

dv(2) = Sqrt(dh^2 + (Vorb - Vh)^2)

To compress it all into one equation:

dv(2) = Sqrt( (Sqrt( u * ((2/r) - (1/a))) * sin(acos( Sqrt( Pe * Ap ) * Sqrt( u / a ) * r * (Sqrt( u * ((2/r) - (1/a)))))^2 + (Sqrt(GM/r) - ( Sqrt( u * ((2/r) - (1/a))) * cos( acos( Sqrt( Pe * Ap ) * Sqrt( u / a ) * r *  Sqrt( u * ((2/r) - (1/a)))))^2)

The only thing I can guarantee about the equation above, is that I've missplaced something in there, at least a parenthesis, hahaha.

/

And from here, we're ready to move on to Space Propulsion Engineering.


///

Well, that about sums it up for Orbital Dynamics. Next post: Space Propulsion Engineering.
I'll see you then!

No comments:

Post a Comment