MATLAB: Does POWER_ANALYZE error out when I use it on the model in SimPowerSystems 5.2.1 (R2010a)

Simscape Electrical

I run POWER_ANALYZE on my model by issuing the following command:
load_system (modelName)
power_analyze(modelName,'structure')
The command errors out with:
??? Reference to non-existent field 'NumberOfSfunctionSwitches'.
Error in ==> C:\Program
Files\MATLAB\R2010a\toolbox\physmod\powersys\powersys\private\powersolve.p>powersolve
at 302
<SNIP>

Best Answer

The error occurs when the model that is analyzed using POWER_ANALYZE does not contain a valid SimPowerSystems circuit. One such example is a model that contained only Simulink blocks and hence was not a suitable candidate to be analyzed.
The workaround is to use a valid model which contains a SimPowerSytems circuit.
Note that this error does not occur in later releases and due to the absence of a circuit the output structure will be mostly empty.