Solving an optimization problem with constraints

To solve a constrained optimization problem, you use globalConstraint blocks. These blocks identify constraints that depend on parameterUnknowns and are more complicated than the bound constraints (which are handled in the parameterUnknown block).

To illustrate the use of the globalConstraint block, the previous problem can be modified by constraining the area under the approximating function so that it cannot exceed 0.4.

To modify CURV2P

1.    Add the following blocks to the diagram:

      From the Optimization category, add a globalConstraint block

      From the Integration category, add an integrator block

      From the Signal Consumer category, add a display block

2.    Make a copy of the Approx block.

3.    Wire the output of the Approx block into the integrator block.

4.    Wire the output of the integrator block into the globalConstraint and display blocks.