solve_with_known
- compas.numerical.solve_with_known(A, b, x, known)[source]
Solve a system of linear equations with part of solution known.
- Parameters
A (array) – Coefficient matrix represented as an (m x n) array.
b (array) – Right-hand-side represented as an (m x 1) array.
x (array) – Unknowns/knowns represented as an (n x 1) array.
known (list) – The indices of the known elements of
x
.
- Returns
array ((n x 1) vector solution.)
Notes
Computes the solution of the system of linear equations.
\[\mathbf{A} \mathbf{x} = \mathbf{b}\]Examples
>>> A = array([[2, 1, 3], [2, 6, 8], [6, 8, 18]]) >>> b = array([[1], [3], [5]]) >>> x = array([[0.3], [0], [0]]) >>> solve_with_known(A, b, x, [0]) array([[ 3.00000000e-01], [ 4.00000000e-01], [-6.05576195e-17]])