AddKnownsToLinearSystem#
This module deals with solving a linear system A*u=b when some values of the vector u is already known. The module will modify the linear system according to the known values.
Detailed Description
This module takes 3 inputs:
LHS Matrix is an NxN Matrix (must be a SparseRowMatrix).
RHS Vector is the right hand side vector, an Nx1 Matrix.
X Vector is an Nx1 Matrix specifying the known variables in the linear system LHS. If the kth variable is known,
x(k)is its value, otherwisex(k)should be set NaN.
This module returns 2 outputs:
OutPutLHSMatrix is an NxN Matrix.
OutPutRHSVector is an Nx1 Matrix.
The solution:
inv(A2)*b2
has the same value as x at the non-NaN positions.