How to export design parameters to Excel?

To write a simulation report or to compare several simulations, it can be useful to gather some specific simulation parameters. MANATEE includes a feature to automatically fill an excel sheet with your significant data: export_design_to_excel.

This command is linked to the file "IOFunctions\export_template.xlsx":

Excel template for data export
Excel template for data export

Each line of this file corresponds to a piece of data to export. For each, you need to specify:

  • In column A: The name or description (not used in export process)
  • In column B: The variable to evaluate
  • In column C: The unit
  • In column D: The number of decimals to display

To adapt the export to your simulation, you can edit the export_template.xlsx file.

Get the correct values

For the column MANATEE name (or B), there are several ways to define the value you want to export:

  • A MANATEE variable name (for instance Drbo, Hry, p...). Manatee will search in the Input and Output structures to find the correct value
  • A full structure path like Input.Material.mat_lam1.MatName
  • An expression to evaluate like Input.Simu.N0spec(3), date or norm(Output.Magnetics.XBr)

If the variable is missing or if Matlab is unable to evaluate the expression, the cell will contain "X".

Unit conversion

Column C can either be ignored by the export process or used to convert unit. MANATEE inputs and outputs are all expressed in the International Unit System (m, kg, etc) but it can be convenient to display them in another unit. For instance if the column Unit (or C) contains "mm" the value will automatically be multiplied by 1000.

Here is the complete list of supported unit conversions:

  • mm (from m)
  • mohm, mOhm, m.Ohm, nOhm (from ohm)
  •  % (from [0,1])
  • mH (from H)
  • KW, kW (from W)
  • kA/m (from A/m)
  • kNm/m^2, kNm/m², kNm/m2 (from Nm/m²)
  • kNm (from Nm)
  • kPa (from Pa)
  • A/mm2, A/mm², A/mm^2 (from A/m²)

All other units will be ignored by the export process. If you need another unit conversion, you can specify the formula in column B and/or ask us to add it in the next release.

Compare several simulations

By default, when you call export_design_to_excel without argument, it will create an excel file based on export_template.xlsx with the column E filled as defined. The output file is named "machine_name"_design_export.xlsx.

The first argument (filename) enables to change the output file name:

export_design_to_excel('test')

will create an output file named test_design_export.xlsx

The second and last parameter (index) enables to select the column in which you want to write your data. For instance, index=0 selects column E and index=5 selects column J. By default index=0.

If index is greater than 1 and if a file with the output name exists in the MANATEE path, instead of reading export_template, MANATEE will read the output file as a template. This feature is useful to compare several simulations:

run_MANATEE('projectA');
export_design_to_excel('comp_projAB',0);
run_MANATEE('projectB');
export_design_to_excel('comp_projAB',1);

The first call to export_design_to_excel will use export_template.xlsx as template to create a file named comp_projAB_design_export.xlsx with projectA’s values in column E.

The second call to export_design_to_excel will use comp_projAB_design_export.xlsx as template to create a file name comp_projAB_design_export.xlsx with projectB’s values in column F. The result is a file with the values of both projects.

Previous Next