simkit.solvers.sqpmfem#
Functions#
|
SQP solver for the MFEM system from https://www.dgp.toronto.edu/projects/subspace-mfem/ , Section 4. |
Module Contents#
- simkit.solvers.sqpmfem.sqp_mfem(p0, energy_func, hess_blocks_func, grad_blocks_func, tolerance=0.0001, max_iter=100, do_line_search=True, verbose=False)#
SQP solver for the MFEM system from https://www.dgp.toronto.edu/projects/subspace-mfem/ , Section 4.
- The full system looks like:
[Hu 0 Gu] [du] - [fu] [0 Hz Gz] [dz] = - [fz] [Gz.T 0 0] [mu] - [fmu]
Where Gz is diagonal and easily invertible. Using this fact, we can rewrite the system into a small solve and a matrix mult
(Hu + Gu Gz^-1 Hz Gz^-1 Gu.T) du = -fu + Gu Gz^-1 fz - Gu Gz^-1 Hz Gz^-1 fmu dz = -Gz^-1 (fz + Hz du)
- Parameters:
p0 ((n, 1) np.ndarray) – Initial guess for the stacked state.
energy_func (callable) – Energy function to minimize. Only used when
do_line_searchis True.hess_blocks_func (callable) – Maps
pto the hessian blocksHu, Hz, Gu, Gz, Gzi.grad_blocks_func (callable) – Maps
pto the gradient blocksfu, fz, fmu.tolerance (float) – Convergence tolerance on the norm of the gradient.
max_iter (int) – Maximum number of iterations.
do_line_search (bool) – If True, run a backtracking line search to pick the step size.
verbose (bool) – Unused placeholder for diagnostics.
- Returns:
p – Minimizer estimate.
- Return type:
(n, 1) np.ndarray