How to automatically run a post-processing at the end of a simulation?

At the end of a MANATEE electromagnetic or vibroacoustic simulation, different electrical, magnetic, mechanical, and acoustic quantities are calculated. The full list of output variable definition and units is detailed in the Excel sheets included in the Doc folder of MANATEE.

You can access to these variables through the Output structures of the workspace, and plot them using the available MANATEE plot commands. You can also define our own post-processing script to calculate a specific variable not available in MANATEE default outputs, or make a special plot at the end of the simulation.

The calculation of user-defined variables or the run of user-defined plots can be called at two steps of the simulation workflow: at the end of an elementary MANATEE simulation, or at the end of a multi-simulation. The Matlab script defining this special variable can be stored in the /PostProcessing/MyPost folder. The names of these scripts are defined by the following project variables:

Input.Simu.MS_post_filename
Input.Simu.SS_post_filename

Both of them are character variables that take command as value. For instance, if one want to plot the airgap flux automatically at the end of the simulation the corresponding code is :

Input.Simu.SS_post_filename = 'plot_B_time';

It can be several scripts separated by ; e.g. ’compare_femm_sdm_mag_torque;compare_femm_sdm_flux_rt’. Or any Matlab code directly typed by the user:

Input.Simu.SS_post_filename = 'plot((1:10),(1:10)*2)';

To calculate a new variable and include it in MANATEE outputs you may write a post processing scripts my_post.m with

Output.Electrical.my_var=2*Output.Electrical.R10; %twice the phase resistance

The new output variable my_var can then be used in sensitivity studies or optimization.

The difference between MS and SS post processing depends on the type of simulation you are running:
If it is a multi-simulation (sensitivity, variable speed, optimization...), "SS_post_filename" will be called at the end of every single simulation step and "MS_post_filename" only once at the end of the whole simulation.
Otherwise, only "SS_post_filename" will be evaluated at the end of your simulation.

Previous Next