OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
FindRoot.hpp File Reference

Newton-Raphson and Ridder root finders. More...

#include <functional>
Include dependency graph for FindRoot.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  openswmm
 
namespace  openswmm::findroot
 

Typedefs

using openswmm::findroot::NewtonFunc = std::function< void(double x, double *f, double *df)>
 Newton-Raphson with bisection fallback.
 
using openswmm::findroot::RidderFunc = std::function< double(double x)>
 Ridder's method (derivative-free).
 

Functions

int openswmm::findroot::newton (double x1, double x2, double *rts, double xacc, const NewtonFunc &func)
 
double openswmm::findroot::ridder (double x1, double x2, double xacc, const RidderFunc &func)
 

Variables

constexpr int openswmm::findroot::MAXIT = 60
 Maximum iterations.
 

Detailed Description

Newton-Raphson and Ridder root finders.

Numerically identical to legacy findroot.c. Used by:

  • Kinematic wave continuity equation solver
  • Cross-section depth-from-area inversion
  • Green-Ampt infiltration F2 solve
Note
Legacy reference: src/legacy/engine/findroot.c
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n MIT License