Brent's method is used to find the root of a function f(x), i.e., find x such that f(x) = 0. More...
Functions | |
void | bracket (std::function< Real(Real)> const &f, Real &x1, Real &x2) |
Function to bracket a root of a given function. More... | |
Real | root (std::function< Real(Real)> const &f, Real x1, Real x2, Real tol=1.0e-12) |
Finds the root of a function using Brent's method. More... | |
Brent's method is used to find the root of a function f(x), i.e., find x such that f(x) = 0.
First, brackets x1 and x2 are found such that f(x) changes sign between x1 and x2, implying that there is a root between the points.
Function to bracket a root of a given function.
Adapted from Numerical Recipes in C
f | reference to function to find bracketing interval | |
[out] | x1 | reference one bound |
[out] | x2 | reference to other bound |
Increment counter
Increment counter
Definition at line 17 of file BrentsMethod.C.
Referenced by CaloricallyImperfectGas::rho_from_p_s(), HelmholtzFluidProperties::rho_from_p_T(), CO2FluidProperties::rho_from_p_T(), CaloricallyImperfectGas::setupLookupTables(), GeochemicalModelInterrogator::solveForT(), and TEST().
Real BrentsMethod::root | ( | std::function< Real(Real)> const & | f, |
Real | x1, | ||
Real | x2, | ||
Real | tol = 1.0e-12 |
||
) |
Finds the root of a function using Brent's method.
Adapted from Numerical Recipes in C
f | reference to function to find root of |
x1 | one end of bracketing interval |
x2 | other end of bracketing interval |
tolerance | root finding tolerance (default is 1e-12) |
Definition at line 66 of file BrentsMethod.C.
Referenced by InterWrapper1PhaseProblem::computeWijFromSolve(), SubChannel1PhaseProblem::computeWijFromSolve(), ParameterStudyAction::inferMultiAppMode(), InterWrapper1PhaseProblem::petscSnesSolver(), SubChannel1PhaseProblem::petscSnesSolver(), PolycrystalHex::precomputeGrainStructure(), CaloricallyImperfectGas::rho_from_p_s(), HelmholtzFluidProperties::rho_from_p_T(), CO2FluidProperties::rho_from_p_T(), CaloricallyImperfectGas::setupLookupTables(), TEST(), and testExceptionMessage().