### Objectives

This article presents how to run **sensitivity studies or parameter sweep** in MANATEE software specialized in electromagnetic and vibroacoustic simulation of electrical machines.

### Principle

The multi-simulation environment of MANATEE can be used to run a parameter sweep. The aim is to track the influence of some simulation or machine input variables on some specific MANATEE scalar outputs. Some user-defined non scalar values can also be saved during the sensitivity study.

The multisimulation environment allows to automatically generate design configurations in a combinatorial way, launch the simulations and analyze the results (e.g. correlation analysis). Both continuous and discrete design variables can be handled, and several response functions can be evaluated.

### GUI implementation

TBC

### Scripting implementation

##### Simulation set-up

The following example study the sensitivity of acoutic noise and electromagnetic torque according to the geometry of the default induction machine of MANATEE.

The default sensitivity analysis (or multi-simulation) is activated with (in project file):

`Input.Simu.type_sensitivity = 1;`

This mode makes the combinatorial combination of all input variables. If one wants to make the input variables vary synchronously (combining first value of first variable with first value of the second variable, etc), the sensitivity mode to be chosen is

`Input.Simu.type_sensitivity = 2;`

Alternatively one can use a pre-processing script as explained in the advanced multi simulation article.

Then the Input design variables to be changed must be selected according to MANATEE variable names (in the example : stator slot dimension, yoke height, airgap, lamination length).

`Input.Simu.names_var={'H2s'; 'W2s'; 'Hsy'; 'gap'; 'Lst1'};`

The list of input variables with their description can be found in MANATEE_Input_variables.xlsx Excel file of the /Doc folder.

Each variable type, such as discrete (1) or continuous (0), must then be set. In the example all the variables are continuous (the order of the variable match the one in Input.Simu.names_var):

`Input.Simu.types_var=[0,0,0,0,0];`

Then you need to specify how you want to define the possible values for each variables. You can either enter an exhaustive set of the value that the variable will take (1) or an interval in which random values will be taken (0). In this exemple all variables are define with intervals:

`Input.Simu.types_val=[0,0,0,0,0];`

To make the sensitivity study, the Input must make small changes around the current value. In the example, the Input can vary +/- 10% around their current value :

`Input.Simu.bds_contvar={[27e-3 33e-3]; [10.8e-3 13.8e-3]; [31.5e-3 38.5e-3]; [1.35e-3 1.65e-3]; [315e-3 385e-3]};`

Now you have to chose how many different values you want to simulate for each Input. MANATEE will run a simulation for every combination of the values. In this example, only 4 different values are used for each design variable (so the simulation will be run 4*4*4*4*4 = 1024 times).

`Input.Simu.Nval_contvar=4;`

For a basic sensitivity study 2 values are enough. The number of value is the same for every Input so the number of points is specified as a scalar. If you want to have, for instance, 10 value for the airgap variable you must use the following code:

`Input.Simu.Nval_contvar=[4,4,4,10,4];`

The sampling strategy in the specified boundaries can by chosen with:

`Input.Simu.type_sampling=[2,2,2,2,2];`

If type_sampling is at 0, the values are linearly spaced in the boundaries and therefore will be the same every time the simulation is run.

As an example, to look at the EEC torque and the maximum sound power level at variable speed one should specify the corresponding variable names as:

`Input.Simu.names_resp={'LwrA_max';'Cout'};`

More options can be found in the article on how to define output variables in sensitivity studies and optimizations.

##### Simulation run and post-processing

The project is launched as a standard simulation based on *run_MANATEE*. A fixed speed simulation is always initialized before the sensitivity analysis.

The text output gives the total number of simulations and the estimated maximum simulation time. During the simulation one can track the value of the Input and Output in the Matlab console (along with the corresponding simulation number).

At the end an XOutput structure is created like in variable speed simulation. One can also find in Output.MultiSim.Xconf a Matrix whose row n°i are the actual value of the Input use for the i-th simulation and the corresponding output (in the same order as in Input.Sime.names_var and Input.Simu.names_resp)

### Plot commands

All the post-processings of the multisimulation environment can be found on the plot commands documentation section For a sensitivity study, you want to know the correlation between your Input and Output :

### See also

The cloud of points obtained after the sweep can also be explored at the end using the MultSim viewer. You can also combine an user-defined post-processing and the export to excel tool to save some specific design configuration.