pymoto.solvers.LDAWrapper

class pymoto.solvers.LDAWrapper(solver: LinearSolver, tol=1e-07, A=None, symmetric=None, hermitian=None)

Linear dependency aware solver (LDAS)

This solver uses previous solutions of the system \(\mathbf{A} \mathbf{x} = \mathbf{b}\) to reduce computational effort. In case the solution \(\mathbf{x}\) is linearly dependent on the previous solutions, the solution will be nearly free of cost.

Parameters:
  • solver – The internal solver to be used

  • tol (optional) – Residual tolerance above which the internal solver is used to add a new solution vector.

  • A (optional) – The matrix \(\mathbf{A}\)

  • symmetric (optional) – Flag to indicate a symmetric matrix \(A=A^T\)

  • hermitian (optional) – Flag to indicate a Hermitian matrix \(A=A^H\)

References: Koppen, S., van der Kolk, M., van den Boom, S., & Langelaar, M. (2022).

Efficient computation of states and sensitivities for compound structural optimisation problems using

a Linear Dependency Aware Solver (LDAS).

Structural and Multidisciplinary Optimization, 65(9), 273. DOI: 10.1007/s00158-022-03378-8

__init__(solver: LinearSolver, tol=1e-07, A=None, symmetric=None, hermitian=None)

Initialize the solver

Parameters:

A (matrix, optional) – Optionally provide a matrix, which is used in :method:`update` right away.

Methods

__init__(solver[, tol, A, symmetric, hermitian])

Initialize the solver

residual(A, x, b[, trans])

Calculates the (relative) residual of the linear system of equations

solve(rhs[, x0, trans])

Solves the linear system of equations \(\mathbf{A} \mathbf{x} = \mathbf{b}\) by performing a modified Gram-Schmidt over the previously calculated solutions \(\mathbf{U}\) and corresponding right-hand-sides \(\mathbf{F}\).

update(A[, skip_inner_update])

Clear the internal stored solution vectors and update the internal solver

Attributes

defined

update(A, skip_inner_update: bool = False)

Clear the internal stored solution vectors and update the internal solver

solve(rhs, x0=None, trans='N')

Solves the linear system of equations \(\mathbf{A} \mathbf{x} = \mathbf{b}\) by performing a modified Gram-Schmidt over the previously calculated solutions \(\mathbf{U}\) and corresponding right-hand-sides \(\mathbf{F}\). This is used to construct an approximate solution \(\tilde{\mathbf{x}} = \sum_k \alpha_k \mathbf{u}_k\) in the subspace of \(\mathbf{U}\). If the residual of \(\mathbf{A} \tilde{\mathbf{x}} = \mathbf{b}\) is above the tolerance, a new solution \(\mathbf{u}_{k+1}\) will be added to the database such that \(\mathbf{x} = \tilde{\mathbf{x}}+\mathbf{u}_{k+1}\) is the solution to the system \(\mathbf{A} \mathbf{x} = \mathbf{b}\).

The right-hand-side \(\mathbf{b}\) can be of size (N) or (N, K), where N is the size of matrix \(\mathbf{A}\) and K is the number of right-hand sides.

defined = True
static residual(A, x, b, trans='N')

Calculates the (relative) residual of the linear system of equations

The residual is calculated as \(r = \frac{\left| \mathbf{A} \mathbf{x} - \mathbf{b} \right|}{\left| \mathbf{b} \right|}\)

Parameters:
  • A – The matrix

  • x – Solution vector

  • b – Right-hand side

  • trans (optional) – Matrix tranformation (N is normal, T is transposed, H is hermitian transposed)

Returns:

Residual value