Modifying StarGen
- omega13a
- Posts: 120
- Joined: 15.10.2011
- Age: 40
- With us: 13 years 1 month
- Location: California
- Contact:
Re: Modifying StarGen
Okay. I forgot to mention, I'm still working on my StarGen re-write. I decided to rename it SolarGen because of the changes I'm making to the source code. Things are a bit more object oriented. I don't have anything that is 'useable' right now. All I have at this point is something that displays the stars that are in the Sol Station catalog. Hopefully that will change soon.
Re: Modifying StarGen
Here's an update of moon_orbits (v1.19)
Changes since v1.08:
c 1.09 randomize sma of moon "better"
c 1.10 randomize initial mass available
c 1.11 add atmosphere for large moons
c 1.12 note "Earthlike?" for moons >0.75 Earth masses
c 1.13 more code cleanup
c 1.14 use color
c 1.15 make version variable
c 1.16 limit max planet radius: hill radius calcs fail
c 1.17 display planetary type
c 1.18 add rocky planet radius guesstimate
c 1.19 specify appropriate texture for test planet
Changes since v1.08:
c 1.09 randomize sma of moon "better"
c 1.10 randomize initial mass available
c 1.11 add atmosphere for large moons
c 1.12 note "Earthlike?" for moons >0.75 Earth masses
c 1.13 more code cleanup
c 1.14 use color
c 1.15 make version variable
c 1.16 limit max planet radius: hill radius calcs fail
c 1.17 display planetary type
c 1.18 add rocky planet radius guesstimate
c 1.19 specify appropriate texture for test planet
Selden
- omega13a
- Posts: 120
- Joined: 15.10.2011
- Age: 40
- With us: 13 years 1 month
- Location: California
- Contact:
Re: Modifying StarGen
Possible Bug:
Running this command:
gives me this result:
A rocky planet that is 38 Earth Masses? I think the cut off point for a rocky planet should be 10 earth masses which is the cut off point in the mass based classification system. Also, the moons are still forming too far out in my opinion. Epessally the large round moons around gas giants.
Running this command:
Code: Select all
moon_orbits -a 31.2801 -m 38.3735 -M 0.9800 -n p10 -N 43 -s 575204 -S DEL Pa
gives me this result:
Code: Select all
moon_orbits v1.19
Planet name = p10
Planet mass = 38.3735
Planet SMA = 31.2801
Star name = DEL_Pav
Star mass = 0.9800
Random seed = 575204
Number of Moons = 43
File name (-F) not specified, using DEL_Pav_p10
This planet is rocky.
Radius = 35360.106117342533 km = 0.49460227881920399 x Jup.
Available mass exhausted
after generating 14 moons.
Mass distribution: 11 1 1 0 1 0 0 0 0 0 0 0
Done: 14 moons in Moons_DEL_Pav_p10.ssc
===================================
A rocky planet that is 38 Earth Masses? I think the cut off point for a rocky planet should be 10 earth masses which is the cut off point in the mass based classification system. Also, the moons are still forming too far out in my opinion. Epessally the large round moons around gas giants.
Re: Modifying StarGen
Moon_orbits uses the planetary mass/type/radius graph which is figure 4 in
Giant Planet Interior Structure and Thermal Evolution by Fortney et al. (2009)
http://arxiv.org/abs/0911.3154
There's a considerable overlap between rocky and gas-giant planets. There can be rocky planets with masses as great as that of Jupiter (317x Earth masses).
Giant Planet Interior Structure and Thermal Evolution by Fortney et al. (2009)
http://arxiv.org/abs/0911.3154
There's a considerable overlap between rocky and gas-giant planets. There can be rocky planets with masses as great as that of Jupiter (317x Earth masses).
Selden
- omega13a
- Posts: 120
- Joined: 15.10.2011
- Age: 40
- With us: 13 years 1 month
- Location: California
- Contact:
Re: Modifying StarGen
Well, at 31 AU, I think it would be safe to say anything that big is a gas planet. In the 'hot zone', ecosphere and the inner part of the 'cold zone', it would be more realistic being called rocky.
Re: Modifying StarGen
My impression is that the various planetary search programs have discovered that what we used to think was "obvious" about how planetary systems should be organized was biased far too much by what we see in our own solar system. While systems might start out with gas giants in the outer reaches of the protoplanetary nebula and rocky planets in the inner orbits, the initial orbital parameters are sufficiently chaotic that the planets can be anywhere by the time their orbits have stabilized.
At any rate, the planetary type generated by moon_orbits has no effect on the moon orbits that the program generates. The program isn't that sophisticated. Maybe the next major version will do something more. In the current version, though, the planetary type is only relevant to Celestia if you have moon_orbits include TestPlanet in the SSC that it's writing. Normally, however, one would define the planet's SSC entry external to moon_orbits.
At any rate, the planetary type generated by moon_orbits has no effect on the moon orbits that the program generates. The program isn't that sophisticated. Maybe the next major version will do something more. In the current version, though, the planetary type is only relevant to Celestia if you have moon_orbits include TestPlanet in the SSC that it's writing. Normally, however, one would define the planet's SSC entry external to moon_orbits.
Selden
- PlutonianEmpire
- Posts: 1374
- Joined: 09.09.2004
- Age: 40
- With us: 20 years 2 months
- Location: MinneSNOWta
- Contact:
Re: Modifying StarGen
Would it be possible to condense all of the installation and usage information for this project (and the required utilities needed to run it) into a single post, so it can be easily found, linked to, and understood?
Terraformed Pluto: Now with New Horizons maps! :D
- omega13a
- Posts: 120
- Joined: 15.10.2011
- Age: 40
- With us: 13 years 1 month
- Location: California
- Contact:
Re: Modifying StarGen
I've read wikipedia's entry for Sudarsky's extrasolar planet classification and noticed that the expected albedos for the different classes of gas planets are different. I'm going to see if I can find some way to work that into stargen as well as into my solargen.
- omega13a
- Posts: 120
- Joined: 15.10.2011
- Age: 40
- With us: 13 years 1 month
- Location: California
- Contact:
Re: Modifying StarGen
I was able to get it to work. You need to have it adust the planet's albedo and estimated temperature in a while loop. Please note that this does not adjust the albedo for gas dwarfs smaller than 1 earth mass.
In const.h you add:
In stargen.c find:
and replace it with:
In const.h you add:
Code: Select all
#define CLASS_I_ALBEDO (0.57)
#define CLASS_II_ALBEDO (0.81)
#define CLASS_III_ALBEDO (0.12)
#define CLASS_IV_ALBEDO (0.03)
#define CLASS_V_ALBEDO (0.55)
In stargen.c find:
Code: Select all
if ((planet->type == tGasGiant)
|| (planet->type == tBrownDwarf) //seb
|| (planet->type == tSubGasGiant)
|| (planet->type == tSubSubGasGiant))
{
planet->greenhouse_effect = FALSE;
planet->volatile_gas_inventory = INCREDIBLY_LARGE_NUMBER;
planet->surf_pressure = INCREDIBLY_LARGE_NUMBER;
planet->boil_point = INCREDIBLY_LARGE_NUMBER;
//seb need temp for surface texture (compare to est.temp)
// planet->surf_temp = INCREDIBLY_LARGE_NUMBER;
planet->greenhs_rise = 0;
planet->albedo = about(GAS_GIANT_ALBEDO,0.1);
planet->hydrosphere = 1.0;
planet->cloud_cover = 1.0;
planet->ice_cover = 0.0;
planet->surf_grav = gravity(planet->surf_accel);
planet->molec_weight = min_molec_weight(planet);
planet->estimated_temp = est_temp(sun->r_ecosphere, planet->a, planet->albedo);
planet->estimated_terr_temp = est_temp(sun->r_ecosphere, planet->a, EARTH_ALBEDO);
{
long double temp = planet->estimated_terr_temp;
if ((temp >= FREEZING_POINT_OF_WATER)
&& (temp <= EARTH_AVERAGE_KELVIN + 10.)
&& (sun->age > 2.0E9))
{
habitable_jovians++;
if (flag_verbose & 0x8000)
{
fprintf (stderr, "%s\t%s (%4.2LfEM %5.3Lf By)%s with earth-like temperature (%.1Lf C, %.1Lf F, %+.1Lf C Earth).\n",
planet_id,
planet->type == tBrownDwarf ? "Brown Dwarf" : //seb
planet->type == tGasGiant ? "Jovian" :
planet->type == tSubGasGiant ? "Sub-Jovian" :
planet->type == tSubSubGasGiant ? "Gas Dwarf" :
"Big",
planet->mass * SUN_MASS_IN_EARTH_MASSES,
sun->age /1.0E9,
planet->first_moon == NULL ? "" : " WITH MOON",
temp - FREEZING_POINT_OF_WATER,
32 + ((temp - FREEZING_POINT_OF_WATER) * 1.8),
temp - EARTH_AVERAGE_KELVIN);
}
}
}
}
and replace it with:
Code: Select all
if ((planet->type == tGasGiant)
|| (planet->type == tBrownDwarf) //seb
|| (planet->type == tSubGasGiant)
|| (planet->type == tSubSubGasGiant))
{
planet->greenhouse_effect = FALSE;
planet->volatile_gas_inventory = INCREDIBLY_LARGE_NUMBER;
planet->surf_pressure = INCREDIBLY_LARGE_NUMBER;
planet->boil_point = INCREDIBLY_LARGE_NUMBER;
//seb need temp for surface texture (compare to est.temp)
// planet->surf_temp = INCREDIBLY_LARGE_NUMBER;
planet->greenhs_rise = 0;
planet->albedo = about(GAS_GIANT_ALBEDO,0.1);
planet->hydrosphere = 1.0;
planet->cloud_cover = 1.0;
planet->ice_cover = 0.0;
planet->surf_grav = gravity(planet->surf_accel);
planet->molec_weight = min_molec_weight(planet);
//planet->estimated_temp = est_temp(sun->r_ecosphere, planet->a, planet->albedo);
long double temp1, temp2, new_albedo;
temp1 = est_temp(sun->r_ecosphere, planet->a, planet->albedo);
while (TRUE)
{
if (temp1 > 1400)
new_albedo = about(CLASS_V_ALBEDO, 0.1);
else if (temp1 > 900)
new_albedo = about(CLASS_IV_ALBEDO, 0.1);
else if (temp1 > 350)
new_albedo = about(CLASS_III_ALBEDO, 0.1);
else if (temp1 > 150)
new_albedo = about(CLASS_II_ALBEDO, 0.1);
else
new_albedo = about(CLASS_I_ALBEDO, 0.1);
planet->albedo = (new_albedo + (planet->albedo * 2)) / 3;
temp2 = est_temp(sun->r_ecosphere, planet->a, planet->albedo);
temp1 = (temp2 + (temp1 * 2)) / 3;
if ((temp1 - temp2) < 0.25)
break;
}
planet->estimated_temp = temp1;
planet->estimated_terr_temp = est_temp(sun->r_ecosphere, planet->a, EARTH_ALBEDO);
{
long double temp = planet->estimated_terr_temp;
if ((temp >= FREEZING_POINT_OF_WATER)
&& (temp <= EARTH_AVERAGE_KELVIN + 10.)
&& (sun->age > 2.0E9))
{
habitable_jovians++;
if (flag_verbose & 0x8000)
{
fprintf (stderr, "%s\t%s (%4.2LfEM %5.3Lf By)%s with earth-like temperature (%.1Lf C, %.1Lf F, %+.1Lf C Earth).\n",
planet_id,
planet->type == tBrownDwarf ? "Brown Dwarf" : //seb
planet->type == tGasGiant ? "Jovian" :
planet->type == tSubGasGiant ? "Sub-Jovian" :
planet->type == tSubSubGasGiant ? "Gas Dwarf" :
"Big",
planet->mass * SUN_MASS_IN_EARTH_MASSES,
sun->age /1.0E9,
planet->first_moon == NULL ? "" : " WITH MOON",
temp - FREEZING_POINT_OF_WATER,
32 + ((temp - FREEZING_POINT_OF_WATER) * 1.8),
temp - EARTH_AVERAGE_KELVIN);
}
}
}
}
- omega13a
- Posts: 120
- Joined: 15.10.2011
- Age: 40
- With us: 13 years 1 month
- Location: California
- Contact:
Re: Modifying StarGen
I discovered by accident that you shouldn't take the density for jovians and brown dwarfs in the modified stargen seriously. It can be way off. The reason why is because it adjusts their radius based on their mass but doesn't adjust their density afterwards. To correct this change:
to:
The densities should be a lot more realistic.
Code: Select all
//seb: recalculate planet radius for largest categories
// formulae taken from Fig 4 in Fortney et al. (2009)
// Rjup = 71492.0 km
tmp = (planet->mass * SUN_MASS_IN_EARTH_MASSES)/317.82; // mass as frac of Mj
if ( ((planet->type == tGasGiant)
|| (planet->type == tBrownDwarf))
&& (tmp >0.22)
)
{ if (tmp < 1.65) { planet->radius = ( pow(tmp,0.1)*71492.0); } // planet
else if (tmp < 6.04) { planet->radius = ( pow(tmp,-0.125)*71492.0); } // brown dwarf
else { planet->radius = ( 0.799*71492.0 + (tmp-6.04)*71492.0); } // star
}
to:
Code: Select all
//seb: recalculate planet radius for largest categories
// formulae taken from Fig 4 in Fortney et al. (2009)
// Rjup = 71492.0 km
tmp = (planet->mass * SUN_MASS_IN_EARTH_MASSES)/317.82; // mass as frac of Mj
if ( ((planet->type == tGasGiant)
|| (planet->type == tBrownDwarf))
&& (tmp >0.22)
)
{ if (tmp < 1.65) { planet->radius = ( pow(tmp,0.1)*71492.0); } // planet
else if (tmp < 6.04) { planet->radius = ( pow(tmp,-0.125)*71492.0); } // brown dwarf
else { planet->radius = ( 0.799*71492.0 + (tmp-6.04)*71492.0); } // star
planet->density = volume_density(planet->mass,planet->radius);
}
The densities should be a lot more realistic.
- omega13a
- Posts: 120
- Joined: 15.10.2011
- Age: 40
- With us: 13 years 1 month
- Location: California
- Contact:
Re: Modifying StarGen
I didn't notice the density problem until the day before yesterday when I generated a solar system with a rather large brown dwarf that stargen said was about 1/100th the mass and twice as dense as my estimate of its star despite it having a radius greater than that of its star. Kind of a physical impossibility. Took me hours to find where the problem was because I kept not only looking in the wrong parts of the code, but in the wrong file. Must be get senile.