Stop Condition

Generally, it is helpful to formulate a stop condition to check the fulfillment of the optimization task and end the optimization when the minimum (or maximum) has been reached.

Related Topics
In Other Guides
STOP

Global Stop Condition

The first stop criterion is the maximum number of optimization iterations which is default 50. When the maximum number of optimization iterations is reached the optimization algorithm always stops independent of other criteria. The allowed maximum number of optimization iterations can be increased or decreased by the user. This is done by modifying ITER_MAX in the STOP command

STOP
  ID_NAME = global_stop
  ITER_MAX = 5
END_

where ITER_MAX is decreased to 5.

A global stop condition should be set for each optimization task to limit the number of design cycles. The optimization algorithm does not have its own stop condition; a stop condition must always be defined by the user.

Since a 'partially optimized model' can be used as a starting model for a subsequent optimization, it makes sense to calculate first a few design cycles and then to use information from the optimization result to calculate more design cycles with adjusted settings.

Important:
  • For simple shape optimization tasks it is often sufficient to limit the number of iterations to 5 or 10. For more complex setups the iterations should be increased to around 25 which is enough for many cases. However, there are setups where even more iterations are needed and it is hard to guess a number that is valid for all cases.
  • In TAe the stop condition is already predefined (default=5).
  • The global stop criterion leads to a hard stop of the optimization - independent of a complete convergence of the result. For shape optimization tasks this is no drawback as the optimization task can be continued for some more steps using the input file of the last iteration as start file.

Local Stop Condition

The possibilities for local stop conditions might include the following:

  • If an objective function without a constraint should be minimized (maximized), the value of the objective function of the current design cycle should be smaller (greater) than the value of the objective function for the design in the previous optimization cycle. If this is not the case, the optimization can be ended.
  • Only relatively small changes in the value of the objective function are to be expected when approaching the optimum. If the relative change in the objective function falls below a tolerance limit in one design cycle, the optimization can be considered as completed.
  • If the norm of the optimization displacements is smaller than a certain tolerance value within one design cycle, the modifications of the model will only be small and the optimization is stopped. This condition has the advantage that it is suitable for optimization jobs with and without constraints. The condition can be equally used without any changes for a variety of objective functions (stress or frequency).

Stop conditions can be formulated and combined by linking the VARIABLE definitions with LOGICAL variables. However, experiments have shown that it is usually not worthwhile to define complicated stop conditions for shape optimization. It is often sufficient to limit the maximum number of allowable design cycles as a global stop condition.

Also, a compact form of a stop condition is available which enables to compare the actual value of a variable with a value from the first or previous step (parameters MOD_TYPE for the definition of the variable, MOD_OPER for the comparison operator and MOD_REF for the reference value definition).

Important: The global stop criterion is defined using a STOP command whereas convergence criteria are defined in the optimization settings (OPT_PARAM command).

Defining a Stop Condition in Tosca ANSA® environment

Per default, a global stop condition limiting the number of design cycles to 5 is defined (visible in the task manager tree).

  1. If necessary, the number of design cycles can be changed: Select GLOBAL_STOP_CONDITION_1 > Edit.
  2. To enter several local stop conditions, select SHAPE_OPTIMIZATION_CONTROLLER > New > STOP_CONDITION
  3. Define the parameters described above in the LOCAL_STOP dialog.


Note:

As this compact form of stop conditions is usually sufficient for optimization tasks, more complicated stop conditions including logical variables are not supported by Tosca ANSA® environment.

Defining a Stop Condition in Tosca Structure.gui

  1. Choose Command > STOP:


More complicated stop conditions can be defined using variables, combining them to logical expressions and referring them in the stop condition.

Example 1:

The number of design cycles should be limited to 5 as a global stop condition:

STOP
 ID_NAME = stop_condition
 ITER_MAX = 5
 OPTIMIZE = <name_of_optimize>
END_

Example 2:

The stop condition is fulfilled, if the maximum equivalence stress in the node group ALL_NODES is less than 1% of the maximum equivalence stress of the first iteration.

STOP
 ID_NAME = stop_command
 MOD_NDGR = all_nodes
 MOD_TYPE = MAX, CTRL_INP_SHAPE
 MOD_OPER = LE
 MOD_REF = 0.01, MULT, FIRST
 OPTIMIZE = run
END_

Example 3:

If the sum of the optimization displacements of the design node group in a given design cycle is smaller than 1% of the sum of the optimization displacements in the initial design cycle, the optimization should be stopped:

VARIABLE
 ID_NAME = sum_disp
 DEF_TYPE = SYSTEM
 TYPE = SHAPE_MOVE
 ND_GROUP = design_nodes
 GROUP_OPER = SUM
 UPDATE = EVER
END_

VARIABLE
 ID_NAME = sum_disp_first
 DEF_TYPE = SYSTEM
 TYPE = SHAPE_MOVE
 ND_GROUP = design_nodes
 GROUP_OPER = SUM
 UPDATE = FIRST
END_

VARIABLE
 ID_NAME = one_percent
 DEF_TYPE = FIX
 VALUE = 0.01
END_

VARIABLE
 ID_NAME = sum_disp_first_001
 DEF_TYPE = OPER
 VAR_OPER = MULT
 VAR_A = one_percent
 VAR_B = sum_disp_first
END_

LOGICAl
 ID_NAME = logical_for_stop
 DEF_TYPE = SYSTEM
 OPER = LT
 VAR_A = sum_disp
 VAR_B = sum_disp_first_001
END_

STOP
 ID_NAME = stop_optimization
 LOGI_NAME = logical_for_stop
 OPTIMIZE = <name_of_optimize>
END_