| Power System Blockset | Search  Help Desk |
| Power2sys | See Also |
Analyze an electric circuit built with the Power System Blockset
Syntax
POWER2SYS('simwin'); [A,B,C,D,x0,state_var,inputs,outputs,uss,xss,yss,freqyss,Hlin]= POWER2SYS('simwin'); [A,B,C,D,x0,state_var,inputs,outputs,uss,xss,yss,freqyss,Hlin]= POWER2SYS('simwin','n');
Description
The Power2sys block is used to computes the equivalent state-space model of an electrical network built with the Power System Blockset.power2sys extracts the linear part of the simwin system and builds the corresponding state-space model. State variables are the inductor currents and capacitor voltages. Nonlinear elements are simulated by current sources (state-space model inputs) driven by the voltages (state-space model outputs) across the nonlinear elements.
[A,B,C,D,x0,state_var,inputs,outputs,uss,xss,yss,freqyss, Hlin]=POWER2SYS(x0 is a vector containing the initial conditions of the state variables listed in'simwin') computes the equivalent state-space model of the Simulink window namedsimwin. A,B,C,D are the standard matrices of the state-space system described by the equations
state_var.
state_var is a string matrix containing names of the state variables (x vector). Each line of state_var 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:
state_var lines, one for each leakage inductance, with the suffix coil:x where x is the winding number of the transformer.
inputs is a string matrix containing names of the inputs of the system (vector u). 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.
The following conventions are used for inputs:
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 which produces the output. Sign conventions are indicated by the polarities of the voltage measurement and current measurement blocks.
uss, xss, and yss are complex matrices containing the steady-state values (phasors) 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 freqyss vector.
freqyss is a column vector containing the n_freq input source frequencies ordered by increasing values.
Hlin is the complex transfer impedance three-dimension array (n_output by n_input by n_freq) of the linear system corresponding to the frequencies contained in the freqyss vector. For a particular frequency, Hlin is defined by
yss(:,ifreq) = Hlin(:,:,ifreq) x uss(:,ifreq)
'n', powers2sys generates a netlist stored in a file, simwin.net. This file contains the node numbers automatically generated by power2sys, as well as parameter values of all linear elements. See formats in the circ2ss reference section.
Example
First open the psbnetsim2.mdl example then execute power2sys:
psbnetsim2
[A,B,C,D,x0,states,inputs,outputs,uss,xss,yss,freqyss,
Hlin]=power2sys('psbnetsim2')
A =
1.0e+04 *
0 6.2500
-0.0083 -1.4250
B =
1.0e+04 *
0 -6.2500
0.0083 1.000
C =
1 120
0 0
D =
0 -120
0 1
Initial values of states:
x0 =
-513.1443
2.9190
states =
Uc_120 Ohms 16 uF
Il_51 Ohms 12 mH
inputs =
U_1000V 60Hz
I_Breaker Ron=0.01 Lon=10e-6
outputs =
U_Breaker Ron=0.01 Lon=10e-6
I_Current Measurement
Steady-state phasor values of input sources, states, and outputs
uss =
1000
0
xss =
1.0e+02 *
4.8392 - 5.1314i
0.0310 + 0.0292i
yss =
1.0e+02 *
8.5535 - 1.6287i
0
The system contains only one source frequency:
freqyss =
60
Transfer function matrix:
Hlin =
0.8553 - 0.1629i -44.3596 + 4.4368i
0 1.0000
There are two state variables in this circuit. Note that the breaker block is a nonlinear element, which is represented by a current source (second input) driven by the voltage across the breaker (first output).
See Also
Circ2ss