6#ifndef CT_MULTINEWTON_H
7#define CT_MULTINEWTON_H
49 double boundStep(span<const double> x0, span<const double> step0,
119 int dampStep(span<const double> x0, span<const double> step0,
120 span<double> x1, span<double> step1,
double& s1,
151 void resize(
size_t points);
Newton iterator for multi-domain, one-dimensional problems.
double m_dampFactor
Factor by which the damping coefficient is reduced in each iteration.
size_t size()
Get the number of variables in the system.
void resize(size_t points)
Change the problem size.
vector< double > m_x
Work array holding the system state after the last successful step. Size m_n.
int dampStep(span< const double > x0, span< const double > step0, span< double > x1, span< double > step1, double &s1, SteadyStateSystem &r, int loglevel, bool writetitle)
Performs a damped Newton step to solve the system of nonlinear equations.
double m_elapsed
Elapsed CPU time spent computing the Jacobian.
vector< double > m_stp1
Work array holding the damped Newton step. Size m_n.
vector< double > m_stp
Work array holding the undamped Newton step or the system residual. Size m_n.
size_t m_maxDampIter
Maximum number of damping iterations.
int m_maxAge
Maximum allowable Jacobian age before it is recomputed.
void setOptions(int maxJacAge=5)
Set options.
double boundStep(span< const double > x0, span< const double > step0, const SteadyStateSystem &r, int loglevel)
Return the factor by which the undamped Newton step 'step0' must be multiplied in order to keep all s...
size_t m_n
number of variables
void step(span< const double > x, span< double > step, SteadyStateSystem &r, int loglevel)
Compute the undamped Newton step.
int solve(span< const double > x0, span< double > x1, SteadyStateSystem &r, int loglevel)
Find the solution to F(x) = 0 by damped Newton iteration.
Base class for representing a system of differential-algebraic equations and solving for its steady-s...
Namespace for the Cantera kernel.