| SimPowerSystems | ![]() |
Analyze an electric circuit built with Power System Blockset
Syntax
psb = power2sys('sys','structure') psb = power2sys('sys','sort') psb = power2sys('sys','ss') [A,B,C,D,x0,states,inputs,outputs,uss,xss,yss,freqyss,Hlin]= power2sys('simwin'); psb = power2sys('sys','net')
Description
The power2sys function computes the equivalent state space model of the specified electrical model built with Power System Blockset. It evaluates the A, B, C, D standard matrices of the state space system described by the equations
where the state variables contained in the x vector are the inductor currents and capacitor voltages. Nonlinear elements are simulated by current sources driven by the voltages across the nonlinear elements.
The inputs of the system contained in the u vector are the voltage and current sources plus the current sources simulating the nonlinear elements. The following conventions are used for inputs:
The outputs of the system contained in the y vector are the voltage and current measurement plus the voltages across the nonlinear elements.
psb = power2sys('sys','structure') creates a structure array with fields and values describing the model 'sys'.
The fields are defined in the following order.
The table uses the following conventions:
nstates is the number of states.
ninput is the number of inputs.
noutput is the number of outputs.
nfreq is the number of input source frequencies.
states is a string matrix containing names of the state variables. Each line of states begins with a prefix Uc_ for capacitor voltages or Il_ for inductor currents, followed by the name of the block in which the element (C or L) is found. Inductor current direction and capacitor voltages polarities are defined by the input and output of the block. The following conventions are used:
A suffix is added to the line for blocks containing more than two inductances or capacitors. For example, the Linear Transformer blocks produce three lines in the states matrix, one for each leakage inductance, with the suffix windingx, where x is the winding number of the transformer.
inputs is a string matrix containing names of the inputs of the system. Each line of inputs begins with a prefix U_ for voltage sources or I_ for current sources, followed by the name of the source block.
A suffix can be added to the input for blocks containing more than one source. For example, the Simplified Synchronous Machine block produces two current inputs with suffixes AB and BC.
outputs is a string matrix containing names of the outputs of the state space system (vector y). Each line of outputs begins with a prefix U_ for voltage outputs or I_ for current outputs, followed by the name of the block that produces the output. Sign conventions are indicated by the polarities of the voltage measurement and current measurement blocks.
A,B,C,D are the state space matrices of the linear part of the model.
x0 is a vector containing the initial conditions of the state variables listed in the states variable.
uss, xss, and yss are complex matrices containing the steady state values of inputs, states and outputs. If voltage and current sources all generate the same frequency, these are column vectors. If sources with different frequencies are used, each column of the matrices corresponds to a frequency contained in the frequencies vector.
frequencies is a column vector containing the input source frequencies ordered by increasing values.
Hlin is the complex transfer impedance three-dimensional array (nfreq-by-noutput-by ninput) of the linear system corresponding to the frequencies contained in the frequencies vector. For a particular frequency, Hlin is defined by
psb = power2sys('sys','sort') returns a structure array with the following fields related to the interconnection of Power System Blockset blocks in a model. The fields are defined in the following order.
[A,B,C,D,x0,states,inputs,outputs,uss,xss,yss,frequencies,Hlin] = power2sys('sys') returns the state space calculations into separate variables.
If you own the Control System Toolbox, psb = power2sys('sys','ss') creates a continuous state space model of the model sys with matrices A, B, C, D. The output is a state space object.
Netlist. When called with an extra argument, 'net', powers2sys generates a netlist stored in a file, sys.net. This file contains the node numbers automatically generated by power2sys, as well as parameter values of all linear elements. See the formats described in the circ2ss reference page.
Example
Obtain the state space matrices and steady state voltages and currents for the psbnetsim2.mdl circuit.
returns the state space model in the psb structure variable.
The inductor of the 51 ohms 12 mH block and the capacitor of the 120 ohms 16 uF block are the two state variables in this circuit. The Breaker block is a nonlinear element that is represented by the first current source driven by the voltage across the breaker (the first output). Note that the current of the Breaker block is also an output of the system (third output).
See Also
circ2ss, powerinit, Powergui
| circ2ss | powerinit | ![]() |