roots Module Reference
root finding subroutines More...
Data Types | |
type | roots_typ |
basic type for root finding functions More... | |
Functions/Subroutines | |
pure subroutine, public | initroots (this, x1, x2, f1, f2, dxacc, maxiter) |
character(len=64) function, public | geterrormessage (error) |
subroutine | getroot_generic (this, Stepper, func, x1, x2, dxacc, maxiter, plist, xm) |
subroutine, public | getroot_newton (funcd, x1, x2, root, error, plist, xm, iterations) |
subroutine, public | getroot_regulafalsi (func, x1, x2, root, error, plist, xm, iterations) |
subroutine, public | getroot_pegasus (func, x1, x2, root, error, plist, xm, iterations) |
subroutine, public | getroot_king (func, x1, x2, root, error, plist, xm, iterations) |
subroutine, public | getroot_andersonbjoerk (func, x1, x2, root, error, plist, xm, iterations) |
subroutine, public | getroot_ridder (func, x1, x2, root, error, plist, xm, iterations) |
subroutine, public | getroot_brentdekker (func, x1, x2, root, error, plist, xm, iterations) |
subroutine, public | getroot_bisection (func, x1, x2, root, error, plist, xm, iterations) |
pure subroutine | updatebounds_bisection (this) |
pure subroutine | step_bisection (this) |
pure subroutine | step_newton (this) |
pure subroutine | step_regulafalsi (this) |
pure subroutine | step_pegasus (this) |
pure subroutine | step_king (this) |
pure subroutine | step_andersonbjoerk (this) |
pure subroutine | step_ridder (this) |
pure subroutine | step_brentdekker (this) |
pure subroutine | step_secantmethod (this) |
pure subroutine | saveinversequadraticinterpolation (a, b, c, fa, fb, fc, db_numer, db_denom) |
pure subroutine | step_arithmeticmean (this) |
pure real function | arithmeticmean (a, b) |
pure real function | linearinterpolation (x1, x2, f1, f2) |
pure subroutine | testconvergence (this) |
Variables | |
integer, parameter, public | default_max_iterations = 1000 |
real, parameter, public | default_accuracy = 4*EPSILON(DEFAULT_ACCURACY) |
character(len=64), dimension(0:4), parameter | error_message = (/ "unknown error ", "root not bracketed ", "iteration exceeds maximum ", "requested accuracy smaller than machine precission ", "upper limit for iterations should be larger than 1 " /) |
Detailed Description
root finding subroutines
- Newton's method combined with bisection, for ill-posed problems
- Regula falsi
- Bisection
- Pegasus
- King
- Anderson Bjoerk
- Ridder
- Brent Dekker (default)
The algorithms can be found in standard textbooks on numerical analysis. See e. g. [press2007] and [engeln2011] and references therein.
Function/Subroutine Documentation
◆ arithmeticmean()
|
private |
◆ geterrormessage()
character(len=64) function, public roots::geterrormessage | ( | integer, intent(in) | error | ) |
◆ getroot_andersonbjoerk()
subroutine, public roots::getroot_andersonbjoerk | ( | func, | |
real, intent(in) | x1, | ||
real, intent(in) | x2, | ||
real, intent(out) | root, | ||
integer, intent(out) | error, | ||
real, dimension(:), intent(in), optional | plist, | ||
real, intent(in), optional | xm, | ||
integer, intent(out), optional | iterations | ||
) |
◆ getroot_bisection()
subroutine, public roots::getroot_bisection | ( | func, | |
real, intent(in) | x1, | ||
real, intent(in) | x2, | ||
real, intent(out) | root, | ||
integer, intent(out) | error, | ||
real, dimension(:), intent(in), optional | plist, | ||
real, intent(in), optional | xm, | ||
integer, intent(out), optional | iterations | ||
) |
◆ getroot_brentdekker()
subroutine, public roots::getroot_brentdekker | ( | func, | |
real, intent(in) | x1, | ||
real, intent(in) | x2, | ||
real, intent(out) | root, | ||
integer, intent(out) | error, | ||
real, dimension(:), intent(in), optional | plist, | ||
real, intent(in), optional | xm, | ||
integer, intent(out), optional | iterations | ||
) |
◆ getroot_generic()
|
private |
◆ getroot_king()
subroutine, public roots::getroot_king | ( | func, | |
real, intent(in) | x1, | ||
real, intent(in) | x2, | ||
real, intent(out) | root, | ||
integer, intent(out) | error, | ||
real, dimension(:), intent(in), optional | plist, | ||
real, intent(in), optional | xm, | ||
integer, intent(out), optional | iterations | ||
) |
◆ getroot_newton()
subroutine, public roots::getroot_newton | ( | funcd, | |
real, intent(in) | x1, | ||
real, intent(in) | x2, | ||
real, intent(out) | root, | ||
integer, intent(out) | error, | ||
real, dimension(:), intent(in), optional | plist, | ||
real, intent(in), optional | xm, | ||
integer, intent(out), optional | iterations | ||
) |
◆ getroot_pegasus()
subroutine, public roots::getroot_pegasus | ( | func, | |
real, intent(in) | x1, | ||
real, intent(in) | x2, | ||
real, intent(out) | root, | ||
integer, intent(out) | error, | ||
real, dimension(:), intent(in), optional | plist, | ||
real, intent(in), optional | xm, | ||
integer, intent(out), optional | iterations | ||
) |
◆ getroot_regulafalsi()
subroutine, public roots::getroot_regulafalsi | ( | func, | |
real, intent(in) | x1, | ||
real, intent(in) | x2, | ||
real, intent(out) | root, | ||
integer, intent(out) | error, | ||
real, dimension(:), intent(in), optional | plist, | ||
real, intent(in), optional | xm, | ||
integer, intent(out), optional | iterations | ||
) |
◆ getroot_ridder()
subroutine, public roots::getroot_ridder | ( | func, | |
real, intent(in) | x1, | ||
real, intent(in) | x2, | ||
real, intent(out) | root, | ||
integer, intent(out) | error, | ||
real, dimension(:), intent(in), optional | plist, | ||
real, intent(in), optional | xm, | ||
integer, intent(out), optional | iterations | ||
) |
◆ initroots()
pure subroutine, public roots::initroots | ( | type(roots_typ), intent(inout) | this, |
real, intent(in) | x1, | ||
real, intent(in) | x2, | ||
real, intent(in) | f1, | ||
real, intent(in) | f2, | ||
real, intent(in), optional | dxacc, | ||
integer, intent(in), optional | maxiter | ||
) |
◆ linearinterpolation()
|
private |
◆ saveinversequadraticinterpolation()
|
private |
◆ step_andersonbjoerk()
|
private |
◆ step_arithmeticmean()
|
private |
◆ step_bisection()
|
private |
◆ step_brentdekker()
|
private |
◆ step_king()
|
private |
◆ step_newton()
|
private |
◆ step_pegasus()
|
private |
◆ step_regulafalsi()
|
private |
◆ step_ridder()
|
private |
◆ step_secantmethod()
|
private |
◆ testconvergence()
|
private |
◆ updatebounds_bisection()
|
private |
Variable Documentation
◆ default_accuracy
real, parameter, public roots::default_accuracy = 4*EPSILON(DEFAULT_ACCURACY) |
◆ default_max_iterations
integer, parameter, public roots::default_max_iterations = 1000 |
◆ error_message
|
private |