implementations.problem_classes.nonlinear_ODE_1 module¶
- class nonlinear_ODE_1(u0=0.0, newton_maxiter=200, newton_tol=5e-11, stop_at_nan=True)[source]¶
Bases:
ProblemThis class implements a simple nonlinear ODE with a singularity in the derivative, taken from https://www.osti.gov/servlets/purl/6111421 (Problem E-4). For \(0 \leq t \leq 5\), the problem is given by
\[\frac{du(t)}{dt} = \sqrt{1 - u(t)}\]with initial condition \(u(0) = 0\). The exact solution is
\[u(t) = t - \frac{t^2}{4}.\]- Parameters:
u0 (float, optional) – Initial condition.
newton_maxiter (float, optional) – Maximum number of iterations for Newton’s method.
newton_tol (float, optional) – Tolerance for Newton’s method to terminate.
stop_at_nan (bool, optional) – Indicates that Newton solver has to stop if
nanvalues arise.
- newton_itercount¶
Counts the Newton iterations.
- Type:
int
- newton_ncalls¶
Counts calls of Newton method.
- Type:
int
- dtype_f¶
alias of
mesh
- dtype_u¶
alias of
mesh