pde_matrix_solve: Solve the implicit-timestep linear system

View source: R/matrix.R

pde_matrix_solveR Documentation

Solve the implicit-timestep linear system

Description

Solve the linear system A x = rhs arising from one implicit finite-difference timestep, where A is the matrix assembled by construct_tridiagonals and b is the vector of price space-grid values from the previously calculated timestep (which corresponds to one step further in our future).

Usage

pde_matrix_solve(tridiag_matrix_entries, rhs, method = "auto")

Arguments

tridiag_matrix_entries

Diagonal, superdiagonal and subdiagonal of the matrix from the numerical integrator, as a list with elements sub, diag and super (see construct_tridiagonals)

rhs

A vector forming the right-hand side of the linear system, typically the space grid values from the previously calculated timestep

method

Character string selecting the linear-system solver. One of 'lapack' (use limSolve::Solve.tridiag(), LAPACK DGTSV), 'banded' (assemble a sparse banded matrix and solve with the Matrix package) or 'thomas' (a pure-R Thomas tridiagonal solve, always available). Any other value (including the default 'auto') selects the first available method in that same logical order.

Details

By default (method='auto') the solver prefers limSolve::Solve.tridiag(), which calls LAPACK DGTSV Gaussian elimination with partial pivoting, then falls back to a sparse banded solve from the Matrix package, and finally to a pure-R Thomas algorithm that requires no additional packages. Passing an explicit method forces that solver; forcing 'lapack' or 'banded' requires the corresponding package to be installed.

Value

The solution vector x of the linear system

See Also

Other Implicit Grid Solver: construct_implicit_grid_structure(), find_present_value(), form_present_value_grid(), infer_conforming_time_grid(), integrate_pde(), iterate_grid_from_timestep(), take_implicit_timestep(), timestep_instruments()


ragtop documentation built on June 20, 2026, 5:06 p.m.