Auzinger_implicit#

class auzinger(newton_maxiter=100, newton_tol=1e-12)[source]#

Bases: Problem

This class implements the Auzinger equation [1] as initial value problem. The system of two ordinary differential equations (ODEs) is given by

\[\frac{d y_1 (t)}{dt} = -y_2 (t) + y_1 (t) (1 - y^2_1 (t) - y^2_2 (t)),\]
\[\frac{d y_2 (t)}{dt} = y_1 (t) + 3 y_2 (t) (1 - y^2_1 (t) - y^2_2 (t))\]

with initial condition \((y_1(t), y_2(t))^T = (1, 0)^T\) for \(t \in [0, 10]\). The exact solution of this problem is

\[(y_1(t), y_2(t))^T = (\cos(t), \sin(t))^T.\]
Parameters:
  • newton_maxiter (int, optional) – Maximum number of iterations for Newton’s method.

  • newton_tol (float, optional) – Absolute tolerance for Newton’s method to terminate, applied to the maximum norm of the residual.

References

dtype_f#

alias of mesh

dtype_u#

alias of mesh

eval_f(u, t)[source]#

Routine to compute the right-hand side of the problem for both components simultaneously.

Parameters:
  • u (dtype_u) – Current values of the numerical solution.

  • t (float) – Current time of the numerical solution is computed (not used here).

Returns:

f (dtype_f) – The right-hand side of the problem (contains two components).

solve_system(rhs, dt, u0, t)[source]#

Simple Newton solver for the nonlinear system.

Parameters:
  • rhs (dtype_f) – Right-hand side for the nonlinear system.

  • dt (float) – Abbrev. for the node-to-node stepsize (or any other factor required).

  • u0 (dtype_u) – Initial guess for the iterative solver.

  • t (float) – Current time (e.g. for time-dependent BCs.)

Returns:

u (dtype_u) – The solution as mesh.

u_exact(t)[source]#

Routine to compute the exact solution at time \(t\).

Parameters:

t (float) – Time of the exact solution.

Returns:

me (dtype_u) – The exact solution.