bice.time_steppers package
Submodules
bice.time_steppers.bdf module
Backward Differentiation Formula (BDF) time-stepping schemes.
- class BDF(problem: Problem, dt_max: float = inf)
Bases:
TimeStepperVariable-order Backward Differentiation Formula (BDF) scheme.
A wrapper around scipy.integrate.BDF for adaptive time-stepping with variable order.
Initialize the adaptive BDF time-stepper.
- Parameters:
problem – The problem instance to solve.
dt_max – Maximum allowed time step size.
- atol
absolute tolerance for the solver
- dt_max
maximum allowed time step size
- factory_reset() None
Reset the underlying scipy BDF solver instance.
Useful when the problem state changes significantly.
- problem
reference to the problem
- rtol
relative tolerance for the solver
- class BDF2(dt: float = 0.001)
Bases:
TimeStepperSecond-order Backward Differentiation Formula (BDF2) scheme.
An implicit method for the numerical solution of ordinary differential equations. It is particularly well-suited for stiff systems.
Initialize the BDF2 time-stepper.
- Parameters:
dt – The time step size.
- order
the order of the scheme
bice.time_steppers.runge_kutta module
Runge-Kutta time-stepping schemes.
- class RungeKutta4(dt: float = 0.01)
Bases:
TimeStepperClassical fourth-order Runge-Kutta (RK4) scheme.
A popular fourth-order method for the numerical solution of ordinary differential equations.
Initialize the time-stepper.
- Parameters:
dt – The time step size.
- class RungeKuttaFehlberg45(dt: float = 0.01, error_tolerance: float = 0.001)
Bases:
TimeStepperRunge-Kutta-Fehlberg (RKF45) scheme with adaptive step size.
Local truncation error is estimated by comparison of RK4 and RK5 schemes, which is then used to determine the optimal step size for the next step.
Initialize the RKF45 time-stepper.
- Parameters:
dt – The initial time step size.
error_tolerance – The local truncation error tolerance for adaptive stepping.
- error_tolerance
Local truncation error tolerance
- max_rejections
Maximum number of iterations when steps are rejected
- rejection_count
counter for the number of rejections in current step
bice.time_steppers.time_steppers module
Base classes for time-stepping algorithms.
- class Euler(dt: float = 0.01)
Bases:
TimeStepperExplicit Euler (Forward Euler) scheme.
A first-order numerical procedure for solving ordinary differential equations with a given initial value.
Initialize the time-stepper.
- Parameters:
dt – The time step size.
- class ImplicitEuler(dt: float = 0.01)
Bases:
TimeStepperImplicit Euler (Backward Euler) scheme.
A first-order implicit method for solving ordinary differential equations, offering better stability for stiff systems compared to the explicit Euler method.
Initialize the time-stepper.
- Parameters:
dt – The time step size.
Module contents
Time-stepping schemes for numerical integration.
This package provides various explicit and implicit time-stepping methods for solving Cauchy-type equations, including Euler schemes, Runge-Kutta, and Backward Differentiation Formulae (BDF).
- class BDF(problem: Problem, dt_max: float = inf)
Bases:
TimeStepperVariable-order Backward Differentiation Formula (BDF) scheme.
A wrapper around scipy.integrate.BDF for adaptive time-stepping with variable order.
Initialize the adaptive BDF time-stepper.
- Parameters:
problem – The problem instance to solve.
dt_max – Maximum allowed time step size.
- atol
absolute tolerance for the solver
- bdf: BDF | None
- dt_max
maximum allowed time step size
- factory_reset() None
Reset the underlying scipy BDF solver instance.
Useful when the problem state changes significantly.
- problem
reference to the problem
- rtol
relative tolerance for the solver
- class BDF2(dt: float = 0.001)
Bases:
TimeStepperSecond-order Backward Differentiation Formula (BDF2) scheme.
An implicit method for the numerical solution of ordinary differential equations. It is particularly well-suited for stiff systems.
Initialize the BDF2 time-stepper.
- Parameters:
dt – The time step size.
- order
the order of the scheme
- class Euler(dt: float = 0.01)
Bases:
TimeStepperExplicit Euler (Forward Euler) scheme.
A first-order numerical procedure for solving ordinary differential equations with a given initial value.
Initialize the time-stepper.
- Parameters:
dt – The time step size.
- class ImplicitEuler(dt: float = 0.01)
Bases:
TimeStepperImplicit Euler (Backward Euler) scheme.
A first-order implicit method for solving ordinary differential equations, offering better stability for stiff systems compared to the explicit Euler method.
Initialize the time-stepper.
- Parameters:
dt – The time step size.
- class RungeKutta4(dt: float = 0.01)
Bases:
TimeStepperClassical fourth-order Runge-Kutta (RK4) scheme.
A popular fourth-order method for the numerical solution of ordinary differential equations.
Initialize the time-stepper.
- Parameters:
dt – The time step size.
- class RungeKuttaFehlberg45(dt: float = 0.01, error_tolerance: float = 0.001)
Bases:
TimeStepperRunge-Kutta-Fehlberg (RKF45) scheme with adaptive step size.
Local truncation error is estimated by comparison of RK4 and RK5 schemes, which is then used to determine the optimal step size for the next step.
Initialize the RKF45 time-stepper.
- Parameters:
dt – The initial time step size.
error_tolerance – The local truncation error tolerance for adaptive stepping.
- error_tolerance
Local truncation error tolerance
- max_rejections
Maximum number of iterations when steps are rejected
- rejection_count
counter for the number of rejections in current step