Appendix A: the details of the simulation methods
The cloud is divided into a number of cells and the radiation field is simulated with a number of photon packages. As a package goes through a cell the number of absorbed photons is calculated and registered by a counter in the cell. These counters are later used in the equilibrium equations to represent the number of induced transitions.
There are two methods for carrying out the simulation part of the calculations. The pseudocode for handling one photon packege is for the simulation method A (without the reference field):
The corresponding code for method B is:
The level populations are assumed to be the same for all molecules within a cell. However, because of the turbulence and kinetic motions each cell contains molecules with different velocities and the excitation conditions may change with velocity. For example, in a collapsing cloud (if the local linewidth is large enough) each cell contains both molecules moving inwards and outwards and these should probably have different excitation temperatures. These effects are usually ignored and we do not consider them either. Since proper handling of such effects would increase the computational burden by at least one order of magnitude such calculations are currently not practical for three-dimensional models.
In the following sections we list the equations implemented in the simulation program. These will also highlight the difference between our two simulation methods. Some of the equations can also be found in Bernes (1979) but are given here for reference.
A.1. Basic equations
In the following the excitation levels are marked with indices i and j, and levels u and l are such that .
and the number of photons coming from outside the cloud in one channel
where is the channel width in velocity and A the surface area. The emission profile depends on the local gas properties: thermal motions and the microturbulence . The optical depth of transition u over the distance s is
The absorption profile is assumed to be the same as the emission profile and Gaussian in shape. The profiles of all transitions are also assumed to be separated from each other in frequency. As photons with the frequency travel a distance s, the number of induced upward transitions divided with the number of molecules on the lower level is
There are m equations of which only are linearly independent. One of the equations is replaced with , where n is the total number density of the molecule. The level populations can now be solved, since and are assumed to be known and are a result of the simulation. The simulation is continued using these new population values.
A.2. The use of a reference field
The random fluctuations of the results can be reduced by letting the photon packages represent only the difference between the real radiation field and some reference field corresponding to a constant temperature. The use of a reference field requires changes to the calculations of interactions between photons and gas as well as the equilibrium equations (see also Bernes 1979).
The reference field corresponds a thermodynamic equilibrium at some temperature . Let the number of real photons be and the number of photons corresponding to the reference field . The numbers of photons emitted from a cell with volume V in a transition within a frequency are
and photons from the background on an area of A,
Actually the counters contain these values integrated over the frequency. In this equation t is the optical depth of the cell for the reference photons
During the simulation only the difference between the real absorptions and the absorptions due to the reference field is calculated. The reference field which was previously subtracted is now added back in the equilibrium equations
Since the absorption counters Sij depend on and calculated in the emitting cell the reference temperature that is used here must be the same, i.e. the reference temperature must be the same in all cells.
Instead of using a fixed reference temperature one can use as the reference the level populations from the previous iteration. The number of photons and the optical depth are calculated for the reference field in just the same way as for the true photons but using the level populations of the previous iteration (see Choi et al. 1995). In this way one does not have to specify reference temperatures and the reference field automatically gets close to its correct value as the iterations converge thereby minimizing the noise. On the other hand, one is forced to store the level populations of two iterations. The added memory requirement may be a problem with large three-dimensional models.
A.3. Photons absorbed in the emitting cell
The previous equations apply only to normal Monte Carlo- simulation (method A). In method B, however, photons are added to passing photon package only at the borders of the cells. If the optical depth of the cell is not very small the photons absorbed within the emitting cell must be treated explicitly and Eq. A8must be modified. Firstly, by integrating over the photon path the number of new photons emitted from the cell is
for the exiting package. Similarly for the reference field
Since many rays pass the same cell during each iteration step, the numbers must also be weighted accordingly. When the photons that are both emitted and absorbed in the same cell are taken into account the correct formula for the counters becomes
If the reference field is not used the terms containing t are of course omitted.
© European Southern Observatory (ESO) 1997
Online publication: June 5, 1998