Last updated: 2023-03-16.
tf_quant_finance.math.pde.steppers.extrapolation.extrapolation_scheme#
Constructs extrapolation implicit-explicit scheme.
tf_quant_finance.math.pde.steppers.extrapolation.extrapolation_scheme(
value_grid, t1, t2, equation_params_fn
)
Performs two implicit half-steps, one full implicit step, and combines them with such coefficients that ensure second-order errors. More computationally expensive than Crank-Nicolson scheme, but provides a better approximation for high-wavenumber components, which results in absence of oscillations typical for Crank-Nicolson scheme in case of non-smooth initial conditions. See [1] for details.
References:#
[1]: D. Lawson, J & Ll Morris, J. The Extrapolation of First Order Methods for Parabolic Partial Differential Equations. I. 1978 SIAM Journal on Numerical Analysis. 15. 1212-1224. https://epubs.siam.org/doi/abs/10.1137/0715082
Args:#
value_grid: ATensorof real dtype. Grid of solution values at the current time.t1: Time before the step.t2: Time after the step.equation_params_fn: A callable that takes a scalarTensorargument representing time and constructs the tridiagonal matrixA(a tuple of threeTensors, main, upper, and lower diagonals) and the inhomogeneous termb. All of theTensors are of the samedtypeasinner_value_gridand of the shape broadcastable with the shape ofinner_value_grid.
Returns:#
A Tensor of the same shape and dtype a
values_grid and represents an approximate solution u(t2).