MCPcopy Create free account
hub / github.com/CoolProp/CoolProp / solve_limits

Method solve_limits

src/PolyMath.cpp:190–198  ·  view source on GitHub ↗

Uses the Brent solver to find the roots of p(x_in,y_in)-z_in @param res Poly2DResidual object to calculate residuals and derivatives @param min double value that represents the minimum value @param max double value that represents the maximum value

Source from the content-addressed store, hash-verified

188/// @param min double value that represents the minimum value
189/// @param max double value that represents the maximum value
190double Polynomial2D::solve_limits(Poly2DResidual* res, const double& min, const double& max) {
191 if (do_debug()) std::cout << format("Called solve_limits with: min=%f and max=%f", min, max) << '\n';
192 double macheps = DBL_EPSILON;
193 double tol = DBL_EPSILON * 1e3;
194 int maxiter = 10;
195 double result = Brent(res, min, max, macheps, tol, maxiter);
196 if (this->do_debug()) std::cout << "Brent solver message: " << res->errstring << '\n';
197 return result;
198}
199
200/// Uses the Newton solver to find the roots of p(x_in,y_in)-z_in
201/// @param res Poly2DResidual object to calculate residuals and derivatives

Callers 3

PolyMath.cppFile · 0.80
T_rhoMethod · 0.80
T_cMethod · 0.80

Calls 5

do_debugMethod · 0.95
Poly2DResidualClass · 0.85
Poly2DFracResidualClass · 0.85
formatFunction · 0.70
BrentFunction · 0.70

Tested by

no test coverage detected