1 G U I D E T O A P P L I E D O R B I T A L M E C H A N I C S F O R K E R B A L S P A C E P R O G R A M CONTENTS Foreword... 2 Forces... 3 Circular Orbits... 8 Energy Angular Momentum... 13
2 FOREWORD Many online sources that deal with orbital mechanics concepts go far beyond what is needed for doing calculations relevant to KSP. Wikipedia articles tend to get bogged down in pages upon pages of math, making it difficult to find exactly which equations you need to solve a given problem. This guide is focused on solving problems. Key equations from orbital mechanics are presented here as building blocks, which we ll put to practical use. If you re looking for derivations from basic physics, you ll probably be a little bit disappointed, in which case I d direct you to just about any book on classical mechanics, or a book on orbital mechanics. This guide should take you to the point where the physics are no longer an obstacle to writing tools for KSP or for carrying out orbital calculations. We ll work our way up from basic motion under acceleration to calculating phase angles for interplanetary transfers, landings, and calculating trajectories in a planet s atmosphere. This guide is aimed at those with at minimum a basic knowledge of geometry and physics. If you re familiar with the sine and cosine functions, and have a grasp of newton s laws (F=ma), you should be fine.
3 FORCES Gravity Close to the surface of a planet, the acceleration due to gravity is approximately constant, giving the familiar relation: Where F is the force of gravity and m is the mass of the object on which gravity acts. The acceleration due to gravity is: Which is a constant for each planet. Q) What s the force of gravity on a 2kg object on the surface of Kerbin? A) From the wiki: So: Far from the surface of a planet, the force of gravity gets much weaker, and we need to use Newton s law of gravitation: Where G is a constant, m is the mass of our ship, M is the mass of the planet, and r is the distance from our ship to the center of the planet. Because G and M are both constants for a given planet, we combine them into a single constant µ, called the gravitational parameter. Q) You re in a 2kg ship in orbit around Kerbin, and the altimeter reads 100,000m. What s the force of gravity on the ship? A) Since the altimeter reads your altitude from sea level, and not from the center of the planet, we can t plug 100,000m into r. First, we need to add the radius of the planet, which for Kerbin is: Also, from the wiki:.
4 So: This is smaller than the force of gravity at the surface, as expected. Drag and Terminal Velocity This is really well presented on the wiki. Take a look at: Thrust Imagine an astronaut in deep space, holding a bowling ball. If the astronaut throws the bowling ball in some direction, due to conservation of momentum, the astronaut will begin to travel in the opposite direction. The force that causes the astronaut to recoil is called thrust. If the astronaut throws the bowling ball harder, we expect the recoil to be greater. In a rocket engine, rather than launching bowling balls, we expel exhaust gasses at high velocities. As a result, the relevant quantities are the rate at which we re expelling exhaust, as well as the velocity at which it is expelled. Mathematically, thrust is expressed as follows: Where T is the thrust, dm/dt is the rate at which the exhaust is leaving the rocket (i.e. the flow rate of fuel in kg/s) and v exhaust is the velocity at which the exhaust leaves the vehicle. You might ask what dm/dt would be for the bowling ball, and hence might sense something fishy about all this. After all, how could there be a flow rate for a bowling ball anyway? The answer to this is that the equation for thrust above assumes that we are continuously expelling fuel. If we re throwing a bowling ball, it s best to use straightforward conservation of momentum to solve the problem instead. Q) A ship is stationary above Kerbin at an altitude of 100,000m (above sea level). The ship weighs 10 tons (10,000kg). The ship s single rocket engine has an exhaust gas velocity of 2000m/s. What rate of fuel flow is necessary to keep the ship stationary at that altitude (i.e. to balance the force of gravity)? A) The force of gravity is given by:
5 The ship s thrust is given by: These must be equal for the ship to remain stationary (i.e. net force = 0): Simplifying: Plugging in: Thus, the ship must expel 36kg of fuel every second in order to remain stationary at 100,000m altitude. Ideal Rocket Equation We have seen that the force of thrust is given by: This is more commonly written using a parameter known as the specific impulse in place of the exhaust velocity: Where I sp is the specific impulse, and g is the acceleration due to gravity at the Earth s (Kerbin s) surface, or 9.81m/s 2. Using F=ma, we can find the acceleration of a ship under thrust:
6 ( ) This tells us that the acceleration depends both on the mass of the ship and the rate at which the mass is changing (i.e. fuel is being expelled). As a result, finding the change in the velocity of the ship after a burn (where some of the mass has been used up) is a bit more involved than what we ve seen so far. The solution to this problem involves calculus (and isn t too difficult once you ve learned it). Rather than go through the derivation, here s the final answer: Where m initial is the mass of the ship before the burn, m final is the mass of the ship afterwards, and Δv is the change in the ship s velocity. Ln(x) is the natural logarithm, which is the power to which you must raise the number e = in order to get x as the answer. Q) You re piloting a 10 ton ship, and need to perform a maneuver that requires a change in velocity (Δv) of 500m/s. Your engine has an I sp of 390s. How much fuel will you burn? A) We have: Exponentiate both sides of the equation (you ll see why in a second, if you don t already): ( ) Simplify the right side of this equation by factoring out gi sp in the exponent: ( ( ) ) Remember, ln(x) is the power to which we must raise e in order to get x. So if we raise e to the power of ln(x), we must get x again, by definition! In our case, x is just m final / m initial, so we have: ( ) Simplifying (by taking the gi sp th root of both sides), we get: We re looking for the total amount of fuel burned, which is found by finding the total change in mass m final m initial:
7 Simplifying by factoring out m initial: This is a very useful result! Plugging in our numbers: Thus, we will burn 1225kg of fuel to make this maneuver (if we don t have at least that much fuel, the maneuver cannot be made.)
8 Circular Orbits An object travelling along a circular path does so because there s some force that s constantly pulling it towards the center of the circle. For example, if I spin around while holding a string attached to a ball, the ball is kept in a circular path by being pulled on by the string (which I myself pull). If there were no such force, the ball would travel in a straight line instead. Fundamentally, there s not much different happening in a circular orbit around a planet. Instead of being held in a circular orbit by the pull of a string, a ship is held in an orbit by the pull of a planet s gravity. A basic result in physics gives the following relationship for an object moving in a circle due to a centripedal force (a force directed towards the center of the circle): You might already have guessed what we ll do next! Substitute the equation for the force of gravity that we considered earlier: Simplifying, we get: This extremely useful relationship lets us find our orbital velocity in a circular orbit at any altitude around any planet. Q) A pilot takes off from Kerbin and reaches an apoapsis (maximum altitude) of 200km. When he reaches apoapsis, his velocity is 1200m/s. What change in velocity ( ) is required to circularize his orbit at this moment? A) Using our equation for : It s easy to find how long an circular orbit takes to complete. Since we move at a constant speed, all we need to do is divide the total length L of our orbit (i.e. the circumference of a circle of radius r) by our velocity :
9 Substituting and simplifying: Q) How long does a circular orbit 100km above Kerbin take to complete? A) Using the above equation:
10 ENERGY Energy concepts are useful because they often let us get past the nitty-gritty details of the math and quickly get to useful results. Orbital Energy A ship in orbit has a kinetic energy given by the following expression: Where m is the mass of the ship and v is the ship s velocity. The potential energy of a ship in orbit depends on its mass and its distance to the planet, and is given by: Why is this potential negative? It s a matter of convention (and an intuitive one, if you think about it in the right sense.) Simply put, we say that an object an infinite distance away has a potential energy of zero. We can immediately see that this is the case if r is very large, E p is very small. The total energy is just the sum of the kinetic and potential energies: Usually, when talking about orbits, we talk about the energy per unit mass, which we call ϵ: In the absence of forces other than gravity, ϵ is a constant, no matter where you are on your orbit! This is one of the most useful formulas for doing calculations relevant to KSP. Here s why: 1) If ϵ < 0, then we are in a circular or parabolic orbit, and will never escape the body we re orbiting. 2) If ϵ = 0, then we are in a parabolic orbit, and will (just barely) escape the influence of whatever body we re orbiting. 3) If ϵ > 0, then we re in a hyperbolic orbit, and we ll escape whatever body we re orbiting. Thus, we see immediately that we can use this formula to tell if we ll escape a body or not. As well, we can use this formula to find the escape velocity at a given altitude (i.e., the velocity that makes ϵ = 0).
11 Q) A ship is travelling at 3000m/s at an altitude of 100,000m above Kerbin. Is it captured into an orbit, or will it escape? What is escape velocity at this altitude? A) Using the specific orbital energy equation: Plugging in: Since ϵ < 0, we expect to be in a closed orbit, i.e. we won t escape Kerbin. Escape velocity occurs when ϵ = 0, giving: Plugging in: Thus we need an additional 176.5m/s to escape Kerbin. If we know more about our ship, we could use the ideal rocket equation to determine from here exactly how much fuel we d need to burn to escape! Remember when I said that ϵ was a constant? This is very useful, as it lets us find our velocity at any point along our orbit if we know our altitude. Q) You re at an altitude of 100,000m and travelling at a velocity of 2600m/s. What will your velocity be at an altitude of 1,000,000m? A) First we ll calculate ϵ for the first case, then use the fact that ϵ is constant to solve for the second case.
13 ANGULAR MOMENTUM Like the specific orbital energy ϵ, the angular momentum L is another quantity which is constant everywhere along an orbit (and hence very useful)! From high school physics, you re likely familiar with linear momentum, which is equal to mv, or mass times velocity. This quantity is a constant of a given system, as stated by the law of conservation of momentum. Angular momentum is another quantity, like linear momentum, which is conserved in a system. However, it s related to rotational motion rather than linear motion. A spaceship, relative to a planet, is well approximated as a single point, i.e. its size is so small in comparison to the planet that we don t need to take it into account. Thus, we can use the following equation for its angular momentum: Where r is a vector pointing from the center of the planet to the ship, and v is the velocity vector of the ship. The used in the above equation is the vector cross-product. For our purposes, we can put most of the vector math aside and deal only with the magnitude of the angular momentum: Where and are the distance from the center of the planet and the magnitude of the velocity, respectively, and is the angle between the direction of the ship s velocity and a line from the center of the planet to our ship (see the figure below). Just as in the case of orbital energy, we can divide by the ship s mass to get the specific angular momentum of the ship, denoted h. The quantity h is a constant for a given orbit. You might be thinking why bother with h, as we already have an energy formula that relates r and v! The key here is the dependence of h on, which includes information about direction the energy equations had no notion of direction. Using h, we can figure out not only how fast our ship is going, but also where it s going! Q) A ship is in a parabolic orbit above Kerbin, with a periapsis of 100,000m. After periapsis, once it has risen to an altitude of 200,000m, what will be its vertical (radial) velocity (i.e. the rate of change of altitude)? A) Since the ship is on a parabolic trajectory, we automatically know that ϵ=0. Let s use this fact to find the magnitude of the velocity at periapsis and at 200,000m:
14 This gives: At periapsis, we have: ( ) At 200,000m, we have: ( ) Now, let s consider h. At periapsis, since the velocity is perpendicular to r,, and. (Can you see why they are perpendicular?) Of course, h is constant, so h at 200,000m = h at periapsis: (at 200,000m altitude) Plugging in our numbers: Now, with a bit of geometry, we can find the vertical (radial) velocity.
15 v θ r v pe v v θ r pe v θ r From the diagram, we see that the horizontal (tangential) component of the velocity is simply: And the vertical (radial) velocity is simply: Thus, the ship is ascending at 1065m/s while travelling with a tangential velocity of 2774m/s. I hope you can see how h can be put to good use in determining the direction of orbital motion at a given altitude.