Jump to content

Open Problem: Finding the Correct Graph for Temperature Decay over Distance


OrbitusII

Recommended Posts

So here's my conundrum: I'm working on a more effective solar heating system for KSP (to be used with the heat sink plugin, specifically applying heat to parts more realistically) and I'm in a bit of a pickle... I can most certainly find the correct equation for the heat an object experiences, however it will take too much time to accomplish, plus I'd like some feedback to make sure I'm doing it correctly.

[TABLE=width: 500]

[TR]

[TD=align: center]Distance (AU)[/TD]

[TD=align: center]Temperature (K)[/TD]

[/TR]

[TR]

[TD=align: center]0.000 (Kerbolar Corona or center of Kerbol)[/TD]

[TD=align: center]5E6[/TD]

[/TR]

[TR]

[TD=align: center]0.387[/TD]

[TD=align: center]570.05[/TD]

[/TR]

[TR]

[TD=align: center]0.723[/TD]

[TD=align: center]459.6[/TD]

[/TR]

[TR]

[TD=align: center]1.000[/TD]

[TD=align: center]271.15[/TD]

[/TR]

[TR]

[TD=align: center]1.52[/TD]

[TD=align: center]210.05[/TD]

[/TR]

[TR]

[TD=align: center]5.20[/TD]

[TD=align: center]124.25[/TD]

[/TR]

[TR]

[TD=align: center]39.48[/TD]

[TD=align: center]40.75[/TD]

[/TR]

[/TABLE]

Currently the equation I have is such: 5E6*0.94^x

Translations of the graph work to get the line of the graph closer to the data points above, but I'd like to get the graph and the data points as similar as possible with no translations (to keep things sensible for the script, we don't want high temperatures at negative distances), depending on feedback and extra information that comes in.

I will, of course, acknowledge any and everyone that helps with the math, so don't be shy! :)

Thanks in Advance!

-OrbitusII

Edited by OrbitusII
Link to comment
Share on other sites

What you need is the Stefan-Boltzmann law. Treat Kerbol and every planet as a black body, then balance energy received by the planet against energy emitted, this factor is called the albedo, it essentially measures how reflective an object is, and will vary from planet to planet but you can probably make an approximation by picking an albedo from the real planet or moon most similar to its Kerbal counterpart.

This, of course, will not account for the temperature change as a result of having an atmosphere that traps heat.

Edited by Fractal_UK
Link to comment
Share on other sites

So here's my conundrum: I'm working on a more effective solar heating system for KSP (to be used with the heat sink plugin) and I'm in a bit of a pickle... I can most certainly find the correct equation for the heat an object experiences, however it will take too much time to accomplish, plus I'd like some feedback to make sure I'm doing it correctly.

[TABLE=width: 500]

[TR]

[TD=align: center]Distance (AU)[/TD]

[TD=align: center]Temperature (K)[/TD]

[/TR]

[TR]

[TD=align: center]0.000 (Kerbolar Corona or center of Kerbol)[/TD]

[TD=align: center]5E6[/TD]

[/TR]

[TR]

[TD=align: center]0.387[/TD]

[TD=align: center]570.05[/TD]

[/TR]

[TR]

[TD=align: center]0.723[/TD]

[TD=align: center]459.6[/TD]

[/TR]

[TR]

[TD=align: center]1.000[/TD]

[TD=align: center]271.15[/TD]

[/TR]

[TR]

[TD=align: center]1.52[/TD]

[TD=align: center]210.05[/TD]

[/TR]

[TR]

[TD=align: center]5.20[/TD]

[TD=align: center]124.25[/TD]

[/TR]

[TR]

[TD=align: center]39.48[/TD]

[TD=align: center]40.75[/TD]

[/TR]

[/TABLE]

Currently the equation I have is such: 5E6*0.94^x

Translations of the graph work to get the line of the graph closer to the data points above, but I'd like to get the graph and the data points as similar as possible with no translations (to keep things sensible for the script, we don't want high temperatures at negative distances), depending on feedback and extra information that comes in.

I will, of course, acknowledge any and everyone that helps with the math, so don't be shy! :)

Thanks in Advance!

-OrbitusII

Where are you getting your data from? Are those supposed to be equilibrium temperatures for bodies at those distances? And do these data apply to our solar system, or to the Kerbol system (which has a different luminosity star)? And are your AUs in terms of Earth's orbit size, or are these "Kerbin AUs" in terms of Kerbin's orbit size?

Link to comment
Share on other sites

I'm using the average of the surface temperature and the blackbody temperature for our real life planets, AU is real life. I was planning on using the same equation (essentially) since it should apply in a similar fashion.

As for the Stefan-Boltzmann law, I'm using the heating system for parts on ships, not strictly planets, but I'll take a look at it and see what I can gather.

Link to comment
Share on other sites

If you ignore the reflectivity of the object you can use the Stefan-Boltzmann Law to calculate the effective temperature of a blackbody (planet, or not) at any distance from a star given that you know the surface temperature of the star, and the radius of the star. The equation is as follows:

T_e = T_star*sqrt(r_star/(2*a))

Where T_e is the effective temperature, T_star is the surface temperature of the star in Kelvin, r_star is the radius of the star in meters, and a is the semi-major axis in meters.

I hope this helps you out.

Link to comment
Share on other sites

255/d0.5 is used here, where D is the orbital distance.

That fits almost exactly! I'll experiment with it to see how well it works in my actual code...

AdEEdjg.png

Where blue is my data set, green is y=255/x0.5, yellow is y=5E6*0.94x, and red is the graph my calculator gave me. :D

Edited by OrbitusII
Link to comment
Share on other sites

Feel free to, always a good thing to have a high amount of accuracy!

Also, I added in the points for Saturn, Uranus, and Neptune...

Qefo45n.png?1

Got that pretty little outlier. Now if you use Neptune's blackbody temperature and not the average I used, it'll show up a little below the green... It's dat internal heating! :0.0:

Link to comment
Share on other sites

255/d0.5 is used here, where D is the orbital distance.

That is the correct relationship for a black body, by the way. Distance should be measured from center, by the way. So if you have distance from surface, add the radius in.

Link to comment
Share on other sites

That is the correct relationship for a black body, by the way. Distance should be measured from center, by the way. So if you have distance from surface, add the radius in.

Oh really? Interesting... I figured it would be from the center, so I'll be sure to take that into account when actually implementing it. :)

Link to comment
Share on other sites

That's the black sphere result, isn't it? Albedo of most objects results in lower values because they tend to be "ligher" in visible light and "darker" in infrared. Of course, the atmosphere tends to drive the equilibrium the other way.

Link to comment
Share on other sites

That's the black sphere result, isn't it? Albedo of most objects results in lower values because they tend to be "ligher" in visible light and "darker" in infrared. Of course, the atmosphere tends to drive the equilibrium the other way.

So... my one is more suited?

Link to comment
Share on other sites

From what I get through the graphs, ROFLCopter and Holo's are the closest to the data set. ROFLCopter's fits the outer planets best, Holo's fits the inner planets best, so what I could do is use a combination of both to determine the temperature. I don't think I will simply for consistency's sake, but all of it's very helpful. :) I'm trying a function in between the two I mentioned, so I'll post an update as an edit to this post.

Update: Got the final function!

Tw=(237.5/(d-0.75)0.422)-11

0TAe7wp.png?1

Edited by OrbitusII
Link to comment
Share on other sites

  • 2 weeks later...

Major Update:

Hello again, everyone!

So I have some bad news: the equation I put into the code (shown above) doesn't fit the data points except for the outer planets (1 AU has a temperature of about 415 kelvin, not 271.15 like I need), not to mention NaN errors at and below 0.75 AU. As a result, I have to scrap that equation and find a new one. Taking a few steps back, Holo's still fits best, so that will be the base for now. The main problem with all of the graphs I have currently is that they don't match the temperature of Mercury accurately, a critical point in the completeness and accuracy of the graph. Mekan1k (fellow Puffin Technologies guy) has an idea of how to create a spline that should fit well, so that's also a possible solution.

Thanks for any more help you can give!

Link to comment
Share on other sites

Major Update:

Hello again, everyone!

So I have some bad news: the equation I put into the code (shown above) doesn't fit the data points except for the outer planets (1 AU has a temperature of about 415 kelvin, not 271.15 like I need), not to mention NaN errors at and below 0.75 AU. As a result, I have to scrap that equation and find a new one. Taking a few steps back, Holo's still fits best, so that will be the base for now. The main problem with all of the graphs I have currently is that they don't match the temperature of Mercury accurately, a critical point in the completeness and accuracy of the graph. Mekan1k (fellow Puffin Technologies guy) has an idea of how to create a spline that should fit well, so that's also a possible solution.

Thanks for any more help you can give!

My equation doesn't factor in albedo, which you'll need for a T-D graph. That might explain your anomalous results for Mercury.

Link to comment
Share on other sites

Just a thought but are you treating the planets as points or circles when calculating the energy input?

Hideously complicated to calculate the energy input based on exposed surface against radiated output from all surface area, I guess.

Link to comment
Share on other sites

Just a thought but are you treating the planets as points or circles when calculating the energy input?

Hideously complicated to calculate the energy input based on exposed surface against radiated output from all surface area, I guess.

Judging from the questions asked in this topic, I don't think he's actually trying to model the temperature of planets as much as he's trying to model temperature as a function of distance from the sun.

Link to comment
Share on other sites

Judging from the questions asked in this topic, I don't think he's actually trying to model the temperature of planets as much as he's trying to model temperature as a function of distance from the sun.

OK, but the temperature as a function of distance is dependent upon infrared solar irradiance of a specific area coupled with the reflectivity of the irradiated material.

wiki/Irradiance

An object out of direct sunlight will be pretty dashed cold in comparison with something in full daylight.

The temperature of your electronics or crew cabin will depend entirely on its exposure to sunlight while in a vacuum (apart from any built in temperature support), once within the range of any significant source or sink for thermal energy things change.

I hope that Squad do not start modelling horrible things like sublimation or melting of planetary surfaces due to rocket exhaust or physical contact with "hot" landing legs. That would get very painful very quickly.

Edited by falofonos
Link to comment
Share on other sites

I hope that Squad do not start modelling horrible things like sublimation or melting of planetary surfaces due to rocket exhaust or physical contact with "hot" landing legs. That would get very painful very quickly.

I'd love it if Squad modelled that :) You touch the surface of Eeloo with your nuclear rocket... then keep on descending :P

Link to comment
Share on other sites

In simple terms, what I need is just a graph of temperature based on distance from the sun (assuming continual exposure). The purpose of this is to create a better solar heating model than the standard one and so that my heat sinks have a purpose.

I can most certainly take reflectivity into account, but the general purpose is to make things colder or hotter based on how close they are to Kerbol (75 km above Kerbol will not be a balmy 15 degrees Celsius). If I can get that working, then reflectivity is trivial. I will indeed use raycasting to test if something is in shadow, so have no fear that I will make it work as well as possible. :)

Surface melting is a nice idea, but somewhat impractical and unnecessary at the moment. What would need to be done is terrain deformation and texture recalculation to make it look somewhat realistic, plus there's the issue of creating water (fairly easy comparatively, but still), so maybe not as a stock thing but plugin writers (not me, sorry) can go ahead and do it. :D

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