Stars of different mass and age have varying internal structures. Stellar structure models describe the internal structure of a star in detail and make detailed predictions about the luminosity, the color and the future evolution of the star.
Energy transport 
Convection is the dominant mode of energy transport when the temperature gradient is steep enough so that a given parcel of gas within the star will continue to rise if it rises slightly via an adiabatic process. In this case, the rising parcel is buoyant and continues to rise if it is warmer than the surrounding gas; if the rising particle is cooler than the surrounding gas, it will fall back to its original height. In regions with a low temperature gradient and a low enough opacity to allow energy transport via radiation, radiation is the dominant mode of energy transport.
The internal structure of a main sequence star depends upon the mass of the star.
In solar mass stars (0.3–1.5 solar masses), including the Sun, hydrogen-to-helium fusion occurs primarily via proton-proton chains, which do not establish a steep temperature gradient. Thus, radiation dominates in the inner portion of solar mass stars. The outer portion of solar mass stars is cool enough that hydrogen is neutral and thus opaque to ultraviolet photons, so convection dominates. Therefore, solar mass stars have radiative cores with convective envelopes in the outer portion of the star.
In massive stars (greater than about 1.5 solar masses), the core temperature is above about 1.8×107 K, so hydrogen-to-helium fusion occurs primarily via the CNO cycle. In the CNO cycle, the energy generation rate scales as the temperature to the 17th power, whereas the rate scales as the temperature to the 4th power in the proton-proton chains. Due to the strong temperature sensitivity of the CNO cycle, the temperature gradient in the inner portion of the star is steep enough to make the core convective. In the outer portion of the star, the temperature gradient is shallower but the temperature is high enough that the hydrogen is nearly fully ionized, so the star remains transparent to ultraviolet radiation. Thus, massive stars have a radiative envelope.
Equations of stellar structure 
The simplest commonly used model of stellar structure is the spherically symmetric quasi-static model, which assumes that a star is in a steady state and that it is spherically symmetric. It contains four basic first-order differential equations: two represent how matter and pressure vary with radius; two represent how temperature and luminosity vary with radius.
In forming the stellar structure equations (exploiting the assumed spherical symmetry), one considers the matter density , temperature , total pressure (matter plus radiation) , luminosity , and energy generation rate per unit mass in a spherical shell of a thickness at a distance from the center of the star. The star is assumed to be in local thermodynamic equilibrium (LTE) so the temperature is identical for matter and photons. Although LTE does not strictly hold because the temperature a given shell "sees" below itself is always hotter than the temperature above, this approximation is normally excellent because the photon mean free path, , is much smaller than the length over which the temperature varies considerably, i. e. .
Integrating the mass continuity equation from the star center () to the radius of the star () yields the total mass of the star.
Considering the energy leaving the spherical shell yields the energy equation:
where is the luminosity produced in the form of neutrinos (which usually escape the star without interacting with ordinary matter) per unit mass. Outside the core of the star, where nuclear reactions occur, no energy is generated, so the luminosity is constant.
The energy transport equation takes differing forms depending upon the mode of energy transport. For conductive luminosity transport (appropriate for a white dwarf), the energy equation is
where k is the thermal conductivity.
In the case of radiative energy transport, appropriate for the inner portion of a solar mass main sequence star and the outer envelope of a massive main sequence star,
The case of convective luminosity transport (appropriate for non-radiative portions of main sequence stars and all of giants and low mass stars) does not have a known rigorous mathematical formulation, and involves turbulence in the gas. Convective energy transport is usually modeled using mixing length theory. This treats the gas in the star as containing discrete elements which roughly retain the temperature, density, and pressure of their surroundings but move through the star as far as a characteristic length, called the mixing length. For a monatomic ideal gas, when the convection is adiabatic, meaning that the convective gas bubbles don't exchange heat with their surroundings, mixing length theory yields
where is the adiabatic index, the ratio of specific heats in the gas. (For a fully ionized ideal gas, .) When the convection is not adiabatic, the true temperature gradient is not given by this equation. For example, in the Sun the convection at the base of the convection zone, near the core, is adiabatic but that near the surface is not. The mixing length theory contains two free parameters which must be set to make the model fit observations, so it is a phenomelogical theory rather than a rigorous mathematical formulation.
Also required are the equations of state, relating the pressure, opacity and energy generation rate to other local variables appropriate for the material, such as temperature, density, chemical composition, etc. Relevant equations of state for pressure may have to include the perfect gas law, radiation pressure, pressure due to degenerate electrons, etc. Opacity cannot be expressed exactly by a single formula. It is calculated for various compositions at specific densities and temperatures and presented in tabular form. Stellar structure codes (meaning computer programs calculating the model's variables) either interpolate in a density-temperature grid to obtain the opacity needed, or use a fitting function based on the tabulated values. A similar situation occurs for accurate calculations of the pressure equation of state. Finally, the nuclear energy generation rate is computed from particle physics experiments, using reaction networks to compute reaction rates for each individual reaction step and equilibrium abundances for each isotope in the gas.
Combined with a set of boundary conditions, a solution of these equations completely describes the behavior of the star. Typical boundary conditions set the values of the observable parameters appropriately at the surface () and center () of the star: , meaning the pressure at the surface of the star is zero; , there is no mass inside the center of the star, as required if the mass density remains finite; , the total mass of the star is the star's mass; and , the temperature at the surface is the effective temperature of the star.
Although nowadays stellar evolution models describes the main features of color magnitude diagrams, important improvements have to be made in order to remove uncertainties which are linked to the limited knowledge of transport phenomena. The most difficult challenge remains the numerical treatment of turbulence. Some research teams are developing simplified modelling of turbulence in 3D calculations.
Rapid evolution 
The above simplified model is not adequate without modification in situations when the composition changes are sufficiently rapid. The equation of hydrostatic equilibrium may need to be modified by adding a radial acceleration term if the radius of the star is changing very quickly, for example if the star is radially pulsating. Also, if the nuclear burning is not stable, or the star's core is rapidly collapsing, an entropy term must be added to the energy equation.
See also 
- Hansen, Kawaler & Trimble (2004, §5.1.1)
- Hansen, Kawaler & Trimble (2004, Tbl. 1.1)
- Hansen, Kawaler & Trimble (2004, §2.2.1)
- This discussion follows those of, e. g., Zeilik & Gregory (1998, §16-1–16-2) and Hansen, Kawaler & Trimble (2004, §7.1)
- Hansen, Kawaler & Trimble (2004, §5.1)
- Ostlie, Dale A. and Carrol, Bradley W., An introduction to Modern Stellar Astrophysics, Addison-Wesley (2007)
- Iglesias, C.A.; Rogers, F.J. (June 1996), "Updated Opal Opacities", Astrophysical Journal 464: 943–+, Bibcode:1996ApJ...464..943I, doi:10.1086/177381.
- Rauscher, T.; Heger, A.; Hoffman, R.D.; Woosley, S.E. (September 2002), "Nucleosynthesis in Massive Stars with Improved Nuclear and Stellar Physics", The Astrophysical Journal 576 (1): 323–348, arXiv:astro-ph/0112478, Bibcode:2002ApJ...576..323R, doi:10.1086/341728.
- Moya, A.; Garrido, R. (August 2008), "Granada oscillation code (GraCo)", Astrophysics and Space Science 316 (1–4): 129–133, arXiv:0711.2590, Bibcode:2008Ap&SS.316..129M, doi:10.1007/s10509-007-9694-2.
- Mueller, E. (July 1986), "Nuclear-reaction networks and stellar evolution codes – The coupling of composition changes and energy release in explosive nuclear burning", Astronomy and Astrophysics 162: 103–108, Bibcode:1986A&A...162..103M.
General references 
- Kippenhahn, R.; Weigert, A. (1990), Stellar Structure and Evolution, Springer-Verlag
- Hansen, Carl J.; Kawaler, Steven D.; Trimble, Virginia (2004), Stellar Interiors (2nd ed.), Springer, ISBN 0-387-20089-4
- Kennedy, Dallas C.; Bludman, Sidney A. (1997), "Variational Principles for Stellar Structure", Astrophysical Journal 484 (1): 329, arXiv:astro-ph/9610099, Bibcode:1997ApJ...484..329K, doi:10.1086/304333
- Weiss, Achim; Hillebrandt, Wolfgang; Thomas, Hans-Christoph; Ritter, H. (2004), Cox and Giuli's Principles of Stellar Structure, Cambridge Scientific Publishers
- Zeilik, Michael A.; Gregory, Stephan A. (1998), Introductory Astronomy & Astrophysics (4th ed.), Saunders College Publishing, ISBN 0-03-006228-4
- opacity code retrieved November 2009
- The Yellow CESAM code, stellar evolution and structure FORTRAN source code
- EZ to Evolve ZAMS Stars a FORTRAN 90 software derived from Eggleton's Stellar Evolution Code, a web-based interface can be found here .
- Geneva Grids of Stellar Evolution Models (some of them including rotational induced mixing)
- The BaSTI database of stellar evolution tracks