TABLE OF CONTENTS
- 1. /findZero
/findZero [ Modules ]
NAME
module findZero
PURPOSE
- This module includes routines to find roots of functions, i.e. the x for which f(x)=0.
METHODS
findZero/newton_findZero [ Functions ]
[ Top ] [ findZero ] [ Functions ]
NAME
function newton_findZero(f, start,accuracy,maxSteps,success) result(zero)
PURPOSE
- This function evaluates the root of the function "f", i.e. the x for which f(x)=0.
- Uses a simple Newton algorithm. Not suited for several roots!!
INPUTS
- real, external :: f -- external function
- real, intent(in) :: start, accuracy -- starting value and accuracy for the zero
- integer, intent(in) :: maxSteps -- maximal number of iterations
Output * The return value of the function is the root itself * logical, intent(out) :: success -- "true" if the search was succesful, else "false"
findZero/bisection_findZero [ Functions ]
[ Top ] [ findZero ] [ Functions ]
NAME
function bisection_findZero(f, a,b,accuracy,maxSteps,success) result(zero)
PURPOSE
- This function evaluates the root of the function "f" on the interval (a,b) , i.e. the x for which f(x)=0.
- Uses a simple bisection algorithm. Not suited for several roots!!
- Works best if f(a)*f(b)<0. If not, then the computation time is increasing.
INPUTS
- real, external :: f -- external function
- real, intent(in) :: a,b -- defines the search range a<x<b
- real, intent(in) :: accuracy -- accuracy for the zero
- integer, intent(in) :: maxSteps -- maximal number of iterations
Output * The return value of the function is the root itself * logical, intent(out) :: success -- "true" if the search was succesful, else "false"