Three-Phase Custom Simplified Synchronous Machine
This example shows how simplify the custom Simscape™ synchronous machine model.
Detailed Machine Equations
Detailed per-unit stator voltage equations include the effect of rate of change of magnetic flux linkage, and the effect of speed variation:


Simplified Machine Equations
Large-scale studies are simulations that include more than 10 generators or motors. To reduce computational requirements of large-scale studies, simplifications are necessary. Simplifications for large-scale studies, include neglecting the following:
The transformer voltage terms,
and 
The effect of speed variations.
is set to 1.
These simplifications yield the following per-unit stator voltage equations:


Simscape Component Comparison
You can use the Comparison Tool to see the differences between the detailed and simplified Simscape components. Type visdiff( 'CustomSM', 'CustomSimplifiedSM' ) at the MATLAB® command line to open the Comparison Tool to see the detailed differences on lines 155 and 156 of the files. The detailed Synchronous Machine component is on the left side, and the simplified Synchronous Machine component is on the right side.
Open Model
Open the model.

Define Initial Conditions
Specify values of initial conditions.
Define Variants
The example model, CustomSimplifiedSMModel, has been configured using Simulink® Variants. To execute the detailed model, set the variable isSimplified to false. To execute the simplified model, set the variable isSimplified to true.
Execute Simulations and Collect Results
Simulate detailed model.
Simulate simplified model.
Plot Results
The voltage and rotor velocity traces can be overlaid to directly compare differences.

Results from Real-Time Simulation
This example has been tested on these platforms:
Speedgoat™ Performance real-time target machine with an Intel® 3.5 GHz i7 multi-core CPU and 4 GB RAM.
dSPACE® SCALEXIO LabBox with Intel® Core XEON E3-1275v3 at 3.5GHz and 4 GB RAM.
You can run this model in real time with a step size of 50 microseconds by using the Simscape local solver. For small sample rates, a task overrun might occur during the initial task execution due to a cold cache. To avoid this overrun, if the selected platform supports these options, relax the start-up behavior by specifying a limited number of task overruns or increasing the sample time of periodic tasks during the start-up phase of the real-time application.
Conclusion
This example shows:
How to simplify the custom synchronous machine model
A comparison of Simscape component source code
A comparison of model simulation outputs