<p>You could plot <span class="math-container">$L$</span> vs <span class="math-container">$T$</span> and compare your model result to the measured/estimated <span class="math-container">$L$</span> and <span class="math-container">$T$</span> of main sequence stars?  </p>

<p>You have not explained or labelled what your diagram is, but it isn't <span class="math-container">$L$</span> versus <span class="math-container">$T$</span>; I suspect that it absolute <span class="math-container">$V$</span> magnitude versus <span class="math-container">$B-V$</span> colour.</p>

<p>The transformations between <span class="math-container">$L,T$</span> and <span class="math-container">$V$</span>, <span class="math-container">$B-V$</span> are highly non-linear, especially at low temperatures (which is why your plot fails to reproduce the M-dwarfs) and involve folding a model atmosphere through some standard filter responses or using relationships between <span class="math-container">$T$</span> and <span class="math-container">$B-V$</span> and bolometric corrections and <span class="math-container">$T$</span>. (e.g. <a href="http://www.pas.rochester.edu/~emamajek/EEM_dwarf_UBVIJHK_colors_Teff.txt" rel="nofollow noreferrer">Mamajek 2019</a>)</p>

<p>EDIT: For the clarified question.</p>

<p>Your relationship for <span class="math-container">$T$</span> vs <span class="math-container">$B-V$</span> is not applicable at lower temperatures.</p>

<p>Your relationship between absolute magnitude and luminosity takes no account of the spectral energy distribution of the light from the star (i.e. it assumes the same <a href="https://en.wikipedia.org/wiki/Bolometric_correction" rel="nofollow noreferrer">bolometric correction</a> for all temperatures, which isn't correct). You must calculate the <em>bolometric</em> magnitude from the luminosity and then apply a temperature-dependent bolometric correction to calculate a V-band magnitude.</p>

<p>The solution is to construct relationships that are valid over the full range of temperatures using the resource I referenced above.</p>

CC BY-SA 4.0
2019-10-10T16:50:50.947Z
2019-10-10T22:47:16.320Z
2019-10-10T22:47:16.320Z
ProfRob
<p>(See updated figure and description below.)</p>

<p>I've been trying to generate ballpark estimates for the radius, temperature and luminosity of stars in the main sequence based solely on their masses (assuming the same composition for all stars).  The idea is to iterate through masses in steps of, say, 0.1 solar masses from 0.1 to 100, and roughly trace out the curve of the main sequence on an HR diagram.</p>

<p>For luminosity, I'm using something like this:</p>

<pre><code>  if ( mass &lt; 0.43 ) {
    L = 0.23*L_sun*pow(mass/M_sun,2.3);
  } else if ( mass &lt; 2 ) {
    L = L_sun*pow(mass/M_sun,4);
  } else if ( mass &lt; 55 ) {
    L = 1.4*L_sun*pow(mass/M_sun,3.5);
  } else {
    L = 32000*L_sun*mass/M_sun;
  }
</code></pre>

<p>For radius, I'm using something like this:</p>

<pre><code>  if ( mass &lt; 1 ) {
    R = R_sun*pow(mass/M_sun,0.57);
  } else {
    R = R_sun*pow(mass/M_sun,0.78);
  }
</code></pre>

<p>And, using these, I'm calculating the temperature from the luminosity-radius-temperature relation like this:</p>

<pre><code>T = pow(L/(4.0*M_PI*R*R*sigma), 0.25);
</code></pre>

<p>where sigma is just the Stefan-Boltzmann constant.</p>

<p>All of this works about as well as I'd expect for stars of 1 solar mass or above, but breaks down completely for M dwarfs, as you can see from the attached image which shows my meager effort superimposed on HYG data.
<a href="https://i.sstatic.net/rEDes.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/rEDes.png" alt="Estimated absolute magnitude versus B-V, superimposed on actual data."></a></p>

<p>Note that I'm plotting B-V here, calculated from temperature like this:</p>

<pre><code>BV = pow(5601.0/T,1.5) - 0.4;
</code></pre>

<p>and absolute magnitude, calculated from luminosity like this:</p>

<pre><code>magnitude = -2.5*log(L)/log(10) + 71.1974;
</code></pre>

<p>What can I do to improve this a little?  I'll add that this is aimed at being part of an exercise for undergraduates who are beginning programmers, so I'm looking for simple ballpark approximations, not anything fancy.</p>

<p>Update:
Based on Rob Jeffries' recommendation below, I took a look at the Mamajek data.  Here's a plot of B-V versus temperature from that data:
<a href="https://i.sstatic.net/j1dlx.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/j1dlx.png" alt="Mamajek data with fit superimposed"></a>
I've superimposed a fitting function of the form:</p>

<pre><code>bv(t) = a/(b*t) - c
</code></pre>

<p>where the best-fit parameters are:</p>

<pre><code>a = 4.2413
b = 0.000576479
c = 0.607144
</code></pre>

<p>Using this function to calculate B-V moves my numbers in the right direction, but it still doesn't quite do the trick, as shown in the figure below (the new B-V values are the curve that's lower on the right-hand side):</p>

<p><a href="https://i.sstatic.net/3YqWY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/3YqWY.png" alt="enter image description here"></a></p>

CC BY-SA 4.0
2019-10-10T17:36:58.570Z
I've added axis labels to the figure.  As Rob Jeffries correctly pointed out, I've actually plotted B-V and absolute magnitude instead of temperature and luminosity.  I also added a description of how I calculated these values.  Maybe I just need to be more careful calculating B-V?
Bryan Wright
CC BY-SA 4.0
2019-10-10T22:42:59.277Z
But you still haven't applied bolometric corrections properly. Once you get beyond B-V of 1.5 there is almost none of the star's flux in the V band. So the absolute magnitude is much larger than your calculation.
ProfRob
<star><temperature><star-formation><luminosity><hr-diagram>
Estimating a star's radius, temperature, and luminosity based on its mass
Bryan Wright
# Estimating a star's radius, temperature, and luminosity based on its mass

(Asked by: username_0 on 2019-10-10)

(See updated figure and description below.)

I've been trying to generate ballpark estimates for the radius, temperature and luminosity of stars in the main sequence based solely on their masses (assuming the same composition for all stars). The idea is to iterate through masses in steps of, say, 0.1 solar masses from 0.1 to 100, and roughly trace out the curve of the main sequence on an HR diagram.

For luminosity, I'm using something like this:

```
  if ( mass < 0.43 ) {
    L = 0.23*L_sun*pow(mass/M_sun,2.3);
  } else if ( mass < 2 ) {
    L = L_sun*pow(mass/M_sun,4);
  } else if ( mass < 55 ) {
    L = 1.4*L_sun*pow(mass/M_sun,3.5);
  } else {
    L = 32000*L_sun*mass/M_sun;
  }

```

For radius, I'm using something like this:

```
  if ( mass < 1 ) {
    R = R_sun*pow(mass/M_sun,0.57);
  } else {
    R = R_sun*pow(mass/M_sun,0.78);
  }

```

And, using these, I'm calculating the temperature from the luminosity-radius-temperature relation like this:

```
T = pow(L/(4.0*M_PI*R*R*sigma), 0.25);

```

where sigma is just the Stefan-Boltzmann constant.

All of this works about as well as I'd expect for stars of 1 solar mass or above, but breaks down completely for M dwarfs, as you can see from the attached image which shows my meager effort superimposed on HYG data.
[![Estimated absolute magnitude versus B-V, superimposed on actual data.](https://i.sstatic.net/rEDes.png)](https://i.sstatic.net/rEDes.png)

Note that I'm plotting B-V here, calculated from temperature like this:

```
BV = pow(5601.0/T,1.5) - 0.4;

```

and absolute magnitude, calculated from luminosity like this:

```
magnitude = -2.5*log(L)/log(10) + 71.1974;

```

What can I do to improve this a little? I'll add that this is aimed at being part of an exercise for undergraduates who are beginning programmers, so I'm looking for simple ballpark approximations, not anything fancy.

Update:
Based on Rob Jeffries' recommendation below, I took a look at the Mamajek data. Here's a plot of B-V versus temperature from that data:
[![Mamajek data with fit superimposed](https://i.sstatic.net/j1dlx.png)](https://i.sstatic.net/j1dlx.png)
I've superimposed a fitting function of the form:

```
bv(t) = a/(b*t) - c

```

where the best-fit parameters are:

```
a = 4.2413
b = 0.000576479
c = 0.607144

```

Using this function to calculate B-V moves my numbers in the right direction, but it still doesn't quite do the trick, as shown in the figure below (the new B-V values are the curve that's lower on the right-hand side):

[![enter image description here](https://i.sstatic.net/3YqWY.png)](https://i.sstatic.net/3YqWY.png)

**Tags:** star, temperature, star-formation, luminosity, hr-diagram

> **Comments:**
> **username_0**: I've added axis labels to the figure.  As Rob Jeffries correctly pointed out, I've actually plotted B-V and absolute magnitude instead of temperature and luminosity.  I also added a description of how I calculated these values.  Maybe I just need to be more careful calculating B-V?  
> **username_1**: But you still haven't applied bolometric corrections properly. Once you get beyond B-V of 1.5 there is almost none of the star's flux in the V band. So the absolute magnitude is much larger than your calculation.  

---

## 1 answers

### Answer by username_1 on 2019-10-10. Score: 2

You could plot $L$ vs $T$ and compare your model result to the measured/estimated $L$ and $T$ of main sequence stars?

You have not explained or labelled what your diagram is, but it isn't $L$ versus $T$; I suspect that it absolute $V$ magnitude versus $B-V$ colour.

The transformations between $L,T$ and $V$, $B-V$ are highly non-linear, especially at low temperatures (which is why your plot fails to reproduce the M-dwarfs) and involve folding a model atmosphere through some standard filter responses or using relationships between $T$ and $B-V$ and bolometric corrections and $T$. (e.g. [Mamajek 2019](http://www.pas.rochester.edu/~emamajek/EEM_dwarf_UBVIJHK_colors_Teff.txt))

EDIT: For the clarified question.

Your relationship for $T$ vs $B-V$ is not applicable at lower temperatures.

Your relationship between absolute magnitude and luminosity takes no account of the spectral energy distribution of the light from the star (i.e. it assumes the same [bolometric correction](https://en.wikipedia.org/wiki/Bolometric_correction) for all temperatures, which isn't correct). You must calculate the *bolometric* magnitude from the luminosity and then apply a temperature-dependent bolometric correction to calculate a V-band magnitude.

The solution is to construct relationships that are valid over the full range of temperatures using the resource I referenced above.


---

