Temperature of a Planet

Off topic discussion zone.

Moderators: winston, another_commander, Cody

Post Reply
User avatar
CommRLock78
---- E L I T E ----
---- E L I T E ----
Posts: 1138
Joined: Sat Apr 07, 2012 7:35 pm
Location: US
Contact:

Temperature of a Planet

Post by CommRLock78 »

Another Matlab/Octave program I wrote, this time strictly for fun :D. The function in the program assumes earth-like conditions for the planetary body as far as albedo and emissivity.

For our solar system:
Surface temperature of the sun = 5780 K
Radius of sun = 6.96 * 10^8 m (or 6.96E8 m, alternatively)
1 AU = 1.49 * 10^11 m (or 1.49E11 m)

Code: Select all

% Temperature of a planetary body as a function of distance from a star

% T_s & R_s are the surface temperature and radius of the star respectively
T_s = input('Enter the Surface Temperature of the Star in Kelvin: ');
R_s = input('Enter the Radius of the Star in meters: ');
R_p = input('Enter the Distance from the Star to the Planet in meters (optional): ');

% AE is a factor having to do with a body's albedo and emissivity in the infrared.
% AE = sqrt((1-a)/e), where a = albedo and e = infrared emissivity.
AE = 1.1235^0.5; % this particular value would be an Earth-like planet, a = 0.4 and e = 0.534.

% R, orbital distance of a planet
R = 0:10000000:1.49E12;

% T(R)
T = T_s.*(R_s.*AE./(2.*R)).^0.5;
T_p = T_s.*(R_s.*AE./(2.*R_p)).^0.5;

% Habitable Zone
HZUT = 315 + 0.*R;
HZLT = 225 + 0.*R;

% Plotting T(R) and the habitable zone limits
plot(R,T,R,HZUT,R,HZLT,R_p,T_p,'o')
axis([0 1.49E12 0 2500])
title('Temperature vs Distance, R')
xlabel('Distance (1.49 * 10^8 km = 1 AU)')
ylabel('Temperature in Kelvin')
grid on

% checking to see if R_p was entered
DC = isempty(R_p);
if DC == 0
fprintf('The equilibrium temperature is %0.2f Kelvin at a distance of %0.2E meters.\n',T_p,R_p)
else
end
Last edited by CommRLock78 on Mon Dec 03, 2012 2:15 am, edited 3 times in total.
"I'll laser the mark all while munching a fistful of popcorn." - Markgräf von Ededleen, Marquess, Brutal Great One, Assassins' Guild Exterminator
---------------------------
At the helm of the Caduceus Omega, 'Murderous Morrígan'
User avatar
CommRLock78
---- E L I T E ----
---- E L I T E ----
Posts: 1138
Joined: Sat Apr 07, 2012 7:35 pm
Location: US
Contact:

Re: Temperature of a Planet

Post by CommRLock78 »

I recall Wildeblood had a screenshot where his ship was giving data on the local star. It would be great to see that as part of the core game (probably blasphemy, but hey..). Along with the star type, it could give information on the exact surface temperature of the star, and it's current distance from the ship.
"I'll laser the mark all while munching a fistful of popcorn." - Markgräf von Ededleen, Marquess, Brutal Great One, Assassins' Guild Exterminator
---------------------------
At the helm of the Caduceus Omega, 'Murderous Morrígan'
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2446
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Temperature of a Planet

Post by Wildeblood »

CommRLock78 wrote:
I recall Wildeblood had a screenshot where his ship was giving data on the local star. It would be great to see that as part of the core game (probably blasphemy, but hey..). Along with the star type, it could give information on the exact surface temperature of the star, and it's current distance from the ship.
(I never look in the Outworld section of the forum, so stumbling upon this was extremely unlikely.) When testing my altimeter script I flew to a star and was disappointed to find that they function exactly like planets, in that you can fly right up until you touch the solid surface whereupon your ship is destroyed, not by being incinerated, but by crashing into a planet. So no, distance is not something you could display (not without a lot of massaging), because the idea of hovering 10m off the solid surface of a star is "just wrong on so many levels".
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Temperature of a Planet

Post by Commander McLane »

Wildeblood wrote:
When testing my altimeter script I flew to a star and was disappointed to find that they function exactly like planets, in that you can fly right up until you touch the solid surface whereupon your ship is destroyed, not by being incinerated, but by crashing into a planet. So no, distance is not something you could display (not without a lot of massaging), because the idea of hovering 10m off the solid surface of a star is "just wrong on so many levels".
Agreed, but then again the suns in Oolite are fake anyway. For starters, they're not spherical objects, but just flat discs.

So I guess the engine goes the cheapest way: explode any object that is closer to the centre of the disc than 1 radius of the disc. Which practically emulates a direct collision with its spherical surface, if there were a spherical surface.

There is of course also death from cabin temperature overload, which doesn't require you to get to 1 radius distance from the centre of the disc. But it takes some time to kill you.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2446
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Temperature of a Planet

Post by Wildeblood »

Commander McLane is correct about the process, so my remark re-phrased in more accurate but less accessible terms:-
Wildeblood wrote:
When testing my altimeter script I flew to a star and was disappointed to find that they function exactly like planets, in that you can fly right up until you touch the solid surface reach the collision radius whereupon your ship is destroyed, not by being incinerated, but by crashing into a planet.
I disagree with the characterization of using a 2D imposter as "fake", though. There is no purpose to modelling thousands of polygons for an object that has no surface detail and would appear as a flat, featureless disc anyway. The collision radius is what counts, and that is apparently calculated accurately.

But the whole heat calculation and insulation business seems wrong to me. No matter how much insulation you have, your ship should be incinerated long before death by "crashing into a planet" becomes an issue.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Temperature of a Planet

Post by Commander McLane »

Wildeblood wrote:
But the whole heat calculation and insulation business seems wrong to me. No matter how much insulation you have, your ship should be incinerated long before death by "crashing into a planet" becomes an issue.
It's basically a necessity for allowing player (and NPCs!) to sunskim. Thus it's just another case of game-play-trumps-realism.
User avatar
CommRLock78
---- E L I T E ----
---- E L I T E ----
Posts: 1138
Joined: Sat Apr 07, 2012 7:35 pm
Location: US
Contact:

Re: Temperature of a Planet

Post by CommRLock78 »

Wildeblood wrote:
<SNIP>
I disagree with the characterization of using a 2D imposter as "fake", though. There is no purpose to modelling thousands of polygons for an object that has no surface detail and would appear as a flat, featureless disc anyway. The collision radius is what counts, and that is apparently calculated accurately.
Excellent point
Wildeblood wrote:
But the whole heat calculation and insulation business seems wrong to me. No matter how much insulation you have, your ship should be incinerated long before death by "crashing into a planet" becomes an issue.
As Commander McLane says it's a compromise between realism and playability.

Still though, even if distance were out of the question, the spectral type would be great to see (O,B,A,F,G,K,M) - and indeed, much more interesting information than distance.... :mrgreen:
"I'll laser the mark all while munching a fistful of popcorn." - Markgräf von Ededleen, Marquess, Brutal Great One, Assassins' Guild Exterminator
---------------------------
At the helm of the Caduceus Omega, 'Murderous Morrígan'
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2446
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Temperature of a Planet

Post by Wildeblood »

CommRLock78 wrote:
Still though, even if distance were out of the question, the spectral type would be great to see (O,B,A,F,G,K,M) - and indeed, much more interesting information than distance.... :mrgreen:
Distant Suns OXP :mrgreen:

But there are no O types included, something about planets being impossible, because class O stars are so hot they ionize everything for light-years all around.
User avatar
CommRLock78
---- E L I T E ----
---- E L I T E ----
Posts: 1138
Joined: Sat Apr 07, 2012 7:35 pm
Location: US
Contact:

Re: Temperature of a Planet

Post by CommRLock78 »

Wildeblood wrote:
CommRLock78 wrote:
Still though, even if distance were out of the question, the spectral type would be great to see (O,B,A,F,G,K,M) - and indeed, much more interesting information than distance.... :mrgreen:
Distant Suns OXP :mrgreen:

But there are no O types included, something about planets being impossible, because class O stars are so hot they ionize everything for light-years all around.
Many thanks Wildbloode - this is a cool OXP 8). I might just snoop around the code a bit as it looks as though this is for G1 only for now ;).
"I'll laser the mark all while munching a fistful of popcorn." - Markgräf von Ededleen, Marquess, Brutal Great One, Assassins' Guild Exterminator
---------------------------
At the helm of the Caduceus Omega, 'Murderous Morrígan'
User avatar
CommRLock78
---- E L I T E ----
---- E L I T E ----
Posts: 1138
Joined: Sat Apr 07, 2012 7:35 pm
Location: US
Contact:

Re: Temperature of a Planet

Post by CommRLock78 »

Back on topic; I found myself investigating some of these new extra-solar planets and seeing for myself what the equilibrium temperature is. A couple of the more exciting systems:

Gliese 581d (this planet soundly resides within the HZ):
Surface temperature of Gliese = 3480 K
Radius of Gliese = 2.0184E8 m
Gliese 581d semi-major axis = 2.0264E10 m

Kepler-20f (this host star is very similar to the sun):
Surface temperature of Kepler-20 = 5460 K
Radius of Kepler-20 = 6.57E8 m
Kepler-20f semi-major axis = 1.64E10 m

Now run the program and find the equilibrium temperature! :D
"I'll laser the mark all while munching a fistful of popcorn." - Markgräf von Ededleen, Marquess, Brutal Great One, Assassins' Guild Exterminator
---------------------------
At the helm of the Caduceus Omega, 'Murderous Morrígan'
Post Reply