next previous
Up: DIAGONAL: A numerical solution


4 Numerical comparisons of DIAGONAL and DELO

Currently, there exists no analytical solution for a general case of radiative transfer through a magnetized atmosphere. To prove a new numerical method involves therefore two steps. First, to ensure that at least for the simplest cases, for which an analytical solution is known, the correct solution is obtained. These cases are almost reduced to the constant absorption matrix case, for which, as Bellot Rubio et al. (1998) show, any numerical method better than second order gives the proper solution. In the second step, for the general case, the new method must be compared to a previous well-tested numerical method, in search of convergence to the very same solution for both methods. This section is devoted to these comparisons. In the role of a previous well tested numerical method we have chosen DELO (Rees et al. 1989). DELO is known to approach asymptotically the solution for any model atmosphere. We will therefore consider its solution obtained with a big number of layers (usually around 500 layers suffice) as reference solution. Indeed, DIAGONAL is shown to present the same behaviour, and needs fewer layers to converge: Usually 100 layers will suffice, keeping integration errors under computer precision.

Before starting with the comparisons, we note that for very specific models (namely those characterized by a constant magnetic field intensity and inclination, and a constant velocity field in the l.o.s. but an azimuth of magnetic field varying linearly with depth) DIAGONAL provides an exact solution, independently of the number of layers. We can take advantage of that to test the convergence rate of DELO in a non-trivial case (if by trivial we refer to the Rachkowsky solution). The model presented in Table 1 has been used to this purpose. Azimuth gradient is bigger than the usual values considered for solar model atmospheres, but we wanted to observe the convergence rate, and not absolute values of precision. We have integrated the model with DELO using 30 to 530 integration layers. DIAGONAL provided the correct solution and the precision of DELO's integration is referred to this solution. The results are shown in Fig. 6.

  
Table 1: Model atmosphere with non-zero azimuth gradient used to test DELO's quadratic convergence.

\begin{tabular}
{lr}
Doppler width & 29.4 \AA \\ Line to continuum ratio & 10 \\...
 ...0$\space (km s$^{-1}$) & 0\\ Velocity gradient (km s$^{-1}$)& 0 \\ \end{tabular}

  
\begin{figure}
\includegraphics [width=8.8cm,clip]{ds8801f6.ps}\end{figure} Figure 6: Precision versus number of layers figure for DELO with the model atmosphere presented in Table 1

DELO is shown to be a second-order approximation while solving for Milne-Eddington models (although in this particular case, a null second derivative of the source function makes exact any approximation to second or bigger order). Bellot Rubio et al. showed that DELO converged also as a second-order approximation for a general atmosphere solved numerically. The results shown in Fig. 6 confirm this statement for a non-trivial analytical solution: DELO converges quadratically with the inverse of the thickness of the integration layer.

Next, we present the two models which have served to verify the convergence of DIAGONAL. We have chosen first a model with a gradient of magnetic field intensity as the sole varying parameter, and a second one in which gradients of azimuth and l.o.s. velocity are also considered. Table 2 describes both models (labeled Model 1 and Model 2). By selecting these two particular models we want to characterize the behaviour of DIAGONAL. As stated in previous sections, it can be summarized in 3 basic points:

1.
Analytic solution for models with linear variation of azimuth.
2.
Exact calculation of the exponential.
3.
Linear approximation used for the residual correction.


  
Table 2: Model atmospheres for comparisons

\begin{tabular}
{l\vert rr}
& Model 1 & Model 2 \\  
\hline
&& \\ Doppler width ...
 ... (km s$^{-1}$) & 0&0\\ Velocity gradient (km s$^{-1}$)& 0 & 0.4 \\ \end{tabular}

Model 1 has constant with depth parameters except for magnetic intensity. In terms of solutions DIAGONAL is not better than DELO. In fact the comparison graphic (Fig. 7) shows that the convergence rate is equal for both codes from a certain number of layers. The difference is the exact calculation of the exponential, which improves the convergence of DIAGONAL for a small number of layers. The bigger the number of layers, the better the DELO's second order approximation for the exponential is. Once DELO compensates for the advantage of DIAGONAL, both codes behave similarly. This paragraph can be repeated for Model 2 (Fig. 8). But in this case DIAGONAL treats analytically the non-zero azimuth gradient, thus increasing its advantage over DELO, specially when few integration layers are used (see the referred figure).

  
\begin{figure}
\includegraphics [width=8.8cm,clip]{ds8801f7.ps}\end{figure} Figure 7: Precision versus number of layers figure for DELO (dashed line) and DIAGONAL (continuous line) with model atmosphere 1

  
\begin{figure}
\includegraphics [width=8.8cm,clip]{ds8801f8.ps}\end{figure} Figure 8: Precision versus number of layers figure for DELO (dashed line) and DIAGONAL (continuous line) with model atmosphere 2

After these 2 examples, the following statement appears to be a reasonable description of DIAGONAL: This new code behaves at worst as DELO, but always presents a faster convergence for a small number of layers. The first part of this assertion was already predicted in our error analysis in Sect. 2, the second part was the searched objective for DIAGONAL, and this fast convergence shows the success of the code. It means that the analytical approach is indeed very useful and desirable. The elaborated algebra implicit in the DIAGONAL code implies a longer integration time per layer than DELO. Therefore, it is in the interest of this new code to use as few layers as possible to attain a desired precision. To illustrate this point of DIAGONAL, namely its slowness in integrating a single layer, we present in Fig. 9 a graph of time versus number of layers for both DELO and DIAGONAL. DELO appears to be 1.6 times faster per layer than DIAGONAL. If DIAGONAL is still a faster code, it is due to the fact that it can attain the desired precision with up to 6 times fewer layers than DELO.

  
\begin{figure}
\includegraphics [width=8.8cm,clip]{ds8801f9.ps}\end{figure} Figure 9: Comparison of time versus number of layers for both: DELO (points line) and DIAGONAL (continuous line)

next previous
Up: DIAGONAL: A numerical solution

Copyright The European Southern Observatory (ESO)