qmat.playgrounds.tibo.imex

Classes

DiffOpIMEX

Base class for an IMEX differential operator

CoeffSolverIMEX

Coefficient based solver class for IMEX differential operators.

Module Contents

class DiffOpIMEX(u0)[source]
Inheritance diagram of qmat.playgrounds.tibo.imex.DiffOpIMEX

Base class for an IMEX differential operator

abstractmethod evalF2(u: numpy.ndarray, t: float, out: numpy.ndarray)[source]

Evaluate f_EX(u,t) and store the result into out

class CoeffSolverIMEX(diffOp, tEnd=1, nSteps=1, t0=0)[source]
Inheritance diagram of qmat.playgrounds.tibo.imex.CoeffSolverIMEX

Coefficient based solver class for IMEX differential operators.

diffOp: DiffOpIMEX = None

Differential Operator implementing \(f(u,t)\).

evalF2(u: numpy.ndarray, t: float, out: numpy.ndarray)[source]
solve(QI, wI, QE, wE, uNum=None)[source]

Solve the ODE considering lower-triangular \(Q\) coefficients.

This is equivalent to the classical implementation of a generic Runge-Kutta method using its Butcher table. For each time-step, it defines a node solution (or stage) \(u_{m}\) that is solved using previously computed node solution :

\[u_{m} - \Delta{t}q_{m,m}f(u_m,t_m) = u_0 + \Delta{t}\sum_{j=1}^{m-1}q_{m,j}f(u_j, t_j),\]

where \(t_m = t_0 + \tau_m\) and \(q_{i,j}\) are the coefficients \(Q\). Finally, the step update is done using all computed node solutions :

\[u(t_0+\Delta{t}) \simeq u_0 + \sum_{m=1}^{M} \omega_{m} f(u_m, t_m),\]

where \(\omega_{m}\) are the weights associated to the \(Q\)-coefficients. If no weights are provided, then it simply uses the last node solution for the step update :

\[u(t_0+\Delta{t}) \simeq u_M\]
Parameters:
  • Q (np.2darray-like) – The lower-triangular \(Q\)-coefficients matrix.

  • weights (np.1darray-like) – The associated :math:omega_{m}` weights. If not provided, use the last node solution for the update (requires \(\tau_{M} = 1\)).

  • uNum (np.ndarray, optional) – Array of shape (nSteps+1,*uShape), that can be use to store the result and avoid creating it internally. The default is None.

  • tInit (float, optional) – Initial time offset to be added to solver’s own t0 for successive solve calls. The default is 0.

Returns:

uNum – Array of shape (nSteps+1,*uShape) that stores the solution at each time-step.

Return type:

np.ndarray