<p>Empirically (I fit a regression on log(mass) vs log(surface temp)), using the table of values in the article on <a href="https://en.wikipedia.org/wiki/Main_sequence" rel="nofollow">Main Sequence stars</a>, I get a fairly well-fitting formula:  $\mathrm{estTemp} = 5740*\mathrm{mass}^{0.54}$, where estTemp is in C and mass is in multiples of the sun's mass.  Seems to work very well for all but the largest and smallest main sequence stars (and not TOO bad for those).</p>

CC BY-SA 3.0
2016-01-08T13:59:55.080Z
yes it is somewhat accurate on main sequence stars, but the sample i used contains stars of various sizes and phases including some extremes, so the formula was accurate for 3 of the values but the rest was quite off:  -1,03%
120,39%
45,02%
90,89%
39,04%
232,13%
520,95%
67,30%
98,27%
166,37%
4,37%
3,52%
667,13%
52,90%
51,45%
204,66%
128,23%
-15,59%  so i d iether need a way to determine which formula to use for which stars or something that depends on more parameters
asdf
CC BY-SA 3.0
2016-01-08T23:02:46.193Z
You might want to look at the second derivation on the [Mass-Luminosity relationship](https://en.wikipedia.org/wiki/Mass–luminosity_relation) page.
AlaskaRon
CC BY-SA 3.0
2016-01-10T14:59:18.223Z
thanks, that looks to be a more accurate formula, however i have no idea what the brackets around p mean and how to calculate l
asdf
CC BY-SA 3.0
2016-01-10T15:07:32.940Z
i tried seting l=1/p where p is the average density and used Te=(l/r)^0,25*Ti  where r is radius, but i got these errors: 171,63%
1201,60%
643,74%
402,53%
486,53%
473,50%
289,27%
637,71%
667,15%
451,57%
955,40%
1097,25%
315,70%
1089,56%
989,26%
334,57%
599,24%
721,25%
 so i must be doing something wrong as i d expect the formula wouldnt be off by 171% for the sun if applied correctly
asdf
CC BY-SA 3.0
2016-01-08T03:14:53.810Z
2016-06-07T05:44:20.523Z
2016-06-07T05:44:20.523Z
AlaskaRon
<p>I need a way to calculate the effective temperature (surface temperature) of a star for a stellar model. I need something in the form Te=....</p>

<p>I have:</p>

<ul>
<li>Radius in m</li>
<li>mass in kg</li>
<li>the composition of particles (eg H 90%, He 8% etc)</li>
<li>the combined stored thermal energy of the body in J </li>
</ul>

<p>Constants (any really but I'm using these for now):</p>

<ul>
<li>G=gravity constant=6.67408E-011</li>
<li>k=kbolzmann=1.3806485279E-023</li>
<li>s=sbolzmann=5,67036713E-008</li>
<li>PI=pi ~3.14...</li>
</ul>

<p>Example of the sun:</p>

<ul>
<li>mp=average mass of a particle=1,7E-027</li>
<li>M=total mass of the body=2E30</li>
<li>r=radius of the body=700000000</li>
</ul>

<p>I'm using this equation to estimate the core temperature :</p>

<p><code>(G*mp*M)/(r*(3/2)*k)</code> </p>

<p>which nets 15653011 for the sun which is close enough given that that is the only star core temperature known (afaik).</p>

<p>I'm using this to estimate the luminosity L:</p>

<p><code>4*PI*(r^2)*s*(Te^4)</code> </p>

<p>which results in an error of ~1-5%  with 90% of my sample stars which is close enough. For the sun this results in <code>3,95120075975041E+026 W</code> which is only <code>2,7%</code> off.</p>

<p>The problem is I need Te for the 2nd formula which I don't have in my scenario.</p>

<p>Due to the formula for L being dependent on the surface temperature to the power of 4 this value has to be relatively precise.</p>

<p>Assumptions of my model:</p>

<ul>
<li>uniform distribution of particles: so every slice of the body has the same composition as the entire body.</li>
<li>perfect sphere: every body is a perfect sphere, no handling for elliptic bodies needed.</li>
</ul>

<p>My sample values (first line is the sun with a core temp of 15000000): </p>

<pre><code>     emitted energy Surface temp    radius       mass 
     (in Lsun)      (in K)          (in m)       (in Msun)
     1              5800            700000000    1
     8700000        53000           25200000000  265
     6300000        50100           23100000000  110
     2900000        42000           23660000000  132
     2000000        44000           16800000000  80
     1260000        13500           140000000000 45
     57500          3600            618100000000 12.4
     78             5700            6440000000   2.56
     78.5           4940            8540000000   2.69
     15100          7350            51100000000  9.7
     1.519          5790            858900000    1.1
     0.5            5260            605500000    0.907
     370000         3690            994000000000 19.2
     123000         33000           7560000000   56
     2200000        52500           12600000000  130
     200000         10000           151900000000 22
     446000         19000           43330000000  42.3
     25.4           9940            1197700000   2.02
</code></pre>

<p>Errors in luminosity to actual value (the maximum error is about 100% which I can live with since it might just be inaccurate measurements for the sample stars)</p>

<pre><code>2.74%
6.71%
-1.13%
11.29%
-2.00%
-4.27%
106.76%
3.99%
2.51%
-6.50%
1.12%
4.00%
-8.27%
2.10%
1.57%
113.75%
1.64%
2.15%
</code></pre>

CC BY-SA 3.0
2016-01-11T10:18:27.290Z
You need a proper stellar evolution model. There is no simple answer to this question. Also, many of your assumptions are far from the truth. - e.g. the composition is not at all uniform with depth. $L=4\pi R^2 T_e^4$ is an exact relationship - I am not sure what you mean by getting an "error" when using this. About the only thing you could do is use the ratio of He/H as a crude indicator of evolutionary status and then pick an approximate empirical relationship between $L$ and $M$ appropriate for the evolutionary status.
ProfRob
CC BY-SA 3.0
2016-01-12T18:06:05.903Z
the errors are based on the sample data i used, so the sample data luminousity is probably off by that, since u say that it is an excact formula. my model is currently based on how the structure is, so if adding varying compositions at different depths would help i could add that. my current model is not quite done. could you perhaps provide a relationship like you said because all i saw were diagramms of mass/luminousity
asdf
CC BY-SA 3.0
2016-04-07T20:10:46.797Z
@asdf I'm not intimately familiar with the calculations here, so I need someone else to confirm. Is this question a duplicate? http://astronomy.stackexchange.com/questions/1013/how-does-one-determine-the-effective-temperature-of-a-star-from-its-spectrum
called2voyage
CC BY-SA 4.0
2023-06-20T00:14:31.803Z
Does this answer your question? [How does one determine the effective temperature of a star from its spectrum?](https://astronomy.stackexchange.com/questions/1013/how-does-one-determine-the-effective-temperature-of-a-star-from-its-spectrum)
Starship
<star><temperature><surface>
How to calculate the temperature of a star
asdf
# How to calculate the temperature of a star

(Asked by: username_0 on 2016-01-06)

I need a way to calculate the effective temperature (surface temperature) of a star for a stellar model. I need something in the form Te=....
I have:

Radius in m
mass in kg
the composition of particles (eg H 90%, He 8% etc)
the combined stored thermal energy of the body in J 

Constants (any really but I'm using these for now):

G=gravity constant=6.67408E-011
k=kbolzmann=1.3806485279E-023
s=sbolzmann=5,67036713E-008
PI=pi ~3.14...

Example of the sun:

mp=average mass of a particle=1,7E-027
M=total mass of the body=2E30
r=radius of the body=700000000

I'm using this equation to estimate the core temperature :
(G*mp*M)/(r*(3/2)*k) 
which nets 15653011 for the sun which is close enough given that that is the only star core temperature known (afaik).
I'm using this to estimate the luminosity L:
4*PI*(r^2)*s*(Te^4) 
which results in an error of ~1-5%  with 90% of my sample stars which is close enough. For the sun this results in 3,95120075975041E+026 W which is only 2,7% off.
The problem is I need Te for the 2nd formula which I don't have in my scenario.
Due to the formula for L being dependent on the surface temperature to the power of 4 this value has to be relatively precise.
Assumptions of my model:

uniform distribution of particles: so every slice of the body has the same composition as the entire body.
perfect sphere: every body is a perfect sphere, no handling for elliptic bodies needed.

My sample values (first line is the sun with a core temp of 15000000): 
     emitted energy Surface temp    radius       mass 
     (in Lsun)      (in K)          (in m)       (in Msun)
     1              5800            700000000    1
     8700000        53000           25200000000  265
     6300000        50100           23100000000  110
     2900000        42000           23660000000  132
     2000000        44000           16800000000  80
     1260000        13500           140000000000 45
     57500          3600            618100000000 12.4
     78             5700            6440000000   2.56
     78.5           4940            8540000000   2.69
     15100          7350            51100000000  9.7
     1.519          5790            858900000    1.1
     0.5            5260            605500000    0.907
     370000         3690            994000000000 19.2
     123000         33000           7560000000   56
     2200000        52500           12600000000  130
     200000         10000           151900000000 22
     446000         19000           43330000000  42.3
     25.4           9940            1197700000   2.02

Errors in luminosity to actual value (the maximum error is about 100% which I can live with since it might just be inaccurate measurements for the sample stars)
2.74%
6.71%
-1.13%
11.29%
-2.00%
-4.27%
106.76%
3.99%
2.51%
-6.50%
1.12%
4.00%
-8.27%
2.10%
1.57%
113.75%
1.64%
2.15%

**Tags:** star, temperature, surface

> **Comments:**
> **username_1**: You need a proper stellar evolution model. There is no simple answer to this question. Also, many of your assumptions are far from the truth. - e.g. the composition is not at all uniform with depth. $L=4\pi R^2 T_e^4$ is an exact relationship - I am not sure what you mean by getting an "error" when using this. About the only thing you could do is use the ratio of He/H as a crude indicator of evolutionary status and then pick an approximate empirical relationship between $L$ and $M$ appropriate for the evolutionary status.  
> **username_0**: the errors are based on the sample data i used, so the sample data luminousity is probably off by that, since u say that it is an excact formula. my model is currently based on how the structure is, so if adding varying compositions at different depths would help i could add that. my current model is not quite done. could you perhaps provide a relationship like you said because all i saw were diagramms of mass/luminousity  
> **username_2**: @username_0 I'm not intimately familiar with the calculations here, so I need someone else to confirm. Is this question a duplicate? http://astronomy.stackexchange.com/questions/1013/how-does-one-determine-the-effective-temperature-of-a-star-from-its-spectrum  
> **username_3**: Does this answer your question? [How does one determine the effective temperature of a star from its spectrum?](https://astronomy.stackexchange.com/questions/1013/how-does-one-determine-the-effective-temperature-of-a-star-from-its-spectrum)  

---

## 1 answers

### Answer by username_4 on 2016-01-08. Score: 2 | Accepted answer

Empirically (I fit a regression on log(mass) vs log(surface temp)), using the table of values in the article on [Main Sequence stars](https://en.wikipedia.org/wiki/Main_sequence), I get a fairly well-fitting formula: $\mathrm{estTemp} = 5740\*\mathrm{mass}^{0.54}$, where estTemp is in C and mass is in multiples of the sun's mass. Seems to work very well for all but the largest and smallest main sequence stars (and not TOO bad for those).

> **Comments:**
> **username_0**: yes it is somewhat accurate on main sequence stars, but the sample i used contains stars of various sizes and phases including some extremes, so the formula was accurate for 3 of the values but the rest was quite off:  -1,03% 120,39% 45,02% 90,89% 39,04% 232,13% 520,95% 67,30% 98,27% 166,37% 4,37% 3,52% 667,13% 52,90% 51,45% 204,66% 128,23% -15,59%  so i d iether need a way to determine which formula to use for which stars or something that depends on more parameters  
> **username_4**: You might want to look at the second derivation on the [Mass-Luminosity relationship](https://en.wikipedia.org/wiki/Mass–luminosity_relation) page.  
> **username_0**: thanks, that looks to be a more accurate formula, however i have no idea what the brackets around p mean and how to calculate l  
> **username_0**: i tried seting l=1/p where p is the average density and used Te=(l/r)^0,25*Ti  where r is radius, but i got these errors: 171,63% 1201,60% 643,74% 402,53% 486,53% 473,50% 289,27% 637,71% 667,15% 451,57% 955,40% 1097,25% 315,70% 1089,56% 989,26% 334,57% 599,24% 721,25%  so i must be doing something wrong as i d expect the formula wouldnt be off by 171% for the sun if applied correctly  

---

