Alternative optimizers¶
The nullspace_optimizer package provides an interface with several optimizers
which are available in the nullspace_optimizer/optimizers
folder.
This interface allows to run these optimizers on the Optimizable structure,
which is useful to compare the results with those of the function
nlspace_solve().
Method of Moving Asymptotes¶
The function mma_solve() solves an
optimization problem using the implementation of the Method of Moving Asymptotes
available on this repository.
from nullspace_optimizer.optimizers.MMA import mma_solve
-
mma_solve(problem: Optimizable, l, u, params=None, results=None)¶
See examples/topopt_examples/ex03_compliance_MMA.py for an example of use.
Note
The decorator bound_constraints_optimizable() should
not be used when solving an optimization problem with mma_solve().
Bound constraints need to be provided with the l and u arguments.
IPOPT¶
The function ipopt_solve() solves an
optimization problem using the optimizer IPOPT called by
the Python interface cyipopt, which
both need to be installed before running this function.
from nullspace_optimizer.optimizers.IPOPT import ipopt_solve
See examples/topopt_examples/ex04_compliance_IPOPT.py for an example of use.
Note
The decorator bound_constraints_optimizable() should
not be used when solving an optimization problem with ipopt_solve().
Bound constraints need to be provided with the l and u arguments.
Optimality Criteria¶
The function oc_solve() solves an
optimization problem using the Optimality Criteria method, based on its
implementation in the topology optimization code available here.
It can be used for solving optimization problems featuring a single equality
constraint and no inequality constraints apart from bound constraints.
from nullspace_optimizer.optimizers.OC import oc_solve
-
oc_solve(problem: Optimizable, l, u, params=None, results=None)¶ -
An Optimality Criteria solver for volume constrained compliance minimization in topology optimization based on the script topopt_cholmod.py.
This solver applies to Optimization problems of the form
\[\begin{aligned} \min_{x\in \R^n}& \quad J(x)\\ \textrm{s.t.} & \left\{\begin{aligned} g(x)&=0,\\ l &\leqslant x \leqslant u\\ \end{aligned}\right. \end{aligned}\]where \(x\) is a numpy array and \(g\) a single equality constraint.
See examples/topopt_examples/ex02_compliance_oc.py for an example of use.
Note
The decorator bound_constraints_optimizable() should
not be used when solving an optimization problem with oc_solve().
Bound constraints need to be provided with the l and u arguments.