Parameter Definition
A parameter is a quantity that remains constant during the optimization process, specified by the user before calling the solver, such as vehicle body length and mass.
OPTIMake supports the following two types of parameters:
- stage-independent parameter
- stage-dependent parameter.
A stage-dependent parameter can have different values at different stages, while a stage-independent parameter has the same value across all stages (which can save storage and simplify setup).
Below is an example of defining parameters:
length = prob.parameter(name='length', stage_dependent=False)
mass = prob.parameter('mass')
xLowerBound = prob.parameter('xLowerBound', stage_dependent=True)
The function parameters are defined as follows:
-
name: str The name of the parameter
-
stage_dependent: bool, optional Whether the parameter is stage-dependent. The default value is True, meaning the parameter is stage-dependent
Alternatively, parameters can be defined using a list:
length, mass, xLowerBound = prob.parameters(
['length', 'mass', 'xLowerBound'],
stage_dependent=False)