To specify custom requirements, such as minimizing system energy:
In the Design Optimization tool, select Custom Requirement in the New list. A window opens where you specify the custom requirement.
Specify a requirement name in the Name box.
Specify the requirement type using the Type list.
Specify the name of the function that contains the custom requirement in the Function box. The field must be specified as a function handle using @. The function must be on the MATLAB® path. Click to review or edit the function.
If the function does not exist, clicking opens a template MATLAB file. Use this file to implement the custom requirement. The default function name is myCustomRequirement.
(Optional) If you want to prevent the solver from considering specific parameter combinations, select the Error if constraint is violated check box. Use this option for parameter-only constraints.
During an optimization iteration, the solver evaluates requirements with this option selected first.
If the constraint is violated, the solver skips evaluating any remaining requirements and proceeds to the next iterate.
If the constraint is not violated, the solver evaluates the remaining requirements for the current iterate. If any of the remaining requirements bound signals or systems, then the solver simulates the model .
For more information, see Skip Model Simulation Based on Parameter Constraint Violation (GUI).
(Optional) Specify the signal or system, or both, to be bound.
You can apply this requirement to model signals, or a linearization of your Simulink® model (requires Simulink Control Design™ software), or both.
Click Select Signals and Systems to Bound (Optional) to view the signal and linearization I/O selection area.
Apply this requirement to a model signal:
In the Signal area, select a logged signal to which you will apply the requirement.
If you have already selected a signal to log, as described in Specify Signals to Log, it appears in the list. Select the corresponding check box.
If you have not selected a signal to log:
Click . A window opens where you specify the logged signal.
In the Simulink model window, click the signal to which you want to add a requirement.
The window updates and displays the name of the block and the port number where the selected signal is located.
Select the signal and click to add it to the signal set.
In the Signal set box, enter a name for the selected signal set.
Click OK. A new variable, with the specified name, appears in the Design Optimization Workspace of the Design Optimization tool window.
Apply this requirement to a linear system.
Linear systems are defined by snapshot times at which the model is linearized and sets of linearization I/O points defining the system inputs and outputs.
Specify the simulation time at which the model is linearized using the Snapshot Times box. For multiple simulation snapshot times, specify a vector.
Select the linearization input/output set from the Linearization I/O area.
If you have already created a linearization input/output set, it will appear in the list. Select the corresponding check box.
If you have not created a linearization input/output set, click to open the Create linearization I/O set dialog box. For more information on using this dialog box, see Create Linearization I/O Sets.
For more information on linearization, see What Is Linearization?.
A new variable, with the specified name, appears in the Design Optimization Workspace of the Design Optimization tool. A graphical display of the requirement also appears in the Design Optimization tool window.