Functions | |
template<typename T , typename Functor > | |
std::pair< T, T > | NewtonSolve (const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &func, const std::string &caller_name, const unsigned int max_its=100) |
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z. More... | |
template<typename T , typename Functor1 , typename Functor2 > | |
void | NewtonSolve2D (const T &f, const T &g, const Real x0, const Real y0, T &x_final, T &y_final, const Real f_tol, const Real g_tol, const Functor1 &func1, const Functor2 &func2, const unsigned int max_its=100) |
NewtonSolve2D does a 2D Newton Solve to solve for the x and y such that: f = func1(x, y) and g = func2(x, y). More... | |
std::pair<T, T> FluidPropertiesUtils::NewtonSolve | ( | const T & | x, |
const T & | y, | ||
const Real | z_initial_guess, | ||
const Real | tolerance, | ||
const Functor & | func, | ||
const std::string & | caller_name, | ||
const unsigned int | max_its = 100 |
||
) |
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z.
[in] | x | constant first argument of the f(x, z) term |
[in] | y | constant which should be equal to f(x, z) with a converged z |
[in] | z_initial_guess | initial guess for return variables |
[in] | tolerance | criterion for relative or absolute (if y is sufficiently close to zero) convergence checking |
[in] | function | two-variable function returning both values and derivatives as references |
[in] | caller_name | name of the fluid properties appended to name of the routine calling the method |
[in] | max_its | the maximum number of iterations for Newton's method |
Definition at line 43 of file NewtonInversion.h.
Referenced by TabulatedFluidProperties::e_from_v_h(), TemperaturePressureFunctionFluidProperties::p_from_v_e(), Water97FluidProperties::p_from_v_e_template(), Water97FluidProperties::T_drhodT_from_p_rho(), HelmholtzFluidProperties::T_from_p_h(), TemperaturePressureFunctionFluidProperties::T_from_p_h(), TabulatedFluidProperties::T_from_p_h(), SimpleFluidProperties::T_from_p_h(), NaKFluidProperties::T_from_p_rho(), TemperaturePressureFunctionFluidProperties::T_from_p_rho(), TabulatedFluidProperties::T_from_p_rho(), TabulatedFluidProperties::T_from_p_s(), and TEST().
void FluidPropertiesUtils::NewtonSolve2D | ( | const T & | f, |
const T & | g, | ||
const Real | x0, | ||
const Real | y0, | ||
T & | x_final, | ||
T & | y_final, | ||
const Real | f_tol, | ||
const Real | g_tol, | ||
const Functor1 & | func1, | ||
const Functor2 & | func2, | ||
const unsigned int | max_its = 100 |
||
) |
NewtonSolve2D does a 2D Newton Solve to solve for the x and y such that: f = func1(x, y) and g = func2(x, y).
This is done for example in the constant of (v, e) to (p, T) variable set conversion.
[in] | f | target value for func1 |
[in] | g | target value for func2 |
[in] | x0 | initial guess for first output variable |
[in] | y0 | initial guess for second output variable |
[out] | x_final | output for first variable |
[out] | y_final | output for second variable |
[in] | f_tol | criterion for relative or absolute (if f is sufficently close to zero) convergence checking |
[in] | g_tol | criterion for relative or absolute (if g is sufficently close to zero) convergence checking |
[in] | func1 | two-variable function returning both values and derivatives as references |
[in] | func2 | two-variable function returning both values and derivatives as references |
[in] | max_its | the maximum number of iterations for Newton's method |
Definition at line 125 of file NewtonInversion.h.
Referenced by SinglePhaseFluidProperties::p_T_from_h_s(), SinglePhaseFluidProperties::p_T_from_v_e(), SinglePhaseFluidProperties::p_T_from_v_h(), and TEST().