Jump to content

Sun Atmosphere Sampler


DAL59

Recommended Posts

Believe it or not, Kerbol has an atmosphere.  Without using the cheat menu, get science from the atmosphere of the sun.  Bonus points if you return to kerbin afterwords.  All non-part mods allowed.  I recommend using better time warp, so you can make your orbit just go in the top few meters of the atmosphere, slow down time, and quickly get some science.  You'll still need an outrages amount of heat shields and radiators though.  Good luck!

Link to comment
Share on other sites

On 11/26/2018 at 10:57 AM, TheFlyingKerman said:

Last time I went for a solar dive with 1GM Pe my heat shield abrasive (to be used for Kerbin re-entry) was gone after a few orbits even in time warp. I don't understand why.

KSP heating mechanics get wonky in time warp. I've built craft that were perfectly fine sitting at their Kerbol periapsis in 1x warp, but would overheat and blow up instantly at 5x warp. :huh:

I think what happens is that the game is still tracking the heat in time warp, but using much larger time steps. And it probably uses simple Euler integration instead of some fancier integration algorithm -- that is to say, on every time step it just calculates the net rate of heat gain/loss over time for each part, summing up all heat sources and sinks, and then multiplies this by the length of the time interval (and divides it by the part's heat capacity) and adds the result to the part's temperature.

Now, the rate of heat loss through radiation (and conduction to adjacent parts, etc.) is generally proportional to temperature (both in KSP and in real life), while the rate of heat gain from the sun is constant (or, rather, proportional to the temperature of the sun, which of course is pretty constant). So what happens is that each part will basically have an equilibrium temperature where those two rates are equal: if the part is cooler than its equilibrium temperature, it will gain more heat than it loses, and if it's hotter than its equilibrium temperature, it will lose more heat than it gains.

The problem is that, if the time step is too large, the temperature change calculated in the simple way described above can easily overshoot the equilibrium.

For example, let's say you have a part on your probe that would be at equilibrium at 2000 K, but is currently only at 1999 K. And just to keep the numbers nice, let's say that its temperature gain/loss rate at 1 K below the equilibrium, as calculated by the game, is 1 K/s.

At 1x time warp, the game does something like 100 physics time steps per second, so on the next timestep the game will increment the part's temperature to 1999.01 K. And on the next time step it will heat up by, say, 0.99 K/s, so its new temperature will be 1999.0199 K. And it will keep gradually heating up more and more slowly as it approaches its equilibrium temperature, and all will be fine.

But if we're instead at, say, 1000x time warp, then the game obviously cannot do 100,000 physics updates per every real-time second; your CPU isn't that fast. Instead, it just keeps doing 100 updates per second in real time, i.e. one update per 10 seconds in game time. (Well, OK, for a simple craft it probably could do 100,000 updates per second, if the heat physics code was optimized enough. But the point is, there's always a limit and the game doesn't even try to scale the physics update rate with the warp factor.) So that means that, after one physics update tick, the part will now be at 1999 K + 1 K/s * 10 s = 2009 K.

And what's worse, on the next time step, the game will see that the part is now 9 K above its equilibrium, and calculate its new temperature gain/loss rate as something close to -9 K/s, and thus its new temperature, one ten second time step later, as 2009 K - 9 K/s * 10 s = 1919 K. And now the part is 81 K below its equilibrium, and thus heating up at a rate of about 81 K/s, so one more time step later it will end up at 1919 K + 81 K/s * 10 s = 2729 K. And then it will blow up, because it just exceeded its heat tolerance of 2500 K. :P 

Now, if the KSP devs wanted, they could pretty easily replace the simple Euler integration with something more advanced like fourth order Runge-Kutta (which can still blow up if the time step is too large, but is a lot more accurate and less likely to do so) or even the backward Euler method (which is no more accurate than the normal Euler method, but tends to undershoot rather than overshoot at large time steps, and thus won't blow up). Both of those are a bit more complicated to code and require more time to calculate (since they need to recompute the heat gain/loss several times per timestep to find a solution), but they would solve, or at least mitigate, the stability problem.

Unfortunately, I suspect this this is probably not a high priority for the devs, since few players will ever put their craft in situations where it really matters, and those who do will probably just chalk it up to low Kerbol orbit being inhospitable to spacecraft. :rolleyes:

(As a disclaimer, I should note that everything I wrote above is just informed conjecture. I have not looked at the KSP code to see how it actually updates part temperatures. But I have written physics code myself, both for games and for scientific purposes, and the simple Euler integration I described above is pretty much the simplest and easiest way to write something like the part temperature tracking in KSP, especially if you don't actually realize that what you're implementing is an integrator. Also, the symptoms fit.)

(Edit: After some testing, I think there must actually be something more going on. It feels like KSP is doing something like scaling the heat gain/loss rates down under time warp, perhaps precisely to avoid the overshoot effect I described, but doing it in some weird way that can cause the equilibrium temperatures to go up or down depending on the time warp factor. I dunno. I still stand by my initial statement that things "get wonky" under time warp. :P)

Edited by vyznev
Link to comment
Share on other sites

My idea is to build a small probe with all the science parts and attach an inflatable head shield to it. It does not consume/hold ablator and is BIG so it can cover entire craft. Maybe not one will be needed.

Link to comment
Share on other sites

Hm... Do heatshields in ksp work at the sun as expected?

I just gave it a quick try and it did not seem like the heatshield covers anything. Parts behind it get as hot as they do without it.

Edit:I mean outside of it's atmosphere.

Edited by Kergarin
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...