Energy conservation is imposed as a constraint when determining the temperature in xstar when the input parameter niter is non-zero. If so, the temperature is iteratively improved until the heating and cooling rates are locally equal. This is implemented by calculating the integral over the absorbed and emitted continuum energy in a given spatial zone, and also the sum over the energy emitted in the lines. Compton heating and cooling are added analytically, since Comptonization of the radiation field is not treated. The error resulting from this procedure is tabulated in the log file 'xout_step.log' in the 8th column of the step-by-step output, in units of .

Energy conservation locally should correspond to global energy conservation, i.e. that the total absorbed energy in the radiation field equals the total emitted energy in lines plus continuum. This is tested at each spatial zone in xstar by calculating . The error resulting from this procedure is tabulated in the log file 'xout_step.log' in the 9th column of the step-by-step output, in units of .

It is important to point out that the specific luminosities in the file 'xout_spect1.fits' 'xout_cont1.fits' are not expected, in general, to show energy conservation. This is primarily because the transmitted spectra in both of these files contain the effects of binned lines. Line opacity is expected to produce a scattering event, i.e. the photon is likely to be reemitted near the same energy. This differs qualitatively from photoelectric absorption, in which an absorbed photon is likely to be reemitted at a very different energy, with an accompanying net loss or gain of energy to the electron thermal bath. Line opacity is not included in the radiative equilibrium integral used to calculate the gas temperature, and so the total absorbed energy in the radiation field will in general not equal the emitted energy in . Energy conservation can be checked using the quantities , and from the file xout_step.log.

Energy conservation checked using binned line spectra is also affected by the errors introduced by binning. This is discussed at length in the section of this manual on table models for xspec, but we emphasize here that the binned spectrum cannot be accurately integrated to derive the total line absorption or emission unless the lines are broad compared with the energy grid spacing (requiring turbulent velocities 500 km/s currently).