The Topology Optimization study (

) node collects all settings necessary for solving topology optimization problems. It serves the dual purpose of defining the optimization problem to be solved and choosing an optimization solver, as well as controlling important solver properties and solver output.
The complete optimization problem can be set up directly in the General Optimization study node when the objective function to be minimized or maximized is a global scalar expression and the only control variables to be varied are already defined as model parameters. The study step is incompatible with the Optimization interface.
When you add an Topology Optimization study node to a study, it is always inserted as the first node, at the top of the study sequence (below any parametric sweeps). The study only works with gradient-based optimization; see
About Gradient-Based Solvers for more information.
The Settings window has the following sections:
Choose an optimization solver method. The Method list of available solvers contains the following gradient-based methods:
GCMMA,
MMA, and
IPOPT.
Select the Study step to optimize over. The setting is hidden if the study only contains a single compatible study step.
Specify the relative Optimality tolerance. The value is applied relative to each control variable after scaling with its corresponding specified scale.
Specify the Maximum number of iterations. The default is 100. This number limits the number of iterations. Use
The General Optimization Study to constrain the number of model evaluations directly. Note that the study will not throw a warning, if the solver terminates on the maximum number of iterations.
Select the Move limits checkbox to constrain the maximum absolute change of any (scaled) control variable. Sometimes this option can prevent optimization solver from returning bad local minima. The setting is only available with the
MMA optimization solver.
You specify the objective function for the optimization problem in the table’s Expression column. Enter any globally available expression that evaluates to a real number. Optionally, you can add a description in the
Description column. Click the
Add Expression (

) and
Replace Expression (

) buttons to search through a list of predefined expressions.
Select whether to perform a Minimization or a
Maximization of the objective function. The default is to minimize the objective function.
Here you select which solution or solutions to use for evaluating the objective function when several solutions are present, like for Time Dependent or Eigenvalue studies. The possible choices are Auto (the default),
Use first,
Use last,
Sum of objectives,
Minimum of objectives, and
Maximum of objectives. Note that the last three options first evaluate multiple objectives according to the
Multiple objectives setting for each solution individually, and then compute the sum, minimum, or maximum of the individual results.
When using IPOPT,
Auto is the only choice.
MMA supports all options except when optimizing over a
Time Dependent study step.
With Auto selected, the solver chooses the evaluation method based on the innermost study.
For the studies of Eigenvalue,
Eigenfrequency, or
Linear Buckling type (all described in
COMSOL Multiphysics Reference Manual), the first solution corresponding to the smallest eigenvalue is chosen. For studies with parametric solutions (for example, studies in the
Frequency Domain), the contributions from all solutions are summed (equivalent to the
Sum of objectives option). For all other study types, the optimization solver selects the last solution, like the solution at the final time for a
Time Dependent problem.
Most optimization solvers benefit from a well-scaled objective function, so that the actual change in the objective is neither extremely small nor extremely large. The default value is None and corresponds to a scale of 1, while
Manual allows specifying a custom scale. If
Initial solution based scaling is used, the setting interacts with the solution setting, so that the initial sum, minimum, maximum, first, or last value is chosen as the scale.
If there is a Optimization or
Sensitivity interface in the model, containing control variable nodes, these show up in a separate table under
Control Variables. Use the
Solve for column to deactivate individual control variables as needed.
The first table under Constraints lets you specify additional constraints to be imposed on the optimum solution. The
Expression column accepts any globally available expression which evaluates to a real number. Constraints can be functions of the control variables both directly and indirectly via PDE solution variables. The
Lower bound and
Upper bound columns can only contain
parameter expressions; they must not depend on control variables, PDE solution variables, or any other user-defined variables, but can include model parameters, physical constants, and units. One bound column can be left blank to indicate that no upper or lower bound is required.
If there are multiple solutions, the constraints are imposed for all them, except if the Solution setting is set to
First or
Last under the
Objective Function section. In which case the constraints are imposed only for the solution used to evaluate the objective function.
Use the Keep solutions list to control how to store the solutions from the individual optimization solutions:
|
•
|
Select Only last (the default) if you want to save only the last solution.
|
|
•
|
Select All if you want to save all solutions.
|
|
•
|
Select Last N if you want to save the last N solutions. Then specify a positive integer in the Number of solutions to save field to define N (2 by default).
|
|
•
|
Select Every Nth if you want to save every Nth solution. Specify a positive integer in the Save every Nth field to define N (10 by default to save every 10 th solution).
|
Select First and last if you want to save the first and last solution.
Select Plot and choose a
Plot group to update after each major iteration of the optimization algorithm.
Select which Probes to evaluate and plot in each iteration.
Select the Keep objective values in table checkbox to retain the table containing control variable and objective function values after the solver completes. Choose an existing
Output table, or select
New to create a new table. After computing the study, the
Output table setting will be changed to the table actually being used.
Select the Show individual objective values checkbox to include one table column for each contribution to the objective. Otherwise, only the total objective is displayed.
Select the Table graph checkbox to plot the objective function values displayed in the objective table. Choose an existing
Plot window, including the standard
Graphics window, or select
New window. After computing the study, the
Plot window setting will be changed to the window actually being used.
Only available for derivative-free methods. Select the Keep constraint values in table checkbox to retain the table containing global constraint values after the solver completes. Choose an existing
Constraint table, or select
New to create a new table. After computing the study, the
Constraint table setting will be changed to the table actually being used.