1.3 The Computation of Scattering Properties
23
is important since an estimate of the convergence can be obtained. In our case, the
convergence is to be found both with respect to the number of points sampling the
function within the interval of x of a single closed integration and sampling the value
of the overall integral when adding more intervals.
The first convergence can be obtained by iterating over the density of points within
the same interval (whose pseudocode is rendered below as the CCMT1D subroutine)
still by adopting the midpoint trapezoidal method.
SUBROUTNE CCMT1D (x_inf, x_sup, n_max, tol): CONVERGED CLOSED
MIDPOINT TRAPEZOIDAL 1D
OUTPUT val_integr
-----------------------------------x_inf is the lower limit of the integral
x_sup is the upper limit of the integral
is the number of sampling points of the
function in the interval a to xsup
n_max is the maximum number of duplication times (must be
larger than 1) of the sampling points of the function in the
interval x_inf to x_sup
tol is the accepted tolerance in the difference between the
value of the integral at two subsequent iterations
f is the integrand function to be defined a
f(r)=\sqrt(1-b*b/r/r-V(r)/E)/r/r in which V(r) is defined
as a function as a function of those parameters
and of the potential energy function V(r)
-----------------------------------dx = x_sup - x_inf
n=1
x_point =x_inf + 0.5 * dx
val_prev=dx * f (x_point)
i_n REPEAT FOR GOING FROM 2 TO nmax-1
sum=0
n=2*n
dx=dx/2
x_point =x_inf + 0.5 * dx
i_point REPEAT FOR GOING FROM 1 TO n-1
sum = sum + f (x_point)
x_point = x_point + dx
END REPEAT i_point
val_integr = sum*dx
IF(abs(val_integr-val_prev)
val_prev=val_integr
END REPEAT i_n
TELL ’ lack of convergence in the range ’
Sampling points as a function of the initial range are doubled at each iteration and
the integral evaluated to determine the difference between the estimate obtained in a
given iteration and that obtained in the previous one are used to check convergence
toward an accepted error tolerance. It is important to note here that the choice of
doubling the points has the great advantage of increasing significantly the number
of points without needing to recalculate all of them as it would be when increasing,
and the number of points by 1 at each step.
23
is important since an estimate of the convergence can be obtained. In our case, the
convergence is to be found both with respect to the number of points sampling the
function within the interval of x of a single closed integration and sampling the value
of the overall integral when adding more intervals.
The first convergence can be obtained by iterating over the density of points within
the same interval (whose pseudocode is rendered below as the CCMT1D subroutine)
still by adopting the midpoint trapezoidal method.
SUBROUTNE CCMT1D (x_inf, x_sup, n_max, tol): CONVERGED CLOSED
MIDPOINT TRAPEZOIDAL 1D
OUTPUT val_integr
-----------------------------------x_inf is the lower limit of the integral
x_sup is the upper limit of the integral
is the number of sampling points of the
function in the interval a to xsup
n_max is the maximum number of duplication times (must be
larger than 1) of the sampling points of the function in the
interval x_inf to x_sup
tol is the accepted tolerance in the difference between the
value of the integral at two subsequent iterations
f is the integrand function to be defined a
f(r)=\sqrt(1-b*b/r/r-V(r)/E)/r/r in which V(r) is defined
as a function as a function of those parameters
and of the potential energy function V(r)
-----------------------------------dx = x_sup - x_inf
n=1
x_point =x_inf + 0.5 * dx
val_prev=dx * f (x_point)
i_n REPEAT FOR GOING FROM 2 TO nmax-1
sum=0
n=2*n
dx=dx/2
x_point =x_inf + 0.5 * dx
i_point REPEAT FOR GOING FROM 1 TO n-1
sum = sum + f (x_point)
x_point = x_point + dx
END REPEAT i_point
val_integr = sum*dx
IF(abs(val_integr-val_prev)
END REPEAT i_n
TELL ’ lack of convergence in the range ’
Sampling points as a function of the initial range are doubled at each iteration and
the integral evaluated to determine the difference between the estimate obtained in a
given iteration and that obtained in the previous one are used to check convergence
toward an accepted error tolerance. It is important to note here that the choice of
doubling the points has the great advantage of increasing significantly the number
of points without needing to recalculate all of them as it would be when increasing,
and the number of points by 1 at each step.
