In our numerical approach here, we assume that the external radius
is given. In order to complete the calculation
we have to determine the interior radius
. This can be done
recalling that the dimensionless pressure
is zero for
and
. Since according to Equation (53)
, this
is equivalent to the determination of the values of
for which
. By the determination of
we would have solved the problem
in the entire matter region. Note that since
we have obtained a family of
solutions parametrized by two parameters, the external radius
and
the parameter
.
If the discriminant the integral in Equation (84)
is expressed in terms of elliptic integrals and the result is not very
transparent. It is more convenient to integrate the differential
Equation (79) using the fourth-order Runge-Kutta algorithm
(RK4) [#!NumericalRecipes!#]. We start by choosing a value of
for which the cubic polynomial is positive and we put
. This
determines the outer radius of the matter shell. We then iterate the
differential equation given in Equation (79) in the decreasing
direction until we reach the first point for which the value of
returns to
. This point is chosen as
. If a value for
cannot be found, we conclude that there is no solution to the problem with
the given values of
and
. A good test for the efficiency of
the algorithm is to compare the exact analytic result given in
Equation (88) with the result from the numerical integration in
that same case. These results are shown in Figure 1. On any
current
-bit desktop computer one can easily reach a high degree of
precision with little numerical effort. After iterating the RK4 algorithm
from
to
the difference between the exact and the numerical
results for
stays below
for an iteration
step of
.
In the comments that follow
, where
is the integration constant that results from the solution of the
Einstein equations in the inner vacuum region, given in
Equation (31). In the matter region the input parameters are
and
. The parameter
is obtained from the iteration
of Equation (79). The value of
that is necessary for
plotting the curves is given in Equation (83). The expressions
for
and
are given in Table 1.
Figure 2 shows the plots of the functions
and
for
and
. The curves were obtained
analytically using Equation (88) and the expressions in
Table 1, but using the numerically calculated parameters
and
.
In Figure 3 we plot the dimensionless pressure as a
function of
, in a case in which there is no analytic expression in
terms of elementary functions and the calculation is performed
numerically. The parameters are
and
.
Comparing Figures 1 and 3, that depict the
dimensionless pressure
as a function of
for
and
, one notes that the two graphs are similar but for larger
values of
the graph becomes less symmetric.
Figure 4 shows the plots of the functions and
, for
and
. In this case there are no
analytical solutions in terms of elementary functions available in the
matter region and the values of
and
were obtained
numerically. In the vacuum regions we used the analytical expressions
given in Table 1 with the parameters
and
.