qmat.playgrounds.tibo.imex ========================== .. py:module:: qmat.playgrounds.tibo.imex Classes ------- .. autoapisummary:: qmat.playgrounds.tibo.imex.DiffOpIMEX qmat.playgrounds.tibo.imex.CoeffSolverIMEX Module Contents --------------- .. py:class:: DiffOpIMEX(u0) .. autoapi-inheritance-diagram:: qmat.playgrounds.tibo.imex.DiffOpIMEX :parts: 1 Base class for an IMEX differential operator .. py:method:: evalF2(u: numpy.ndarray, t: float, out: numpy.ndarray) :abstractmethod: Evaluate f_EX(u,t) and store the result into out .. py:class:: CoeffSolverIMEX(diffOp, tEnd=1, nSteps=1, t0=0) .. autoapi-inheritance-diagram:: qmat.playgrounds.tibo.imex.CoeffSolverIMEX :parts: 1 Coefficient based solver class for IMEX differential operators. .. py:attribute:: diffOp :type: DiffOpIMEX :value: None Differential Operator implementing :math:`f(u,t)`. .. py:method:: evalF2(u: numpy.ndarray, t: float, out: numpy.ndarray) .. py:method:: solve(QI, wI, QE, wE, uNum=None) Solve the ODE considering **lower-triangular** :math:`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) :math:`u_{m}` that is solved using previously computed node solution : .. math:: 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 :math:`t_m = t_0 + \tau_m` and :math:`q_{i,j}` are the coefficients :math:`Q`. Finally, the **step update** is done using all computed node solutions : .. math:: u(t_0+\Delta{t}) \simeq u_0 + \sum_{m=1}^{M} \omega_{m} f(u_m, t_m), where :math:`\omega_{m}` are the weights associated to the :math:`Q`-coefficients. If no weights are provided, then it simply uses the last node solution for the step update : .. math:: u(t_0+\Delta{t}) \simeq u_M :Parameters: * **Q** (*np.2darray-like*) -- The **lower-triangular** :math:`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 :math:`\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. :rtype: np.ndarray