Jump to content

Kerbal science: The atmosphere of Kerbin


CaptainArbitrary

Recommended Posts

This could actually be a fun science experiment for kids at a summer school type thing. Building rockets to try and find various things about a planet. With sensors like this it would be an excellent activity especially if it could spit out reams of data into something like excel.

I\'m not a programmer in the slightest but I do work in the science industry, though unrelated to rocketry, and I think it might be interesting that once KSP launches for real it could be sold to schools (with some modifications) to do these kinds of experiments on.

Link to comment
Share on other sites

Nice work on gathering that data. It seems the temperature model is working very much as expected. :)

As with Earth, Kerbin\'s atmospheric temperature doesn\'t change in a steady curve with altitude. Instead, it\'s got layers where it gets cooler, layers where temperature is steady, and layers where it heats up again.

Then, after you clear the 70km mark, another interesting thing happens. At those altitudes, you\'re pretty much in a perfect vacuum, so the temperature varies based on exposure to direct sunlight. That chart with the noisy data isn\'t noisy at all actually, it\'s just oscillating as the probe craft orbits the planet, and goes in and out of its shadow.

Cheers

Link to comment
Share on other sites

Very nice.

Now, who had the data about atmospheric density? We should combine the two and get the sound speed at all altitudes ;)

I think this will be difficult because it seems that Kerbin\'s atmosphere cannot be approximated as an ideal gas. I plotted pressure and density vs. altitude from sea-level through 15000 m below:

Please just ignore the lack of units... This is raw data sampled directly from the game using a data recorder plugin.

1AeHZ.png

I then used CaptainArbitrary\'s temperature data to compute the ideal gas constant ® for Kerbin\'s atmosphere. If Kerbin\'s atmosphere were an ideal gas, then R should be constant. Unfortunately it isn\'t:

lOx7L.png

The percentage of variation of R with temperature, pressure and density can be reduced by increasing the offset of the temperature scale from absolute zero, but I don\'t like this as an explanation. I\'d be interested to hear people\'s theories about why Kerbin\'s atmosphere doesn\'t behave as an ideal gas.

Link to comment
Share on other sites

I then used CaptainArbitrary\'s temperature data to compute the ideal gas constant ® for Kerbin\'s atmosphere. If Kerbin\'s atmosphere were an ideal gas, then R should be constant. Unfortunately it isn\'t:

It\'s simpler ;) The temperature profile is copied from Earth, while the pressure profile follows the simplified isothermal model (a simple exponential). The two effects are superimposed without computing their interplay. You can notice that your graph of 'R' is a mirror image of the temperature graph....

As for the atmospheric density, I\'ve heard conflicting opinions. Somebody says that even considering the 'Aristotelian' drag equation snafu (mass term apparently involved with drag, etc.) you can work out the atmospheric density in SI units, and that it is 8 times Earth at sea level. Somebody says 5 times. And now that I think of it, we\'d need gamma to calculate the speed of sound, and that would be a very poorly constrained guess....

Well, for playing physicist in the thread, all the guesses can be interesting and fun: for the game proper, if the speed of sound is defined (and I clearly hope it is), it\'s probably better to just define it at sea level at a 'nice' value (something like 250 m/s?) and then work it out with the temperature profile from there.

(Why 250 m/s, you ask? Well, it\'s a balance between being just too slow and having too small a range between normal flight and space flight. This would put standard orbit at about Mach 10, Munar reentry interface at Mach 14...)

(Another reason for a Mach readout: lots of planets, lots of different atmospheres, many different regimes to explore ;) )

Link to comment
Share on other sites

And now that I think of it, we\'d need gamma to calculate the speed of sound, and that would be a very poorly constrained guess....

But that was kinda my point. The speed of sound in an ideal gas (which air nicely approximates) is a function of gamma, R and temperature. But Kerbin\'s atmosphere doesn\'t appear to be an ideal gas...

Anyway, I agree about the game. It is fun to do and discuss sciencey stuff like this but let’s not get hung up on the details. :)

Link to comment
Share on other sites

Nice work on gathering that data. It seems the temperature model is working very much as expected. :)

As with Earth, Kerbin\'s atmospheric temperature doesn\'t change in a steady curve with altitude. Instead, it\'s got layers where it gets cooler, layers where temperature is steady, and layers where it heats up again.

Then, after you clear the 70km mark, another interesting thing happens. At those altitudes, you\'re pretty much in a perfect vacuum, so the temperature varies based on exposure to direct sunlight. That chart with the noisy data isn\'t noisy at all actually, it\'s just oscillating as the probe craft orbits the planet, and goes in and out of its shadow.

Cheers

That\'d make sense if the oscillations lasted a long time, but in the original post he says that it happens multiple times per second.

Link to comment
Share on other sites

At those altitudes, you\'re pretty much in a perfect vacuum, so the temperature varies based on exposure to direct sunlight. That chart with the noisy data isn\'t noisy at all actually, it\'s just oscillating as the probe craft orbits the planet, and goes in and out of its shadow.

While that makes perfect sense, I\'m not entirely sure it\'s working as designed in the current version, at least on my computer.

Thermopod 3 is a very simple satellite. It masses about a ton, and it only has three parts on it: a command module, a telemetry transmitter, and a strut part with a temperature sensor built into it. I shot it up into a 125km circular orbit, then I put it into a fixed orientation with respect to the sun: smallest cross-area. It\'s roughly a cylinder shape, and the bottom end faced the sun the whole time it was in orbit. Then I just let it circle Kerbin for a couple hours with the recorders set to high speed.

This is what I got back:

Suq9U.png

Times of sunrise and sunset are marked with vertical lines. They\'re approximate, because I was noting them in real time by eye, but they\'re not off by more than a second or two either way. The trace is split up into two days and two nights, the days lasting about 23½ minutes and the nights about 10¾ minutes, as you\'d expect given the satellite\'s altitude.

As you can see, we\'re looking at a temperature of the part — the internal temperature, from part.temperature, not the external one from FlightIntegrator — that hovers around 85°C all the time, but with huge, but relatively short, periodic changes. For example, let\'s look at the first night.

Wa3L9.png

The times are in seconds, so we\'re looking at a span of exactly 10:46 here. At sunset, the temperature of the part was trending upward, going from 66°C to 95°C over five minutes. But then the temperature took a sudden and huge drop, going from 108°C down to –3°C over just forty seconds. I don\'t know of a ton of anything that can change its temperature that fast.

What I\'m calling the 'midnight anomaly' repeated itself the second night, about 34 minutes later:

0ZUUy.png

Exact same gradual upward trend, exact same sharp drop of about a hundred degrees.

There\'s a similar 'noon anomaly' that happens about halfway through each day. The temperature of the part goes from about 100°C down to within a couple degrees of zero over forty seconds. But then a few minutes later, something truly crazy happens:

FPuMZ.png

A two-hundred-degree drop in just twenty seconds! I call these the 'twilight anomalies.' They happen almost exactly three minutes before sunset on each orbit I\'ve observed so far. Here\'s day two in close-up:

Wm13U.png

As you can see, if the idea is that the temperature of a part should vary based on sunlight exposure, it\'s not working at present. We should see a sinusoidal oscillation between a low of –100°C or so just after local midnight (when the sun is eclipsed by Kerbin) up to a high of 100°C or so just after local noon half an orbit later. Instead, we\'re getting this more-or-less steady temperature throughout the whole orbit, punctuated by these really unphysical anomalies. And over the short term, the oscillations are really severe. Lookit:

X36kO.png

This is ten seconds I picked basically at random from the data. Over a single second, the spread is as much as five degrees, and the spread for the whole ten-second period is about fifteen degrees. That\'s a lot of volatility in a parameter that realistically would have significant hysteresis!

Anyway, the long and the short of it is that I think my heat-management ideas are currently stymied. Between the fact that heatConductivity and heatDissipation can\'t be changed in part.cfg and the general weirdness of drying to dump excess heat out into space, I\'m inclined to think I\'m doomed to have all my Kerbals keep coming back boiled.

EDIT: Oh, I forgot to mention. I\'d be happy to upload my raw telemetry data, if anybody wants to see it. But …um … it\'s more than 140,000 data elements, and over 20 MB. So I won\'t bother unless somebody really wants to see it bad.

Link to comment
Share on other sites

module = ArcturusTelemetryTransmitter

I\'m trying to get this thing to work, installed the telemetry plugin, changed a part to 'module = ArcturusTelemetryTransmitter', but now it says the part is not available in this version of KSP. I\'m running KSP 0.152, and the 'Telemetry Module MK2' that comes with the the telemetry plugin does work; it bleeps and i can see its data being received by UDPReceiver.exe.

Likewise

MODULE

{

name = ArcturusTelemetrySensorAtmosphere

}

Does not work, KSP hangs on loading it.

Could it be the Arcturus modules need dll\'s that i don\'t have and that would need to be compiled from the sourcecode that you provided?

Link to comment
Share on other sites

I had no idea that temperatures were even defined in Kerbin\'s atmosphere, let alone being able to measure them!

Just for reference, in an earlier thread we worked hard to find out the density profile of the atmosphere, and by experiment with atmospheric drag we found that the density is given by

0.009785 Exp[-altitude / 5000 m] mass units per m3, where the command pod = 1 mass unit (which may be 1 kg or 1000 kg, or something in between I suppose). This profile has been rigorously tested in terms of predicted vs. actual behavior of craft in our atmosphere, and in fact has been incorporated into MechJeb, which would not be able to predict orbits or landings accurately if it were any different.

The scale height implies an average molecular weight of about 46, which led me to half-jokingly suggest a composition which includes some Xenon or sulphur hexafluoride. See for example:

http://kerbalspaceprogram.com/forum/index.php?topic=2062.msg106155#msg106155

I\'m not sure where the separate pressure vs. altitude profile comes from (as shown in the post by PakledHostage above). I do recall that the parachute deploys at a set pressure, but I don\'t know if anyone has tested pressure vs. altitude by altering this set pressure in the .cfg file and then observing when the chute opens.

Note that even for Earth\'s atmosphere, which is not isothermal, the density profile is still well approximated by an exponential, at least for altitudes relevant to aviation.

Even so, it would not surprise me if pressure followed density as if the atmosphere were isothermal - and the temperature readings are inconsistent with an ideal gas model. The developers have done an amazing job with the physics, but I don\'t expect everything in the game to be self-consistent. Not yet anyway. :)

Link to comment
Share on other sites

I\'m not sure where the separate pressure vs. altitude profile comes from (as shown in the post by PakledHostage above). I do recall that the parachute deploys at a set pressure, but I don\'t know if anyone has tested pressure vs. altitude by altering this set pressure in the .cfg file and then observing when the chute opens.

The separate pressure data comes from a cheesy little data logger module that I wrote to fly aboard my spacecraft. It records parameters like pressure, density, speed, altitude, lat, lon (and now temperature, thanks to CaptainArbitrary) into a .csv file. I\'ve attached the data that I used to make the plots earlier in this thread, below.

Using Excel to fit an exponential trend line to the pressure data, I get exactly the equation you quoted for density, while the equation for density is 1.2223 exp(-alt(m)/5000).

While I don\'t know anything about MechJeb, I have used your density equation in my aerobraking/re-entry model with amazingly accurate results, so I know it is correct.

The only way I can explain the discrepancy between the data that I recorded with my rocket sonde and the and the work you and Kosmo-not, et al, did in the max altitude with this supplied spacecraft thread, is that the drag equation is worse than we thought. It must be using pressure rather than density to calculate drag.

Link to comment
Share on other sites

Thanks for the fast reply and the telemetry data.

Regarding the sea-level atmospheric density, if you recall this post from Iskierka:

http://kerbalspaceprogram.com/forum/index.php?topic=7161.msg116175#msg116175

...he found the density law you quoted in the code, and an additional 'drag multiplier' variable of 0.008, which explains the discrepancy between your 1.223095 mass units per cubic meter from your density probe, and the 0.009785 normalization which fits the drag equation.

If your telemetered atmospheric pressure is in 'bars' = 105 N/m2, then the ratio of pressure to density which you found is a constant 81760 m2/s2 (the mass units cancel out) independent of altitude, which implies an isothermal atmosphere, in disagreement with the temperature readings.

We probably were not supposed to notice or care about this discrepancy, and there are many other 'impossibilities' in the Kerbal universe to do with the planet\'s density, Kerbol\'s luminosity, the habitable zone, etc. But my hat is off to those who found it!

(The constant pressure/density ratio also implies a sound speed of order Sqrt(81760) = 286 m/s for all altitudes, which would affect re-entry physics later on in the game\'s development.)

Link to comment
Share on other sites

  • 1 month later...

CaptainArbitrary great work, I read many academic papers about Computer Science but your thread here somehow more interesting :P. Is there any chance of an Instrumentation error at this point? Something in the code?

Link to comment
Share on other sites

  • 1 year later...

hi all

awesome amount of detail from the devs here is my log in excel if anyone is interested it was for a trip up to 10km and back with data points at every second used graphatron 2000 man i love this game and community i have learned so much since being here

http://s000.tinyupload.com/?file_id=...82313977226072

the weird thing is in my data i level off at -200 at a high of 9500m any explanations could it be a day night thing

Edited by hawk_za
Link to comment
Share on other sites

Nice work on gathering that data. It seems the temperature model is working very much as expected. :)

As with Earth, Kerbin\'s atmospheric temperature doesn\'t change in a steady curve with altitude. Instead, it\'s got layers where it gets cooler, layers where temperature is steady, and layers where it heats up again.

Then, after you clear the 70km mark, another interesting thing happens. At those altitudes, you\'re pretty much in a perfect vacuum, so the temperature varies based on exposure to direct sunlight. That chart with the noisy data isn\'t noisy at all actually, it\'s just oscillating as the probe craft orbits the planet, and goes in and out of its shadow.

Cheers

.... answers my question as to whether being exposed to the sun/shade has any affect. Thanks HarvesteR

Link to comment
Share on other sites

Awww. Necro. Got my hopes up.

There really needs to be a device that locks threads with no activity after a certain time limit.

Seriously, stop necroing threads.

Seriously, stop complaining about people bumping old threads. If there's interest in a topic, why open a new thread? It just goes to show some people actually know how to use the search function. Much better to expand an existing topic with new information than cluttering the forums with half-complete topics, increasing the chance to miss previously established info and decreasing the chance to actually find meaningful threads.

Sorry for continuing off-topic (why don't you seem to care about that...?).

Link to comment
Share on other sites

Seriously, stop complaining about people bumping old threads. If there's interest in a topic, why open a new thread? It just goes to show some people actually know how to use the search function. Much better to expand an existing topic with new information than cluttering the forums with half-complete topics, increasing the chance to miss previously established info and decreasing the chance to actually find meaningful threads.

Sorry for continuing off-topic (why don't you seem to care about that...?).

You beat me to it.

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