Using Constraints

You can use constraints.

In the scenario developed below, the simulated annealing algorithm is used with constraints and without objective function to search for a set of xA, xB, yA and yB parameters so that the inertia axis of the pad remains within an area defined by two circles. Here are the circle definitions as they are specified as constraints in the scenario below:

Y**2 + Z**2 < 8100mm2 
Y**2 + Z**2 < 1000mm2

When you are finished with this part of the scenario, the gradient algorithm is used to find a set of xA, xB, yA and yB so that the distance of the inertia axis to the origin is minimum. This second part of the scenario requires that the constraints are fulfilled.

Note: You can use constraints without objective (Simulated Annealing only) or with objective (available for both algorithms.)

See Also
Optimization Editor
Running a Constrained Optimization With Weights
  1. Create a representation identical to the one below. This document must be a pad extruded from a spline. The relation defined in this document allows you to specify the position of an inertia axis.


  2. From the Compass, click 3D Modeling Apps and select Design Optimization. Click Optimization .
    The Optimization dialog box appears.
  3. Select the Only constraints optimization type.
  4. Click Edit list to select the following free parameters below: xA, xB, yA, yB. Do not select any optimized parameter. Click OK.
  5. Select the Simulated Annealing Algorithm in the algorithms list.
  6. In the Constraints tab, click New... to enter the constraint below Y**2 + Z**2 > 8100mm2
  7. Click OK in the Optimization Constraints Editor, then click New... again to enter the second constraint: Y**2 + Z**2 < 10000mm2
  8. Click Run optimization.
  9. Type the name of the representation (Constraints in this scenario) and click OK.
    After the optimization has finished running, you obtain a pad whose inertia axis is located in an area delimited by the two circles specified. Take a look at the Constraints tab. The constraints are fulfilled. You can now start a gradient algorithm to search for the minimum value of the Rad parameter.
  10. In the Problem tab, select:
    • Minimization as the optimization type.

    • Rad as the parameter to be optimized (click Select...) and choose the Gradient Algorithm With Constraints.
    • Do not modify the free parameters.
  11. Click Run optimization to run the optimization with the default termination criteria.
  12. Click Yes when asked if you want to override the existing representation.
    After the optimization has finished running, the minimum value of Rad is close to 90mm. You have found a set of xA, xB, yA, yB value so that the inertia axis of the pad is located almost on the circle defined by the relation below: Y**2 + Z**2 = 8100mm2.