4.5.4 pde.solvers.crank_nicolson module

Defines a Crank-Nicolson solver.

class CrankNicolsonSolver(pde, *, maxiter=100, maxerror=0.0001, explicit_fraction=0, backend='auto')[source]

Bases: SolverBase

Crank-Nicolson solver.

Parameters:
  • pde (PDEBase) – The partial differential equation that should be solved

  • maxiter (int) – Maximum number of iterations for the implicit solver

  • maxerror (float) – Maximum error tolerance for the implicit solver

  • explicit_fraction (float) – Fraction of explicit time stepping (0 for fully implicit)

  • backend (str) – The backend used for numerical operations

name = 'crank-nicolson'