TomichTDMASolve Method
Solves a tridiagonal system A·x = d using the Thomas algorithm (modified Gaussian elimination).
The arrays c and d are modified in place during the computation.
Definition
Namespace: DWSIM.UnitOperations.UnitOperations.Auxiliary.SepOps.SolvingMethods
Assembly: DWSIM.UnitOperations (in DWSIM.UnitOperations.dll) Version: 10.0.0.0
The solution vector x.
Assembly: DWSIM.UnitOperations (in DWSIM.UnitOperations.dll) Version: 10.0.0.0
C#
public static double[] TDMASolve(
double[] a,
double[] b,
double[] c,
double[] d
)VB
Public Shared Function TDMASolve (
a As Double(),
b As Double(),
c As Double(),
d As Double()
) As Double()Parameters
- a Double
- Sub-diagonal coefficients (index 0 is unused).
- b Double
- Main-diagonal coefficients.
- c Double
- Super-diagonal coefficients (last element is unused). Modified in place.
- d Double
- Right-hand side vector. Modified in place.
Return Value
DoubleThe solution vector x.