solve_cgs_lagrange#
- sectionproperties.analysis.solver.solve_cgs_lagrange(k_lg: csc_matrix, f: np.ndarray, m: LinearOperator | None = None, tol: float = 1e-05) np.ndarray [source]#
Solves a linear system using the CGS iterative method (Lagrangian multiplier).
- Parameters:
k_lg (csc_matrix) –
(N+1) x (N+1)
Lagrangian multiplier matrix of the linear systemf (np.ndarray) –
N x 1
right hand side of the linear systemm (LinearOperator | None) – Preconditioner for the linear matrix approximating the inverse of
k
tol (float) – Tolerance for the solver to achieve. The algorithm terminates when either the relative or the absolute residual is below
tol
- Returns:
The solution vector to the linear system of equations
- Raises:
RuntimeError – If the CGS iterative method does not converge or the error from the Lagrangian multiplier method exceeds the tolerance
- Return type:
np.ndarray