homepage

Using this model I have made a computer program in C that models the annual average
temperature of any planet for any star. Here is the program incase you want to compile it and
run it. I will give some sample runnings of it.!
bioplanet.c
#include<stdio.h>
#include<math.h>
int main(void)
{
float s, a, l, b, r, AU, N, root, number, answer, C, F;
printf("We determine the surface temperature of a planet.\n");
printf("What is the luminosity of the star in solar luminosities? ");
scanf("%f", &s);
printf("What is the albedo of the planet (0-1)?" );
scanf("%f", &a);
printf("What is the distance from the star in AU? ");
scanf("%f", &AU);
r=1.5E11*AU;
l=3.9E26*s;
b=l/(4*3.141*r*r);
N=(1-a)*b/(4*(5.67E-8));
root=sqrt(N);
number=sqrt(root);
answer=1.189*(number);
printf("\n");
printf("\n");
printf("The surface temperature of the planet is: %f K\n", answer);
C=answer-273;
F=(C*1.8)+32;
printf("That is %f C, or %f F", C, F);
printf("\n");
float joules;
joules=(3.9E26*s);
printf("The luminosity of the star in joules per second is: %.
2fE25\n", joules/1E25);
float HZ;
HZ=sqrt(joules/3.9E26);
printf("The habitable zone of the star in AU is: %f\n", HZ);
printf("Flux at planet is %.2f times that at earth.\n", b/1370);
printf("That is %.2f Watts per square meter\n", b);
printf("\n");
printf("\n");
}
Here we run it for the earth and sun to test it:
Here we use a single atomospheric layer with no
convection for the planet to be in an equilibrium
state. That is to say, the temperature stays
steady by heat gain and loss with radiative
heat transfer alone.
The habitable zone is calculated using the idea
that the earth is in the habitable zone for a
star like the Sun. That is, if a star is 100
times brighter than the Sun, then the habitable
zone for that star is ten times further from
it than the Earth is from the Sun because ten
squared is 100
We determine the surface temperature of a planet.
What is the luminosity of the star in solar luminosities? 1
What is the albedo of the planet (0-1)?0.3
What is the distance from the star in AU? 1
The surface temperature of the planet is: 303.727509 K
That is 30.727509 C, or 87.309517 F
The luminosity of the star in joules per second is: 39.00E25
The habitable zone of the star in AU is: 1.000000
Flux at planet is 1.01 times that at earth.
That is 1379.60 Watts per square meter
Now we run it for Mars and the sun:
We determine the surface temperature of a planet.
What is the luminosity of the star in solar luminosities? 1
What is the albedo of the planet (0-1)?0.15
What is the distance from the star in AU? 1.5
The surface temperature of the planet is: 260.326691 K
That is -12.673309 C, or 9.188044 F
The luminosity of the star in joules per second is: 39.00E25
The habitable zone of the star in AU is: 1.000000
Flux at planet is 0.45 times that at earth.
That is 613.16 Watts per square meter
Let’s run for a star other than the Sun:
We determine the surface temperature of a planet.
What is the luminosity of the star in solar luminosities? 2
What is the albedo of the planet (0-1)?0.5
What is the distance from the star in AU? 2.0
The surface temperature of the planet is: 234.798126 K
That is -38.201874 C, or -36.763374 F
The luminosity of the star in joules per second is: 78.00E25
The habitable zone of the star in AU is: 1.414214
Flux at planet is 0.50 times that at earth.
That is 689.80 Watts per square meter
Hello, World!
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
[Process completed]
Click here to go to the homepage: https://eanbardsley.github.io/source/index.html