# Simulation and Analysis

Analyze, tabulate, and plot harmonic data using analysis functions and Simscape™ logging variables. Simulate thermal losses due to switching events and conduction losses in semiconductors. Perform a load-flow analysis and use the results to initialize AC steady state simulation.

## Simscape Blocks

Busbar | Load flow analysis busbar connector |

Load Flow Source | Three-phase voltage source for performing load flow analysis |

## Functions

`ee_calculateFluxPartialDerivatives` | Calculate flux partial derivatives for FEM-Parameterized PMSM block |

`ee_calculateThdPercent` | Compute the total harmonic distortion (THD) percentage |

`ee_comtradeDataset` | Read and extract values from COMTRADE record |

`ee_getBillOfMaterials` | Generate report for current model and all subsystems |

`ee_getEfficiency` | Calculate efficiency as function of dissipated power losses |

`ee_generateIdealPMSMfluxData` | Generate tabulated flux linkage data for ideal PMSM |

`ee_getHarmonics` | Return harmonic orders, magnitudes, and fundamental frequency |

`ee_getNodeDvDtSummary` | Calculate maximum absolute values of terminal voltage time derivatives (dv/dt) based on logged simulation data |

`ee_getNodeDvDtTimeSeries` | Calculate rates-of-change of voltage variables |

`ee_getPowerLossSummary` | Calculate dissipated power losses and switching losses |

`ee_getPowerLossTimeSeries` | Calculate dissipated power losses and switching losses, and return time series data |

`ee_importDeviceParameters` | Import device parameters from XML file to Simscape^{TM} IGBT
(Ideal, Switching) block |

`ee_plotHarmonics` | Plot percentage of fundamental magnitude versus harmonic order |

## Analysis Tools

Load-Flow Analyzer | Determine the steady-state voltage magnitudes and angles and real and reactive power flows for a three-phase AC network |

## Topics

**Examine the Simulation Data Logging Configuration of a Model**

Determine if data logging is enabled for your model.

**Choose a Simscape Electrical Function for an Offline Harmonic Analysis**

Explore the capabilities of Simscape Electrical™ harmonic analysis functions.

**Perform an Online Harmonic Analysis Using the Simscape Spectrum Analyzer Block**

Learn how to analyze harmonic distortion using the Spectrum Analyzer block.

Calculate power losses for Simscape Electrical semiconductor blocks.

**Perform a Load-Flow Analysis Using Simscape Electrical**

Learn how to perform a power-flow, or load-flow, analysis for a three-phase Simscape Electrical network using the Simscape three-phase electrical domain.

**Optimize Block Settings for Simulating with the Partitioning Solver**

Avoid simulation errors by configuring models for simulation with the specific solvers by using the `ee_updateSolver`

function.

**Phasor-Mode Simulation Using Simscape Components**

Configure your model to use frequency-time equation formulation.