Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

What parameters are necessary to generate a plausible star in line with a spectral classification?

+0
−0

I'm in the opening stages of writing (yet another) star system generator, using Python. My goal is to be able to generate a plausible star and, if appropriate, planetary system around it - allowing for classic systems like are own but also for hot jovians and any thing else that pops up.

The approach I'm considering using is to generate a spectral type and then look up acceptable ranges for key parameters to generate a plausible star of that type before calculating the remaining parameters.

After some experimentation, it appears that mass alone is not enough but I'm not sure what would be better - mass and radius? Mass and luminosity?

In particular, I'm having issues differentiating the values for the different luminosity classes (it should be trivial to separate a hyper-giant from a giant!)

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

This post was sourced from https://worldbuilding.stackexchange.com/q/84456. It is licensed under CC BY-SA 3.0.

0 comment threads

1 answer

+0
−0

The spectral type of a star tells you, in general, its surface temperature. Unfortunately, there's one main issue here. Each spectral type can give way to a range of luminosities and properties (see any Hertzsprung"“Russell diagram). This can be rectified if you just want to create a star as it enters the main sequence, in which case there is a rough one-to-one relationship between temperature and luminosity.

The mass of a main sequence star determines the rest of its properties. From it, you can calculate luminosity: $$\frac{L}{L_\odot}\simeq\left(\frac{M}{M_\odot}\right)^{\alpha}\tag{1}$$ where $\alpha$ ranges from $3$ to $4$ - the exponent is different over different mass ranges. Averaged over the entire range of main sequence masses, this generally works. We can do something similar for the radius of the star: $$\frac{R}{R_\odot}\simeq\left(\frac{M}{M_\odot}\right)^{\beta}\tag{2}$$ where $\beta$ is a little less than $1$ - maybe $0.8\text{-}0.9$.

We can then try to approximation the surface temperature using the Stefan Boltzmann law: $$L=4\pi\sigma R^2T^4\tag{3}$$ All we have to do is solve for $T$, but remember. In your case, it seems like we may want to plug $\text{(1)}$ and $\text{(2)}$ into $\text{(3)}$ after converting the radius and luminosity to SI units, giving temperature as a function of mass. Then, you can simply put in a temperature for a given spectral type and estimate the mass, then back-substitute to find the radius and luminosity (and other properties).

I'll just add that these are only approximations, although they work pretty well. I'd certainly be comfortable using them. I did go into more detail on the subject in another answer, but honestly, these equations are fine.

An even better way to get exact parameters would be to use pre-existing stellar models. Many astronomers have modeled stars and stellar evolutionary tracks, and the resulting models may be available online. I sometimes cite the Geneva grids as an example, and the MESA code as an evolutionary code that you can run yourself.

The great thing about all of these is that you can determine all the parameters by varying the mass of a star and its composition (see the Vogt-Russell theorem). Pick a mass that corresponds to your spectral type, and you should be able to get detailed results fairly easily. I've taken to doing this lately for some of my answers on Worldbuilding. Numerical models are often much better than approximations, and often, someone has already done the work of generating them!

Additional references:

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

0 comment threads

Sign up to answer this question »