pathsim.solvers.bdf module

class pathsim.solvers.bdf.BDF(*solver_args, **solver_kwargs)[source]

Bases: ImplicitSolver

Base class for the backward differentiation formula (BDF) integrators.

Notes

This solver class is not intended to be used directly

x_0

internal ‘working’ initial value

Type:

numeric, array[numeric]

x

internal ‘working’ state

Type:

numeric, array[numeric]

n

order of integration scheme

Type:

int

s

number of internal intermediate stages

Type:

int

stage

counter for current intermediate stage

Type:

int

eval_stages

rations for evaluation times of intermediate stages

Type:

list[float]

opt

optimizer instance to solve the implicit update equation

Type:

NewtonAnderson, Anderson, etc.

K

bdf coefficients for the state buffer for each order

Type:

dict[int: list[float]]

F

bdf coefficients for the function ‘func’ for each order

Type:

dict[int: float]

B

buffer for previous states

Type:

list[numeric], list[array[numeric]]

reset()[source]

“Resets integration engine to initial state.

buffer(dt)[source]

buffer the state for the multistep method

Parameters:

dt (float) – integration timestep

solve(u, t, dt)[source]

Solves the implicit update equation using the optimizer of the engine.

Parameters:
  • u (numeric, array[numeric]) – function ‘func’ input value

  • t (float) – evaluation time of function ‘func’

  • dt (float) – integration timestep

Returns:

err – residual error of the fixed point update equation

Return type:

float

class pathsim.solvers.bdf.BDF2(*solver_args, **solver_kwargs)[source]

Bases: BDF

2-nd order backward differentiation formula with order ramp up for the initial steps.

class pathsim.solvers.bdf.BDF3(*solver_args, **solver_kwargs)[source]

Bases: BDF

3-rd order backward differentiation formula with order ramp up for the initial steps.

class pathsim.solvers.bdf.BDF4(*solver_args, **solver_kwargs)[source]

Bases: BDF

4-th order backward differentiation formula with order ramp up for the initial steps.

class pathsim.solvers.bdf.BDF5(*solver_args, **solver_kwargs)[source]

Bases: BDF

5-th order backward differentiation formula with order ramp up for the initial steps.

class pathsim.solvers.bdf.BDF6(*solver_args, **solver_kwargs)[source]

Bases: BDF

6-th order backward differentiation formula with order ramp up for the initial steps.