## Appendix A: the details of the simulation methodsThe 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): - generate a photon package with random position and random direction inside the cloud (or at the cloud boundary); initialize the photon package assigning to it a number of photons which is the number of real photons emitted by the cell (or the background) in one second divided by the expected number of photon packages generated in the cell (at the cloud boundary) during one iteration
- repeat the following steps (a) to (c) until the package exits the
cloud
**1.**move the package to the next cell boundary in the original direction**2.**using the distance traveled within the cell calculate the optical depth along the trajectory**3.**remove the number of absorbed photons from the package and add to a counter in the cell
The corresponding code for method B is: - generate a random position and random direction for a photon package at the cloud boundary; initialize the photon package assigning to it a number of photons which is the number of real photons emitted by the background in one second divided by the total number of photon packages generated during one iteration
- repeat the following steps (a) to (d) until the package exits the
cloud
**1.**move the package to the next cell boundary in the original direction**2.**using the distance traveled in the cell calculate the optical depth along the trajectory**3.**remove the number of absorbed photons from the package and add to a counter in the cell**4.**calculate the number of photons emitted by the cell during one iteration, divided by the estimated number of photon packages going through the cell during one iteration and - calculate the fraction of these photons that is absorbed within this cell and add to counters in the cell - add the rest of these photons to the photon package
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 equationsIn the following the excitation levels are marked with indices
The number of photons emitted in transition , divided by the volume of the emitting cell is and the number of photons coming from outside the cloud in one channel where is the channel width in velocity and
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 The total number of absorptions in one second per one molecule is marked and the equilibrium equations become There are ## A.2. The use of a reference fieldThe 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 and photons from the background on an area of As a photon package passes the distance Actually the counters contain these values integrated over the
frequency. In this equation 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 S 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 cellThe 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 © European Southern Observatory (ESO) 1997 Online publication: June 5, 1998 |