implementations.problem_classes.Van_der_Pol_implicit module¶
- class vanderpol(u0=None, mu=5.0, newton_maxiter=100, newton_tol=1e-09, stop_at_nan=True, crash_at_maxiter=True, relative_tolerance=False)[source]¶
Bases:
ProblemStiff Van der Pol oscillator as a system of two first-order ODEs, fully implicit with Newton.
It is given by the equation
\[\frac{d^2 u(t)}{d t^2} - \mu (1 - u(t)^2) \frac{d u(t)}{dt} + u(t) = 0.\]- Parameters:
u0 (sequence of array_like, optional) – Initial condition.
mu (float, optional) – Stiff parameter \(\mu\).
newton_maxiter (int, optional) – Maximum number of iterations for Newton’s method to terminate.
newton_tol (float, optional) – Tolerance for Newton to terminate.
stop_at_nan (bool, optional) – Indicate whether Newton’s method should stop if
nanvalues arise.crash_at_maxiter (bool, optional) – Indicates whether Newton’s method should stop if maximum number of iterations
newton_maxiteris reached.relative_tolerance (bool, optional) – Use a relative or absolute tolerance for the Newton solver
- work_counters¶
Counts different things, here: Number of evaluations of the right-hand side in
eval_fand number of Newton calls in each Newton iterations are counted.- Type:
- dtype_f¶
alias of
mesh
- dtype_u¶
alias of
mesh
- solve_jacobian(rhs, dt, u, **kwargs)[source]¶
Solve the linear system with the Jacobian of the Newton function \(g(u) = u - dt f(u) - rhs\) of
solve_system, by applying the analytically computed inverse of the \(2 \times 2\) Jacobian atu.- Parameters:
rhs (np.1darray) – Right-hand side of the linear system, i.e., the Newton residual.
dt (float) – Abbrev. for the node-to-node stepsize (or any other factor required).
u (dtype_u) – Current Newton iterate, at which the Jacobian is evaluated.
**kwargs – Not used.
- Returns:
du – The Newton update.
- Return type:
np.1darray
- solve_system(rhs, dt, u0, t)[source]¶
Simple Newton solver for the nonlinear system.
- Parameters:
- Returns:
u – The solution u.
- Return type:
- u_exact(t, u_init=None, t_init=None)[source]¶
Routine to approximate the exact solution at time t by
SciPyor give initial conditions when called at \(t=0\).- Parameters:
t (float) – Current time.
u_init (pySDC.problem.vanderpol.dtype_u) – Initial conditions for getting the exact solution.
t_init (float) – The starting time.
- Returns:
me – Approximate exact solution.
- Return type: