solve_ieu: Solve ODE System by Implicite Euler Scheme

View source: R/RcppExports.R

solve_ieuR Documentation

Solve ODE System by Implicite Euler Scheme

Description

The system is defined as M*dx/dt=a*x+s where M is a diagonal matrix given by its diagonal vector M (which has a form of matrix for term-by-term multiplication with x0) In discrete terms (M/dt_i-a)*x_i=(M/dt_i)*x_(i-1)+s_i The rmumps matrix (M/dt_i-a) is stored in list ali as XPtr<Rmumps> or a plain dense inverted matrix. Calculations are done in-place so s is modified and contains the solution on exit. The others parameters are not modified.

Usage

solve_ieu(invdt, x0_, M, ali, s, ilua)

Arguments

invdt

A numeric vactor, represents 1/dt

x0_

A numeric matrix or NULL, is the starting value at t0 (NULL means 0)

M

A numeric matrix representing diagonal terms (masses)

ali

A list of matrices or Rmumps objects

s

A 3d numeric array, is the source term, its last margin corresponds to time. s[,,i] can be a matrix or a vector(== 1-column matrix)

ilua

An integer vector, ilua[i] gives the list index in ali for a given dt_i. In such a way, ali may be shorter than time points.

Value

None


multbxxc documentation built on June 27, 2024, 1:06 a.m.