|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.gjt.universe.accrete.AccreteObject | +--org.gjt.universe.accrete.Blackbody | +--org.gjt.universe.accrete.Planet
This class provides an object representing a planetary body, complete with atmosphere. Two separate sets of methods are provided. The first set is empirical, usually simplistic, and built for use in various games I was experimenting with at the time. The second set is based more on physics, using calculations presented in journals such as Icarus.
Copyright information
This Java class is copyright 1998 by Carl Burke. All rights reserved. Substantial sections of this code were previously distributed in different form as part of 'starform' (copyright 1989 Matthew Burdick)
This software is provided absolutely free and without warranty, including but not limited to the implied warranties of merchantability and fitness for a purpose. You may use this code for any legal purpose provided that you do not charge for it; this implies that you may use this code as a component of a commercial system as long as the additional functionality of the commercial system is greater than what this code provides and that the commercial system is not primarily intended as a simulation of solar system formation. In other words, if you want to write a science-fiction computer game that uses the code in this package to build objects which are used in the game, that's great and permitted; if you use this code to make a kickass solar-system-builder, you are not allowed to distribute that software except for free.
You are allowed and encouraged to modify this software, provided that this copyright notice remains intact. This notice may be reformatted, but not removed.
If you do use this software, I and the contributing authors listed under "Acknowledgements" would appreciate some recognition. If you make changes, I would appreciate it if you would pass those changes back to me for possible inclusion in the master. At the time this notice was prepared, my email address is cburke@mitre.org and the home page for this software is http://www.geocities.com/Area51/6902/w_accr.html.
Matt Burdick, the author of 'starform' (freeware copyright 1989); much of the code (particularly planetary environments) was adapted from this.
Andrew Folkins, the author of 'accretion' (public domain) for the Amiga; I used chunks of his code when creating my displays.
Ed Taychert of Irony Games, for the algorithm he uses to classify terrestrial planets in his tabular CGI implementation of 'starform'.
Paul Schlyter, who provided information about computing planetary positions.
Field Summary | |
double |
a
|
double |
age
|
double |
airless_ice_factor
|
double |
airless_rock_factor
|
double |
albedo
|
double |
avg_temp
|
int |
axial_tilt
|
double |
boil_point
|
protected static int |
CHAOTIC_ITERATIONS
|
double |
cloud_cover
|
double |
cloud_factor
|
double |
day
|
double |
density
|
double |
e
|
double |
esc_velocity
|
Planet |
first_moon
|
boolean |
gas_giant
|
double |
GCO2
|
double |
GH2
|
double |
GH2O
|
double |
GN2
|
double |
GO2
|
boolean |
greenhouse_effect
|
double |
hydrosphere
|
double |
ice_cover
|
double |
ice_factor
|
int |
its
|
double |
mass
|
double |
max_temp
|
double |
min_temp
|
double |
molec_weight
|
Planet |
next_planet
|
double |
orb_period
|
int |
orbit_zone
|
char |
plan_class
|
double |
r_ecosphere
|
double |
radius
|
double |
resonance
|
int |
resonant_period
|
double |
rms_velocity
|
double |
rock_factor
|
double |
stell_mass_ratio
|
double |
surf_accel
|
double |
surf_grav
|
double |
surf_pressure
|
double |
surf_temp
|
boolean |
temp_unstable
|
double |
volatile_gas_inventory
|
double |
water_factor
|
double |
where_in_orbit
|
Fields inherited from class org.gjt.universe.accrete.Blackbody |
SIGMA, TEMP |
Fields inherited from class org.gjt.universe.accrete.AccreteObject |
cr |
Constructor Summary | |
Planet(double AuDist,
double EM,
double SM)
Simplistic constructor, intended for use with Bode's Law routines |
|
Planet(Protoplanet p)
Constructor from an accreted protoplanet. |
Method Summary | |
double |
acceleration(double mass,
double radius)
Calculates the surface acceleration of a Planet. |
double |
boiling_point()
Calculates the boiling point of water in this planet's atmosphere, stored in millibars. |
char |
classify_by_accretion()
Generates a rough-and-ready calculation into Terrestrial and Gas Giant categories based on whether the protoplanet accreted gas. |
char |
classify_by_temperature()
Generates a rough-and-ready calculation into Terrestrial and Gas Giant categories based on temperature. |
double |
cloud_fraction()
Given the surface temperature of a Planet (in Kelvin), this function returns the fraction of cloud cover available. |
private void |
computeAtmosphere()
|
double |
day_length(double mass,
double radius,
double eccentricity,
double density,
double orb_radius,
double orb_period,
boolean giant)
Estimates length of the planet's day. |
double |
density_by_temperature(char PLAN_CLASS)
Estimates planetary density by planetary class, randomly distributed around central values. |
double |
eff_temp(double ecosphere_radius)
Calculates effective temperature of the planet, based on semi-major axis, albedo, and provided ecosphere radius. |
double |
empirical_density(double mass,
double orb_radius,
boolean gas_giant)
Empirically determine density based on distance from primary. |
double |
escape_vel(double mass,
double radius)
This function implements the escape velocity calculation. |
double |
farthest_moon()
Calculates distance to farthest moon, if any. |
double |
gas_retention(double WT,
double TEMP,
double MASS,
double RAD)
Calculates the approximate ratio (from none to all) of a gas which is retained in the atmosphere of this planet. |
double |
gravity(double acceleration)
Calculates the surface gravity of the planet. |
double |
green_rise(double optical_depth,
double effective_temp)
Calculates the rise in temperature due to greenhouse effect. |
boolean |
grnhouse(int zone,
double orb_radius,
double r_greenhouse)
Determines if the planet suffers from runaway greenhouse effect. |
double |
hydro_fraction()
Calculates the fraction of planet surface covered by water. |
double |
ice_fraction()
Given the surface temperature of a Planet (in Kelvin), this function returns the fraction of the Planet's surface covered by ice. |
int |
inclination(double orb_radius)
Estimates planetary inclination (axial tilt). |
void |
iterate_surface_temp()
Iteratively calculates the temperature of the atmosphere. |
double |
kothari_radius(double mass,
boolean giant,
int zone)
Calculates the equatorial radius of the planet given mass, 'zone', and whether it's a gas giant or not. |
double |
mass_by_integration(double MASS,
double DIST,
char PLAN_CLASS)
Determines planetary mass through a quick 'accretion' of mass within a portion of a disc. |
double |
molecule_limit(double mass,
double equat_radius)
Calculates the smallest molecular weight retained by the body, which is useful for determining the atmosphere composition. |
double |
nearest_moon()
Calculates distance to closest moon, if any. |
double |
new_planet_albedo()
Calculates the albedo of the planet, which is the fraction of light reflected rather than absorbed. |
double |
opacity()
This function returns the dimensionless quantity of optical depth, which is useful in determining the amount of greenhouse effect on a Planet. |
double |
period(double separation,
double small_mass,
double large_mass)
Calculates orbital period (year) of the two bodies. |
double |
PESCAPE(double MASS,
double RADIUS)
Calculates 'escape energy'. |
double |
planet_albedo()
Calculates the albedo of the planet, which is the fraction of light reflected rather than absorbed. |
double |
planet_radius(double MASS,
double DENSITY,
char PLAN_CLASS)
Returns radius of the planet in kilometers. |
double |
planet_temperature(double DIST,
double LUM)
Estimates blackbody temperature of a planet. |
double |
pressure(double equat_radius,
double gravity)
Calculates surface pressure on this planet. |
double |
rms_vel(double molecular_weight,
double orb_radius)
Calculates Root Mean Square (RMS) velocity of a molecule or atom. |
void |
set_vital_stats(double smr,
double r_gr,
double r_ec,
double age)
Calculates planetary characteristics. |
double |
surface_gravity(double MASS,
double RAD)
Calculates surface gravity in cm/sec^2 |
double |
vol_inventory(double mass,
double escape_vel,
double rms_vel,
double stellar_mass,
int zone,
boolean greenhouse_effect)
Calculates the unitless 'volatile gas inventory'. |
double |
volume_density(double mass,
double equat_radius)
Calculates average density of body, given mass and radius. |
double |
volume_radius(double mass,
double density)
Calculates radius based on volume, calibrated to Earth. |
Methods inherited from class org.gjt.universe.accrete.Blackbody |
E, EMIT, IREMIT, UVEMIT, VISEMIT |
Methods inherited from class org.gjt.universe.accrete.AccreteObject |
about, LognormalDeviate, nextDouble, NormalDeviate, random_eccentricity, random_number |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public double a
public double e
public double where_in_orbit
public double mass
public boolean gas_giant
public int orbit_zone
public double radius
public double density
public double orb_period
public double day
public int resonant_period
public int axial_tilt
public double esc_velocity
public double surf_accel
public double surf_grav
public double rms_velocity
public double molec_weight
public double volatile_gas_inventory
public double GH2
public double GH2O
public double GN2
public double GO2
public double GCO2
public double surf_pressure
public boolean greenhouse_effect
public double boil_point
public double albedo
public double surf_temp
public double min_temp
public double max_temp
public double avg_temp
public double hydrosphere
public double cloud_cover
public double ice_cover
public char plan_class
public Planet next_planet
public Planet first_moon
public double r_ecosphere
public double resonance
public double stell_mass_ratio
public double age
public double cloud_factor
public double water_factor
public double rock_factor
public double airless_rock_factor
public double ice_factor
public double airless_ice_factor
public int its
public boolean temp_unstable
protected static final int CHAOTIC_ITERATIONS
Constructor Detail |
public Planet(double AuDist, double EM, double SM)
AuDist
- Semi-major axis of orbit in AUEM
- Emission of the star relative to SolSM
- Stellar mass relative to Solpublic Planet(Protoplanet p)
p
- Protoplanet that forms the basis of this planetMethod Detail |
public final char classify_by_temperature()
public final char classify_by_accretion()
public final double mass_by_integration(double MASS, double DIST, char PLAN_CLASS)
MASS
- Mass of primary in Solar massesDIST
- Semi-major axis of orbit in AUPLAN_CLASS
- 'T' or 'G' denoting 'class' of planetpublic final double density_by_temperature(char PLAN_CLASS)
PLAN_CLASS
- 'T' for Terrestrial, 'G' for Gas Giantpublic final double planet_radius(double MASS, double DENSITY, char PLAN_CLASS)
MASS
- Mass in Earth massesDENSITY
- Average density in grams per cubic centimeterPLAN_CLASS
- 'T' for Terrestrial, 'G' for Gas Giantpublic final double surface_gravity(double MASS, double RAD)
MASS
- Mass in Earth massesRAD
- Radius in kilometerspublic final double PESCAPE(double MASS, double RADIUS)
MASS
- Mass in Earth massesRADIUS
- Radius in kilometerspublic final double planet_temperature(double DIST, double LUM)
DIST
- Semi-major axis of orbit in AULUM
- Luminosity of primary (relative to Sol???)public final double gas_retention(double WT, double TEMP, double MASS, double RAD)
WT
- Molecular weight of gas in questionTEMP
- Blackbody temperatureMASS
- Mass in Earth massesRAD
- Radius in centimetersprivate void computeAtmosphere()
public final double volume_radius(double mass, double density)
mass
- Mass in Earth massesdensity
- Average density in grams per cubic centimeterpublic final double kothari_radius(double mass, boolean giant, int zone)
mass
- Mass in Earth massesgiant
- True if planet is a gas giantzone
- Orbital zone, 1 to 3public final double empirical_density(double mass, double orb_radius, boolean gas_giant)
mass
- Mass in Earth massesorb_radius
- Semi-major axis of orbit in AUgas_giant
- True if planet is a gas giantpublic final double volume_density(double mass, double equat_radius)
mass
- Mass in Earth masses.equat_radius
- Equatorial radius in kilometers.public final double period(double separation, double small_mass, double large_mass)
separation
- Distance in AU between bodiessmall_mass
- Mass of smaller body in Solar masseslarge_mass
- Mass of larger body in Solar massespublic final double day_length(double mass, double radius, double eccentricity, double density, double orb_radius, double orb_period, boolean giant)
mass
- Mass in Earth masses.radius
- Equatorial radius in kilometers.eccentricity
- Eccentricity of orbitdensity
- Average planetary density in grams per cubic
centimeterorb_radius
- Semi-major axis of orbit in AUorb_period
- Orbital period (year) in Earth days. (???)giant
- True if this planet is a gas giantpublic final int inclination(double orb_radius)
orb_radius
- Semi-major axis of orbit in AUpublic final double escape_vel(double mass, double radius)
mass
- Mass in Earth masses.radius
- Radius in kilometers.public final double rms_vel(double molecular_weight, double orb_radius)
molecular_weight
- The molecular weight (usually assumed to be
N2) of the molecule or atom in question.orb_radius
- Semi-major axis of orbit in AUpublic final double molecule_limit(double mass, double equat_radius)
mass
- Planetary mass in Earth masses.equat_radius
- Equatorial radius in kilometers.public final double acceleration(double mass, double radius)
mass
- Planetary mass in Earth masses.radius
- Equatorial radius in kilometers.public final double gravity(double acceleration)
acceleration
- Surface gravity in cm/sec^2public final boolean grnhouse(int zone, double orb_radius, double r_greenhouse)
zone
- Orbital 'zone'.orb_radius
- Semi-major axis of orbit, in AUr_greenhouse
- 'Greenhouse effect' radius in AUpublic final double vol_inventory(double mass, double escape_vel, double rms_vel, double stellar_mass, int zone, boolean greenhouse_effect)
mass
- Planetary mass in Earth masses.escape_vel
- Escape velocity in kilometers/second.rms_vel
- Average velocity at molecules at top of atmosphere.stellar_mass
- Stellar mass ration in Solar masses.zone
- Orbital 'zone', between 1 and 3.greenhouse_effect
- True if planet has runaway greenhouse
effect.public final double pressure(double equat_radius, double gravity)
equat_radius
- Equatorial radius in kilometers.gravity
- Surface gravity in units of Earth gravities.public final double boiling_point()
public final double hydro_fraction()
public final double cloud_fraction()
public final double ice_fraction()
public final double eff_temp(double ecosphere_radius)
ecosphere_radius
- Radius of ecosphere in AUpublic final double green_rise(double optical_depth, double effective_temp)
effective_temp
- Temperature in Kelvin of a blackbody herepublic final double planet_albedo()
public final double new_planet_albedo()
public final double opacity()
public final void iterate_surface_temp()
It may be desirable to iteratively calculate the volatiles inventory as well, to simulate atmospheric evolution; doing this correctly is beyond what I [Carl] feel comfortable with.
public final void set_vital_stats(double smr, double r_gr, double r_ec, double age)
smr
- Stellar mass ratio (in Solar masses)r_gr
- Greenhouse radius (in AU)r_ec
- Ecosphere radius (in AU)age
- Age of star (in gigayears)public final double nearest_moon()
public final double farthest_moon()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |