# Design Optimization

${\psi}_{0}(b)$ represents the initial value of $\psi $ that may be accumulated from prior analysis when multiple simulates are involved.

In MotionSolve, the equations $\dot{z}=L(x,b,t)$ are defined through a new modeling element, RV. RV accepts a function expression as input. An initial condition is also specified. As output, it returns the time integral of the expression $L$ . RVAL is the $y$ output mentioned earlier.

When a DSA is performed, MotionSolve computes the partial derivatives of the RVALs with respect to each of the design variables. This is returned in an array DSARY.

The sensitivity of the cost function, $\frac{\partial \psi}{\partial b}$ , is in terms of the DSARY.

The Python interface to MotionSolve supports several optimization functions. It is designed to follow a well-defined sequence of steps and require minimal input from you.

## The Key Steps to Performing an Optimization:

- Create a designable model of a system using this interface
- Instrument the model to be optimization ready
- Create model responses that you wish to optimize. These are called metrics.
- Define target values you want for the metrics you defined
- Create an objective from the metric functions and target values
- Create an optimizer and give it the objective you defined
- Ask the optimizer to optimize the system