EFTCAMB  Reference documentation for version 3.0
Functions/Subroutines
eftcamb_rootfind Module Reference

This module contains the definitions of all the EFTCAMB root finding algorithms. More...

Functions/Subroutines

subroutine, public zbrac (func, x1, x2, succes, funcZero)
 Bracketing subroutine: This subroutine does a outward search for the smallest intervall containing a root of the equation func=funcZero. More...
 
real(dl) function, public zbrent (func, x1, x2, tol, funcZero, succes)
 Brent root finding algorithm: This is used to solve numerically the equation func=funcZero by means of the Brent method. Notice that the initial interval has to bracket the root of the function. More...
 

Detailed Description

This module contains the definitions of all the EFTCAMB root finding algorithms.

Author
Bin Hu, Marco Raveri

Function/Subroutine Documentation

subroutine, public eftcamb_rootfind::zbrac ( external  func,
real(dl), intent(inout)  x1,
real(dl), intent(inout)  x2,
logical, intent(out)  succes,
real(dl), intent(in)  funcZero 
)

Bracketing subroutine: This subroutine does a outward search for the smallest intervall containing a root of the equation func=funcZero.

Parameters
funcfunction to find the root of
[in,out]x1in input lower bound of the interval in which to find the root, in output lower bound of the bracketing interval
[in,out]x2in input upper bound of the interval in which to find the root, in output upper bound of the bracketing interval
[out]succestrue if the algorithm succeeds false if not
[in]funczerothe value desired func = funcZero

Definition at line 41 of file 02_root_finding.f90.

real(dl) function, public eftcamb_rootfind::zbrent ( external  func,
real(dl)  x1,
real(dl)  x2,
real(dl)  tol,
real(dl)  funcZero,
logical  succes 
)

Brent root finding algorithm: This is used to solve numerically the equation func=funcZero by means of the Brent method. Notice that the initial interval has to bracket the root of the function.

Parameters
funcfunction to find the root of
x1in input lower bound of the interval in which to find the root. Has to be braketing.
x2in input upper bound of the interval in which to find the root. Has to be braketing.
tolnumerical absolute tollerance. Notice that internally the algorithm mitigates this with absoute tollerance. Values below 1.d-15 are useless.
funczerothe value desired func = funcZero
succestrue if the algorithm succeeds false if not
Returns
returns the value of x at which the function satisfies func = funcZero up to numerical accuracy

Definition at line 94 of file 02_root_finding.f90.