Time stepping

Module for solving differential algebraic systems and transient PDEs.

The ‘dae’ module includes time integration methods (Runge-Kutta and multistep methods) for solving coupled ordinary differential equations. The differential equations must be specified in implicit form. In principle, one can choose different integrators for different fields; however, the number and position of the stages must be compatible, as currently only a fully monolithic solution is implemented. Additionally, differential-algebraic systems can be solved. When algebraic equations are present, only integrators with exclusively implicit stages should be used.

Furthermore, by using the keyword ‘call pde’, it is possible to solve time-dependent PDEs (currently, only time integrators with a single stage). The mechanism works by endowing the nodal degrees of freedom with discrete values and derivatives as functions of time using the chosen time discretization rules. The spatial discretization can be carried out using the same ansatz (for example, isoparametric finite elements) as in time-independent problems. In the case of backward Euler and spatial FE ansatz functions, this would appear as follows:

\(\Theta = \sum_{I=1}^{N} \Theta_I\left(t\right) N_I\left(\boldsymbol{x}\right)\),

where \(N_I\left(\boldsymbol{x}\right)\) are the FE ansatz functions and \(\Theta_I\left(t\right)\) represent the nodal degrees of freedom. The given PDE is then solved at the step \(t_{n+1}\) , where the time derivative of the nodal degrees of freedom is defined by a custom_jvp rule as \(\frac{\partial\Theta_I}{\partial t}\vert_{t_{n+1}} = \frac{\Theta_I\left(t_{n+1}\right) - \Theta_I\left(t_n\right)}{\Delta t}\). In the ‘call pde’ mode, one should currently not use jacrev w.r.t. the time.

WARNING: This module is currently under development and lacks detailed documentation. However, some example notebooks are already available.

Central class

TimeSteppingManager(static_settings[, ...])

Manages the time stepping procedure for a simulation using multi-stage integration schemes.

TimeSteppingManager.run(dofs, dt0, t_max, ...)

Executes the time stepping loop for the simulation.

TimeSteppingManagerState(q, settings, ...)

State for the TimeSteppingManager.

Time integrators

TimeIntegrator(name, value_and_derivatives, ...)

Base class for time integrators.

BackwardEuler()

Backward Euler method.

ForwardEuler()

Forward Euler method.

Newmark([gamma, beta])

Newmark-beta method.

AdamsMoulton(num_steps)

Adams-Moulton method.

AdamsBashforth(num_steps)

Adams-Bashforth time integrator.

BackwardDiffFormula(num_steps)

Backward differentiation formula (BDF).

ExplicitRungeKutta(num_stages)

Explicit Runge-Kutta method.

DiagonallyImplicitRungeKutta(num_stages)

Diagonally implicit Runge-Kutta method.

Kvaerno(order)

Kvaerno method (explicit first stage diagonally implicit Runge-Kutta with embedded error estimation).

DormandPrince(order)

Dormand-Prince method (explicit with embedded error estimation).

GaussLegendreRungeKutta(num_stages)

Gauss-Legendre Runge-Kutta method (fully implicit).

Helper functions

discrete_value_with_derivatives

Evaluate the discrete state value with custom derivative propagation.

detect_stage_dependencies(A)

Detects coupled structures (strongly connected components) in the Butcher matrix A and identifies explicit stages.

invert_butcher_with_order(A)

Computes the blockwise linear mapping matrix A_ that maps U to U_dot without inter-block coupling, and determines the execution order of the blocks.

Step size controllers

StepSizeController()

Abstract base class for adaptive step size controllers.

ConstantStepSizeController()

Constant Step Size Controller.

CSSControllerState(step_scaler, accept, ...)

State for the Constant Step Size Controller.

PIDController([pcoeff, icoeff, dcoeff, ...])

Proportional-Integral-Derivative (PID) Step Size Controller.

PIDControllerState(step_scaler, e_n, e_nn, ...)

State for the Proportional-Integral-Derivative Controller.

RootIterationController([target_niters, ...])

Root Iteration Controller for adjusting step size based on number of root solver iterations.

RootIterationControllerState(step_scaler, ...)

State for the Root Iteration Controller.

Data saving policies

SavePolicy()

Abstract base class for save strategies.

HistoryState(t, q, user)

Container for storing the history state data.

SaveNothingPolicy()

A policy that does not save any data.

SaveEquidistantPolicy([num_points, tol])

Saves data at (approximately) equidistant time points using pre-allocated arrays.

SaveEquidistantHistoryState(t_max, ...)

State for the SaveAllPolicy.

SaveAllPolicy()

Saves data at every accepted time step.

SaveAllHistoryState(t_max, max_steps, t, q, ...)

State for the SaveAllPolicy.

Rootsolvers compatible with the DAE module

RootSolverResult(root, num_iterations, converged)

newton_solver(func, x0[, atol, max_iter, ...])

Newton-Raphson solver to find a root of F(x)=0.