Support : Knowledge base

Knowledge Base

Welcome to OPAL-RT’s Knowledge Base

OPAL-RT offers a repository of support information for optimal use of its technology.

Loading…

Please note that OPAL-RT knowledge base is not fully optimized for mobile platforms.

For optimal experience, use a desktop computer.

Reference Number: AA-02019// Views: AA-02019// Created: 2021-06-01 18:40:39// Last Updated: 2021-06-07 09:35:59
HowTo
How to calculate the number of states of Simulink model

A state-space model is commonly used for representing a linear time-invariant (LTI) system. It describes a system with a set of first-order differential or difference equations using inputs, outputs, and state variables. SimPowersSystems (SPS) is State-Space based solver for electrical circuits.


But how to calculate the number of states of a model ? 

 

  • Method 1 (this is valid for a fully coupled model) 

The command can be used to calculate the number of states. This command computes the equivalent state-space model of the specified electrical model built with Simscape™ Electrical™ Specialized Power Systems software. It evaluates the A, B, C, D standard matrices of the state-space system described by the equations :



The number of states can be calculated as follows:


1.    Open the simulink model (if the model contains Artemis block, you must remove or comment it),

2.    Be sure that the model runs offline,

3.    Go to Matlab and type the command : <SPS=power_analyze ('xxx', 'detailed')>; xxx is the name of the model (as shown below),

4.    Some warnings may appear but you can ignore them,

5.    Type the command : SPS.A,1)> to show the results.






  • Method 2 : 

           1. Open the simulink model 

           2. Double click on the PowerGui block > "Preferences"

           3. Activate the option "Display Simscape Power Systems ST compilation messages" (as shown below)





           4. Run the model offline and go to "Diagnostic Viewer". The total number of states will be displayed as shown below.