Van_der_Pol_implicit#
- 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 (
sequenceofarray_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 ifnanvalues arise.crash_at_maxiter (
bool, optional) – Indicates whether Newton’s method should stop if maximum number of iterationsnewton_maxiteris reached.relative_tolerance (
bool, optional) – Use a relative or absolute tolerance for the Newton solver
- Variables:
work_counters (
WorkCounter) – Counts different things, here: Number of evaluations of the right-hand side ineval_fand number of Newton calls in each Newton iterations are counted.
- 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 (
np.1darray) – The Newton update.
- solve_system(rhs, dt, u0, t)[source]#
Simple Newton solver for the nonlinear system.
- Parameters:
- Returns:
u (
dtype_u) – The solution u.
- 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 (
dtype_u) – Approximate exact solution.