Tutorial:Whats with all the math?

From Kerbal Space Program Wiki
Revision as of 14:51, 1 August 2014 by Wild Bill (talk | contribs) (Linkifying)
Jump to: navigation, search
This page needs more links to other articles to help integrate it into the Kerbal Space Program Wiki

KSP math explained for the rest of us

I started playing KSP a few months ago. I tried to understand what everybody was talking about when they mentioned TWR, ISP, Δv, apoapsis, eccentricity, and a whole bunch of other terms from math and physics. The learning curve is high, but this tutorial will try to explain what all these different numbers mean and why they are important for people who do not have a mathematical background.

A few words about physics

Many parts of orbital mechanics can be counter-intuitive for people. Most of us have not been to space, so our intuition about how things should work is based on how we experience them. Historically, this was actually a major sticking point in physics because we had to think in ways that were different from our intuition to really understand how planets moved. Here we will explain a few basic physics concepts, although interested readers are encouraged to research the work of Isaac Newton and the development of these ideas. It should be noted that these explanations are not entirely rigorous, and simply meant to give people an intuitive understanding of how things work.

Velocity, Speed, Friction, and Acceleration

Say you are driving down the street at 70 miles per hour (about 113 kilometers per hour). If you were to turn put your car's engine in neutral, your car would slow to a stop. Our intuition says that if we want to keep moving the same speed, we need to keep pushing the gas pedal, or we will slow down. The reason we think this is that all our experiences involve friction. In the car example, there is air friction on the surface of the car and friction from the wheels on the ground. Friction can be thought of as pushing us backwards, while the gas pedal pushes us forwards. If we stop the engine, friction continues to push us backwards, which is why we stop. In space, there is no friction. Therefore, there is nothing pushing us backwards. Imagine you are in space, and there are no planets or stars or anything but you. If you are moving, you will keep moving in a straight line forever. This comes from one of Newton's laws of motion, that an object in motion stays in motion and an object at rest stays at rest unless acted upon by a force. On earth, friction is a force that pushes us backwards, and the gas pedal applies a force that pushes us forwards. A force is basically just a 'push.' When we say velocity, we mean the speed you are moving in, and the direction you are moving in. Therefore, if your speed stays the same but you are turning, then your velocity is changing. Think about making a 90-degree turn in a car, you have to push the gas pedal down during the turn. Acceleration is nothing more than a change in velocity. Therefore in physics, when we say that something is accelerating, either it's speed is changing, the direction it is moving is changing, or both. Note for the interested readers: There is an important mathematical relationship between position, velocity, and acceleration. In fact, the exploration of this relationship by Isaac Newton and Gottfried Leibniz lead to the invention of what we math people now call Calculus.

Orbital Mechanics

→ See also: Orbit

Since we are trying to play Kerbal Space Program, we will spend a significant amount of time dealing with orbit. To help us think about being in orbit, we will first describe a 'thought experiment', although I would encourage anybody to go outside and give this a try. Imagine you tie a baseball to one end of a string. Now imagine you hold the other end of the string and spin around in a circle very quickly. The ball will 'orbit' around you. When your spacecraft orbits a planet or moon in KSP, the gravity pulls you in like the string keeps the ball near you. If you are in a circular orbit, your speed will not change (note that since you are always turning, you are actually always accelerating). The planet is pulling you straight down, but you are already moving fast enough away from the planet that you move in a circle. You are actually in free-fall, but you are moving so fast that you miss the planet every time. Readers are encouraged to convince themselves of this, it is easier to see in a highly eccentric orbit than in a circular orbit, more on that later. In KSP, as long as you are in a well behaved orbit (not on an escape trajectory, not going to crash into the surface, completely above the atmosphere), your orbit will never change. You will keep moving in the same path forever. In the real world, it's not quite that simple, but that is outside the scope of this explanation.

Orbital Velocity

Simple orbit diagram.svg

Given a fixed, stable orbit, your velocity (the speed you are moving and direction you are moving in) depends only on your position in that orbit. Understanding this is incredibly important, so here is some explanation. In the image to the right, look at any point on the bigger shape (the ellipse). If you don't burn your engines, your speed when you are at that point will be the same as when you return to that point after one orbital period (the amount of time your orbit takes to complete one full revolution).

Eccentricity

Eccentricity is a number to describe the 'shape' of our orbit. The closer our eccentricity is to 0, the more circular our orbit is. Elliptical orbits have eccentricity somewhere between 0 and 1. In the image to the right, the smaller, circular orbit would have an eccentricity of 0, and the larger orbit would have eccentricity around 1/2 (very rough number). Eccentricity of 1 or greater is what we call a parabolic or hyperbolic orbit. All that means is that you will not stay in orbit, you will escape the planet's sphere of influence and never come back without accelerating back towards it somehow.

Maneuvers

→ See also: Basic maneuvers

Say we are at point A in the figure to the right, and we point the nose of our rocket in the direction of the arrow (prograde, the direction we are moving) and burn our engines for a while. In reality, this burn takes a certain amount of time, and our position changes during that time. However, that is some much more complicated math, so we are going to pretend that the burn starts and ends instantly. Basically, we pretend that we accelerate by a certain amount at point A. Since we are still at point A, when we complete one orbital period, we will be back at point A. However, the opposite side of our orbit will move away from us, making our orbit more eccentric in this case. The important take-away here is that we accelerate at point A to change our velocity. This changes the shape of our orbit. Say our original velocity was 10,000m/s (10 kilometers per second), and our new speed is 10,200 m/s. Our velocity changed by 200m/s, and this is our Δv!

What does all this mean?

Okay, by now if you are still reading, you are probably starting to think "How does all this stuff help me go to space!?" Well, we are going to start talking about that right now!

Why is Δv so important?

At this point, we have a rough idea of what Δv is, and Δv is probably the most important thing to understand. Note that above, when we talked about how fast our rocket was moving, or how it's orbit changed, we said nothing about the mass of the rocket. We don't know if we are talking about a tiny satellite, a spaceplane, or a huge rocket, but we know that how our orbit changes is only dependent on how our velocity changes! This is why we talk about Δv so much, because no matter what rocket you build, it takes the same amount of Δv to go from point A to point B in space. Furthermore, we know it takes about 4600 Δv to get into orbit around Kerbin, so if we know the Δv our ascent stage generates, we know if it will get us to space!

Determining Δv

Since this is an article for people without mathematical backgrounds, we are not going to look at the formula for calculating Δv. There are great tutorials explaining the equations for all of this, and readers are encouraged to consult them for a more rigorous understanding. However, most people see big, complicated equations and they stop reading, whether it comes from some post-traumatic stress left over from school, or being generally uninterested in mathematics, and that is okay. Here, we are going to simply look at what Δv depends on, that is, what effect does building a rocket in one way or another impact Δv?

There are mods that will tell you what your stage's Δv is, and I personally use one of them, but since this article is about vanilla KSP we will leave them out of this discussion. There are also mods that will do your entire take-off, gravity turn, and all your orbital maneuvers for you. While these can be fun, I personally do not believe in using them outside of sandbox mode for experimental purposes, since the point of playing the game is learning for me.

Thrust and Thrust-to-Weight Ratio(TWR)

→ See also: TWR

Thrust is the amount of force (how much 'push') your engine is generating. Remember the example of the car going down the road where the engine pushes the car forward and friction pushes the car backwards? The same thing happens with rockets. Thrust is basically how hard the rocket is being pushed up from the surface of Kerbin.

We all know that heavy things are harder to pick up than lighter things. If you don't believe me, go lift a piece of paper off the ground over your head, and then do the same with a piece of furniture, like a couch. The couch is much harder to pick up. The same thing is true in rocket science, heavier rockets are harder to pick up (lift off) than lighter rockets! This is why TWR is so important, the rocket's engines are pushing the rocket up, and gravity is pushing the rocket back down. If you have ever arm-wrestled, you know that the person who pushes harder is going to win. The rocket's weight is how hard gravity is pushing down. Therefore, the rocket's thrust must push harder than gravity, or you are not going to space. A TWR less than one means that gravity is going to win. A TWR over one means the rocket is going to win, and a TWR of exactly one means the rocket will not hover in place. However, once you are in a stable obit, you no longer need a TWR over one to change your velocity.

Side-note for interested and advanced readers

TWR changes during the flight of a rocket. As you burn more fuel, you lose mass, and your TWR increases since your weight decreases. TWR also depends on what planet/moon you are on since each celestial body has different gravity. Therefore, the same rocket with the same amount of fuel as a lower TWR on Eve than it does on Kerbin.

So, what engine should my rocket use, and what is engine ISP?

→ See also: Specific impulse

Let's start with engine ISP. Basically, it tells you how fuel-efficient your engine is. An engine with a higher ISP will give you more Δv for the same amount of fuel as an engine with lower ISP. However, you also need to look at how much thrust they generate, and determine if you need a lot of Δv in a small amount of time, or less Δv all at once.

Example

The LV-909_Liquid_Fuel_Engine engine has ISP of 300 in atmosphere or 390 in space. The Rockomax "Mainsail" Liquid Engine has ISP of 320 in atmosphere or 360 in space. This doesn't seem like much of a difference. However, the mainsail can generate a thrust of 1500, while the LV-909 can only generate a thrust of 50. Therefore, the LV-909 will accelerate your rocket more slowly. Sometimes, you need to generate a lot of thrust very quickly (like when you are trying to go from the ground to orbit), so an engine with lower ISP but higher thrust may be better

What about SRB's?

→ See also: SRB

My first ship to successfully orbit Minmus had around 50 SRB's on it. I do not recommend this approach. First off, as of .24, we have to pay for parts, so efficiency is important. Second, it was very difficult to get enough struts on the ship to get it to stay in one piece. Third, it was very difficult to steer, so my gravity turn was very inefficient. I only mention this because a common part of the learning curve for new players is to add more SRB's and more struts when we have trouble reaching orbit.

SRB's add a good amount of thrust, but also add weight. Therefore, the more you add, the less of a benefit you are getting. Also, since they only have one setting, which is to burn until empty, they are best used for ascent stages only, since we need more control when we are in space. Therefore, my recommendation is that if you are having trouble getting into orbit, putting a few SRB's on the side of your rocket as a first stage may help. As you unlock more parts in career mode, and get a better feel for getting into orbit, you may or may not continue to use them.

Final Notes

Hopefully this tutorial has given you a decent primer on what all the math really means. I highly recommend experimenting with different rocket designs, reading more rigorous mathematical explanations, and continuing to learn, since this is just a baseline to get you started.