pathsim.solvers.euler module

class pathsim.solvers.euler.EUF(*solver_args, **solver_kwargs)[source]

Bases: ExplicitSolver

Class that performs explicit (forward) euler integration it holds the state and implements the timestep update.

Use this only if the function to integrate is super smooth or multistep/multistage methods cant be used.

step(u, t, dt)[source]

performs the explicit forward timestep for (t+dt) based on the state and input at (t)

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

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

  • dt (float) – integration timestep

Returns:

  • success (bool) – timestep was successful

  • err (float) – truncation error estimate

  • scale (float) – timestep rescale from error controller

class pathsim.solvers.euler.EUB(*solver_args, **solver_kwargs)[source]

Bases: ImplicitSolver

Class that performs implicit (backward) euler integration it holds the state and implements the solution of the implicit update equation at each timestep.

Its an absolute classic and ok for moderately stiff problems that dont require super high accuracy.

solve(u, t, dt)[source]

Solves the implicit update equation using the internal optimizer.

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