The variable specification works the same way as in the simulation. Therefore, general explanations are given elsewhere.
Nevertheless, there are a couple of additional requirements for an optimization. The optimization requires exactly one objective variable. Remember that MOSAICmodeling solves the following optimization problem:
The objective function can thus be formulated as
Therefore, the simulation must include this additional constraint and must be defined as the objective variable in the variable specification.
In addition, the degrees of freedom in the optimization must be assigned optimization variables. It is recommended to also supply reasonable lower and upper bounds – not only for optimization variables but also for all other variables.