# Design Sensitivity Analysis

The sensitivity of an output y(u) to an input u is defined as the change in y due to a unit change in u.

The quantity $\left(\frac{\partial y}{\partial u}\right)$ is called the first order sensitivity of the quantity y to the input u.

Sensitivity analysis is the study of how the change or uncertainty in the output of a mathematical model or system (y) can be apportioned to different sources of change or uncertainty in its inputs (u).

For Design Sensitivity Analysis, the quantity u is not an input, but the design b. Here we are asking the question: For a given change in the design b, how does the response y change.

In a multibody simulation, the response $y$ is typically a function of the system states $x$ and $\dot{x}$ , and, perhaps, explicitly on the design b. The system states $x$ consist of (a) Displacements, (b) Velocities, (c) Lagrange Multipliers (or constraint reaction forces), (d) User defined differential equations, (e) User defined algebraic equations originating from Variables and LSE/GSE/TFSISO outputs, and, (f) Internally created intermediate states that simplify computation. The system states, $x$ (the system response), is implicitly dependent on b. Thus $x=x(b)$ .

The equations of motion provide an implicit relationship between (x and b) and (and (x, b)). The quantities $\frac{\partial x}{\partial b}\text{,}\frac{\partial \dot{x}}{\partial b}\text{and}\frac{\partial y}{\partial b}$ need to be computed first. Once these are known, the design sensitivity, $\frac{\Delta y}{\Delta b}$ , can be computed.

The calculation of $\frac{\Delta y}{\Delta b}$ is called DSA (Design Sensitivity Analysis) in MotionSolve. This is a new analysis method in MotionSolve. It always accompanies a regular analysis, such as static analysis, quasi-static analysis, kinematic analysis, dynamic analysis or linear analysis. The job of the regular analysis is to compute the states z, $\dot{z}$ and the outputs y for a given design b. Once these are known, the DSA analysis will compute the sensitivity, $\frac{\Delta y}{\Delta b}$ . When there are Ny responses and Nb design variables, $\left[\frac{\Delta y}{\Delta b}\right]$ is a matrix of dimension Ny x Nb.

There are three well-known methods for computing design sensitivity. These are briefly discussed below.

## Finite Differencing

This is the approach used by HyperStudy, and it can only be used for small-scale design sensitivity analysis (usually 20-30 variables). For a system with Nb design variables, this approach requires $({N}_{b}+1)$ simulations. One simulation is required to compute $y\left(x\left(b\right),\dot{x}\left(b\right),b\right)$ . Nb simulations are required to compute $y\left(x\left(b+\Delta {b}_{k}\right),\dot{x}\left(b+\Delta {b}_{k}\right),b+\Delta {b}_{k}\right),k=\mathrm{1...}{N}_{b}$ , in other words, once for each design variable.

The major issue with this approach is selecting the right $\Delta {b}_{k}$ . If this is too small, the sensitivities get lost in the numerical error in the solution. If these are too large, the non-linearity of the solution is overlooked. The perturbation $\Delta {b}_{k}$ is also dependent on the scale and units of the system. In summary, this approach is applicable only for small problems and there are some unresolvable issues about what the perturbations $\Delta b$ should be.

## Direct Differentiation

In this approach, the equations of motion are analytically differentiated with respect to each design variable bi, i=1... Nb. At each point in time, after an analysis step is complete, Nb sets of DAE are solved numerically to yield the required values $\frac{\Delta y}{\Delta b}$ . This approach is quite robust and is used when the numbers of design variables Nb are not too large. As the number of design variables increase, the cost of the solution also increases.

## Adjoint Approach

This is also an analytical approach where finite differencing is not used. The cost
of this method, however, is proportional to the number of response variables in the
model. The number of design variables does not govern the cost. This approach is
quite robust and is used when the numbers of design variables
N_{b} are large.

```
if __name__ == "__main__":
m = sliding_block("lugre1")
m.simulate (type=" STATIC ",
```**dsa=****"AUTO"**, end=4, dtout=.01)
m.lugre.mus=0.5
m.simulate (type="STATIC", **dsa=****"AUTO"**, end=8, dtout=.01)

Note also, that in order to compute the sensitivities, MotionSolve needs to know what the design variables are, how the model is parameterized with these design variables and what the response variables are. DSA will yield correct answers only when the model is "designable". For non-designable models, it will return ZERO as the answer.