# Talk:Atmosphere

## Contents

## Drag calculation notes

The calculation for the drag force as listed on this wiki page is incorrect. The units for the equation provided would be (Kg^2*m)/(s^2) when the unit of force (N) is Kg*m/(s^s). The equation should not include the mass of the craft as the mass of the craft has nothing to do with the amount of drag exerted on it.

Remember that F=ma is a very simplified version of Newton's second law. The real way to read the equation is the sum of all instantaneous forces on a body is equal to the instantaneous mass of the body multiplied by the instantaneous acceleration of the body. It is actually more helpful to think of this drag force calculation in the context of Newton's third law.The craft is accelerating the air particles it contacts (or the pressure zone ahead of it contacts) and the equal but opposite force is applied to the craft. The mass that matters when determining aerodynamic forces is the mass of the disturbed air and this is why the density of the disturbed fluid is part of the calculation.

Edit:

Before writing this I did not see the mention to this fact in the wiki page, but I am still not sure why a force would be modeled with completely wrong units. It is not to make the amount of drag be independent of the craft's mass because, as I explained above the drag equation does not consider the craft's mass. Are the internal modeling calculations all done in mass specific forces/accelerations? If so, shouldn't the true drag force then be divided by the craft's mass to yield this value? — T0w0i7ne [talk] --T0w0i7ne (talk) 15:48, 15 July 2013 (CDT)

- First of all, this biiiig paragraph isn't very readable. I actually only read some of it and I'm asking you: Do you complain, that the formula here is not real world compatible? Then I reference to: “Note that the
*m*term is not present in the real-word drag equation. In the game, this causes acceleration due to drag (*a = FD / m*) to be unaffected by a ship's mass. (It also causes the units of the drag equation to have an extra "kg" term.)”. By the way, please sign your posts with --~~~~. — xZise [talk] 16:26, 15 July 2013 (CDT)

- I misread that section once I saw it. I now understand the desire was to make the acceleration of the craft due to the force of drag be independent of the mass of the craft. What is the point in such an approach when the reality is precisely the opposite? What does this gain in the simulation? I don't see that this would be any simpler to code or that it would use drastically less CPU cycles. Please excuse my ignorance of wiki etiquette, I am now in the process of learning how to make nicer posts (after an attempt to clean up the above atrocity). I was originally under the impression that this discussion page was more like forum postings. --T0w0i7ne (talk) 22:39, 15 July 2013 (CDT)

- Now about the physical simulation, I have no idea. Maybe this should be asked on the IRC. As I don't know how they calculate the crosssection of the craft, they maybe tried to make that calculation easier and don't calculate the cross section as precise as it needed and instead they estimate a heavy craft has a bigger cross section. I don't know ;). About etiquette: In a forum you can see who posted a post, but here it is harder without the signature. And it is always nice to know who you are talking to. — xZise [talk] 05:19, 16 July 2013 (CDT)

- This is exactly what I was trying to get at in my first post. I understand the physics/aerodynamics. I'm confused by the completely unrealistic way that drag is supposedly being modeled in the game (see the wiki page). When I said "mass specific forces/accelerations" I meant it in the context that the two concepts are identical ( i.e. for all quantities being instantaneous F/m = a ). So to calculate the acceleration of the craft due to the force of drag one would divide the force of drag by the craft's mass (F_d = 1/2 * rho * A * d * V^2 and a_d = F_d/m). So the equation on the wiki page (F_d = 1/2 * rho * A * d * m * V^2) provides a meaningless value as far as I can tell. I just do not understand the reasoning behind the decision to use such a meaningless value to model drag in the game (once again assuming that the statement in the wiki that the game does it this way is accurate). — T0w0i7ne [talk] 00:47, 17 July 2013 (MDT)

- Yes the way it is calculated in the stock game is completely unrealistic. This is because mass substituted area in the equation, among many other things. For more realistic drag, FAR is available as a MOD. It's primarily used to make planes behave more realistically, but it replaces the drag and lift algorithms to achieve this, thus making drag and lift significantly more realistic. (It makes them about the same as something like Microsoft Flight Simulator. Still far less realistic than Flight Gear or X-Plane. Possibly also on par with many of the R/C Flight Simulators out there.)--Ruedii (talk) 02:10, 17 July 2013 (CDT)

- It is unrealistic in this game. No matter the Cross-Sectional Area the ship has, Drag improves as more parts are added. Mass is not directly influencing drag, but it is the no. of part. More parts is equivalent to greater mass, right? As far as I know, this hold true in 1.1. The equation is only for real drag calculation (which FAR uses), not for stock drag --Mmgfrcs (talk) 14:03, 24 April 2016 (UTC)

- Ehm Ruedii, why first edit here was a little failed (removed my comment and readded the old signatures of T0w0i7ne). I restored it with this edit. — xZise [talk] 04:00, 17 July 2013 (CDT)

## Density

The ideal gas law is irrelevant for calculating density. Real-world physics do not always apply to Kerbal atmospheres. Elembis' original number of 1.2230948554874 was correct. Notice the comment he included, density at sea level is given by FlightGlobals.getAtmDensity(1.0). For p = 1.0 atm, the 1.223 number is more accurate, see http://i.imgur.com/wJPO4m2.png for verification. The 1.2002 that this page has been quoting might be accurate at the altitude of the launch pad, where pressure is slightly lower than 1 atm.

Similarly, the factor of 0.008 isn't on the density. The number comes from FlightGlobals.DragMultiplier, and it should either be interpreted as the ratio of cross-sectional area in m^2 per kilogram of mass for KSP parts, or as a dimensionless factor you have to multiply the drag coefficients (usually 0.2) by.

Notice how we've been using Elembis' original template http://wiki.kerbalspaceprogram.com/wiki/Template:VT with the correct 1.223 sea-level density number to calculate terminal velocity in every article, which has been giving correct terminal velocity values. But he referenced this more-commonly-seen Atmosphere article as his source, without realizing his correct numbers would gradually be replaced by incorrect numbers. --Tavert (talk) 18:59, 23 August 2013 (CDT)

- Maybe leave a note on Richardo 5's talk page. (S)He made “measurements” and then changed the constants. Di you measure a constant of 1.2002 at the height of the launch pad? Because I get a different value: e
^{-68m/5000m}×1.2230948554874=1.20657337 - When I'm not mistaken, this would be the constant when you have 1 atm at the launch pad. — xZise [talk] 04:06, 24 August 2013 (CDT)
- It looks like it was Nulvinge who added the ideal gas law equation but apparently without checking the numbers, then Richardo 5 plugged Nulvinge's ideal gas law numbers into a calculator and that's where the 1.2002 number came from. Here's a quick screenshot with MechJeb's density readout showing on the launch pad at 1.206 (close to your prediction), but it's kind of a short rocket so maybe on tall launch clamps you could get to 1.2002? http://i.imgur.com/FKz6PaY.jpg And part of my point was that you don't have 1 atm pressure at the launch pad, you have roughly 0.986 atm.
- I think it should be noted rather than "the way the Kerbal universe works" that the 0.008 number comes from the API function FlightGlobals.DragMultiplier, and likewise with sea-level density from FlightGlobals.getAtmDensity(1.0), and these API functions are what mods like MechJeb and Kerbal Engineer use in their source to measure (and predict in MechJeb's case) drag and density. If these numbers from the API functions didn't reflect the game physics, then the atmospheric-landing and aerobraking predictions in MechJeb would have noticeably larger errors. --Tavert (talk) 04:39, 24 August 2013 (CDT)
- Ah nice. Yeah I guess this could be changed to the official numbers, maybe a little text that the density on the launch pad might differ. Sitting on the launch pad at about 68 m (AMSL) the measurement point should be about 26 meters above the launch pad (or 94 m AMSL). — xZise [talk] 05:23, 24 August 2013 (CDT)
- Having looked through the history and tracked it down to one user adding the ideal gas law without checking the numbers and another user replacing the numbers assuming the ideal gas law equation was reflecting KSP physics, I don't think the 1.2002 number, or discussion about the launch pad altitude, or the ideal gas law are necessary at all.
- I think it makes the most sense to say A = 0.008 (m^2/kg) * mass, and note that the 0.008 conversion factor comes from FlightGlobals.DragMultiplier. The density varies proportionally to pressure (with FlightGlobals.getAtmDensity(1.0) = 1.2230948554874), which is consistent with an isothermal atmosphere assumption so the temperature sensor readout is not at all related to pressure or density or drag, and the ideal gas law does not really hold for atmospheres in KSP.
- I could try going through and revising, but I'm not too familiar with wiki formatting or etiquette so I wanted to discuss first. It's a bit of a long article with numbers showing up in several places, any lingering inconsistencies from missed numbers would confuse people.
- A separate quibble that applies here and a few other places on the wiki, 1 atmosphere is defined by the CGPM as exactly 101325 Pascals. 101 kPa is a rounding, 101.327 kPa (which I see in a few places) is closer but also wrong. It's possible that Kerbal atmospheres means a different thing, but I think the original source of the 101.327 number is from this spreadsheet: https://docs.google.com/spreadsheet/ccc?key=0AuySrGPsDeq2dFdaS19xc2lobGc2aWNXUkJsZlVtWFE#gid=1 However I can't seem to find any mention of that number in the source forum thread or any of the linked pastebin data. FlightGlobals.getStaticPressure returns in atmospheres, and I guess the 0-altitude pressures for the bodies other than Kerbin were found from other sources (luckily they're all round numbers). Thanks for responding to this. --Tavert (talk) 06:22, 24 August 2013 (CDT)
- I also noticed that the {{Infobox/Body}} uses 101.327 kPa/atm but nobody replied on the talk page.
- Unfortunately I don't know that much about pressures and such, so I don't know how the ideal gas law is applying here (or not). But I guess the main problem is this edit, now Google returns (even with the correct value kPa for 1 atm) a totally different value, so I don't know where the error is: In the formula, the constants or even using the formula. Interestingly if you multiply that constant with 1 atm you get this 1.2002 (when using 101 kPa, or 1.2041 when using 101.325 kPa).
- But nevertheless I would recommend to fix all occurrences of the incorrect constant. And the formula should also be removed as long as we don't know what is wrong with it. — xZise [talk] 08:13, 24 August 2013 (CDT)
- Oh and yes, those 0.008 should be removed from the pressure/density conversion formula, as MechJeb shows. I guess you want to add this coefficient to the first formula calculating the force? — xZise [talk] 08:24, 24 August 2013 (CDT)

- Ah nice. Yeah I guess this could be changed to the official numbers, maybe a little text that the density on the launch pad might differ. Sitting on the launch pad at about 68 m (AMSL) the measurement point should be about 26 meters above the launch pad (or 94 m AMSL). — xZise [talk] 05:23, 24 August 2013 (CDT)

There is/was a bug with the atmospheric density the game calculates. The way the code was designed, it has a pressure curve vs altitude for each planet, and computes everything else from this, using invariant data for standard Earth air (ASL, 60F). This is why the ideal gas law goes bonkers, and why the calculated speed of sound is also invariant. The temperature data was tacked on later, but afaik, never properly integrated into the atmospherics. The issue was supposed to have been looked at back in 2012 when squad was going to give us a real atmospheric system to go with the brand new plane parts, but this never materialized.--Kellven (talk) 05:50, 28 February 2014 (CST)

## Unit of the density at 1 atm

Hi, there is this value “1.2230948554874 kg/m³”, but the unit doesn't work out. I tried to add units to the example below and it seems, like it has to be “kg/(m⁴·atm)”. This would generate a ρ which has the unit kg/m⁴ and this would cancel out the units and generate m²/s² in the sqrt. Is this correct? — xZise [talk] 16:03, 2 September 2013 (CDT)

- Okay I can answer the question myself: I got the unit for the drag force wrong, because of the conversion factor between mass and area. Now the density ρ is given in kg/m³ (like in the real world). — xZise [talk] 16:23, 2 September 2013 (CDT)

## Optimal Speed Reference

Does anyone have a reference for why terminal velocity is the fuel-optimal ascent speed? I can follow, and somewhat intuit that it makes sense, but I want to know why terminal velocity is optimal. --Abnaxis (talk) 10:54, 24 January 2014 (CST)

- Apparently it has something to do with the Goddard problem. By my self I have no idea if that is correct, but I asked in the IRC and there I got that answer. Maybe somebody with more knowledge about that topic can explain it detailed in the Wikipedia or here in the article. — xZise [talk] 12:53, 31 January 2014 (CST)

I believe this is just a case of minimizing gravity drag by using highest possible thrust balanced against the exponential increase of air drag with speed. The terminal velocity is the general easy to find break even point of wasting fuel fighting gravity and wasting fuel fighting friction.--Kellven (talk) 05:50, 28 February 2014 (CST)

## Lift

This page currently only has a single mention of "lift", in the introductory paragraph. It seems appropriate for a page about the atmosphere to include a section dedicated to lift, describing it, much like drag. This forum post by Chevron Tango proposes one approach to lift, but I'm still planning how to test it, so I'm not sure if it's accurate. Donfede (talk) 23:20, 22 April 2014 (CDT)

- If the experiments can be validated or there is an official description of it, go ahead and add it. — xZise [talk] 03:11, 23 April 2014 (CDT)

## About the math attribute

the math attribute can not use with non-ASCII characters ! please use other method to express that! Dlm tamashii (talk) 23:05, 30 January 2015 (CST)

- You mean <math> (that is technically called a tag, <foo math="bar"> there math is an attribute)? That is not correct as it support Greek characters (for obvious reasons). Could you also be more specific what needs to be changed? The formulas look correct here. — xZise [talk] 05:38, 31 January 2015 (CST)