Products & Services Solutions Academia Support User Community Company

Learn more about SimPowerSystems   

Analyzing a Simple Circuit

Introduction

In this section you

Electrical State Variables

The electrical state variables are the Simulink states of your diagram associated to the capacitor and inductor devices of the SimPowerSystems blocks. Inductors and capacitors elements are found in the RLC-branch type blocks such as the Series RLC Branch block, Three-Phase Parallel RLC Load block, in the transformer models, in the PI Section Line block, in the snubber devices of the power electronic devices, etc.

The electrical state variables consist of the inductor currents and the capacitor voltages. Variable names forSimPowerSystems electrical states contain the name of the block where the inductor or capacitor is found, preceded by the Il_ prefix for inductor currents or the Uc_ prefix for capacitor voltages.

State-Space Representation Using power_analyze

You compute the state-space representation of the model circuitl with the power_analyze command. Enter the following command at the MATLAB prompt.

[A,B,C,D,x0,electrical_states,inputs,outputs]=power_analyze('circuit1')

The power_analyze command returns the state-space model of your circuit in the four matrices A, B, C, and D. x0 is the vector of initial conditions of the electrical states of your circuit. The names of the electrical state variables, inputs, and outputs are returned in three string matrices.

electrical_states =

Il_110 Mvars
Uc_input PI Section Line
Il_ sect1 PI Section Line
Uc_output PI Section Line
Il_Z_eq
Uc_Z_eq

inputs =

U_Vs

outputs =

U_U1
U_U2

Note that you could have obtained the names and ordering of the electrical states, inputs, and outputs directly from the Powergui block. See the power_analyze reference page for more details on how to use this function.

Steady-State Analysis

To facilitate the steady-state analysis of your circuit, the powerlib library includes a graphical user interface tool. If the Powergui block is not already present in your model, copy the block from the library into your circuit1 model and double-click the block icon to open it.

From the Analysis tools menu of the Powergui block, select Steady-State Voltages and Currents. This opens the Steady-State Tool window where the steady-state phasors voltages measured by the two voltage measurement blocks of your model are displayed in polar form.

Each measurement output is identified by a string corresponding to the measurement block name. The magnitudes of the phasors U1 and U2 correspond to the peak value of the sinusoidal voltages.

From the Steady-State Tool window, you can also display the steady-state values of the source voltage or the steady-state values of the inductor currents and capacitor voltages by selecting either the Sources or the States check box.

Refer to the section Measuring Voltages and Currents for more details on the sign conventions used for the voltages and currents of sources and electrical state variables listed in the Steady-State Tool window.

Frequency Analysis

The Measurements library of powerlib contains an Impedance Measurement block that measures the impedance between any two nodes of a circuit. In the following two sections, you measure the impedance of your circuit between node B2 and ground by using two methods:

Obtaining the Impedance vs. Frequency Relation from the State-Space Model

To measure the impedance versus frequency at node B2, you need a current source at node B2 providing a second input to the state-space model. Open the Electrical Sources library and copy the AC Current Source block into your model. Connect this source at node B2, as shown below. Set the current source magnitude to zero and keep its frequency at 60 Hz. Rearrange the blocks as follows.

AC Current Source at the B2 Node

Now compute the state-space representation of the model circuitl with the power_analyze command. Enter the following command at the MATLAB prompt.

sys1 = power_analyze('circuit1','ss')

This command returns a state-space model representing the continuous-time state-space model of your electrical circuit.

In the Laplace domain, the impedance Z2 at node B2 is defined as the transfer function between the current injected by the AC current Source block and the voltage measured by the U2 Voltage Measurement block.

You obtain the names of the inputs and outputs of this state-space model as follows.

sys1.InputName
ans = 
    'U_Vs'
    'I_AC Current Source'
sys1.OutputName
ans = 
    'U_U2'
    'U_U1'

The impedance at node B2 then corresponds to the transfer function between output 1 and input 2 of this state-space model. For the 0 to 1500 Hz range, it can be calculated and displayed as follows.

freq=0:1500;
w=2*pi*freq;
bode(sys1(1,2),w);

Repeat the same process to get the frequency response with a 10 section line model. Open the PI Section Line dialog box and change the number of sections from 1 to 10. To calculate the new frequency response and superimpose it upon the one obtained with a single line section, enter the following commands.

sys10 = power_analyze('circuit1','ss');
bode(sys1(1,2),sys10(1,2),w);

Open the property editor of the Bode plot and select units for Frequency in Hz using linear scale and Magnitude in absolute using log scale. The resulting plot is shown below.

Impedance at Node B2 as Function of Frequency

This graph indicates that the frequency range represented by the single line section model is limited to approximately 150 Hz. For higher frequencies, the 10 line section model is a better approximation.

The system with a single PI section has two oscillatory modes at 89 Hz and 229 Hz. The 89 Hz mode is due to the equivalent source, which is modeled by a single pole equivalent. The 229 Hz mode is the first mode of the line modeled by a single PI section.

For a distributed parameter line model the propagation speed is

The propagation time for 300 km is therefore T = 300/293,208 = 1.023 ms and the frequency of the first line mode is f1 = 1/4T = 244 Hz. A distributed parameter line would have an infinite number of modes every 244 + n*488 Hz (n = 1, 2, 3...). The 10 section line model simulates the first 10 modes. The first three line modes can be seen in Impedance at Node B2 as Function of Frequency (244 Hz, 732 Hz, and 1220 Hz).

Obtaining the Impedance vs. Frequency Relation from the Impedance Measurement and Powergui Blocks

The process described above to measure a circuit impedance has been automated in a SimPowerSystems block. Open the Measurements library of powerlib, copy the Impedance Measurement block into your model, and rename it ZB2. Connect the two inputs of this block between node B2 and ground as shown.

Measuring Impedance vs. Frequency with the Impedance Measurement Block

Now open the Powergui dialog. In the Tools menu, select Impedance vs Frequency Measurement. A new window opens, showing the list of Impedance Measurement blocks available in your circuit.

In your case, only one impedance is measured, and it is identified by ZB2 (the name of the ZB2 block) in the window. Fill in the frequency range by entering 0:2:1500 (zero to 1500 Hz by steps of 2 Hz). Select the logarithmic scale to display Z magnitude. Select the Save data when updated check box and enter ZData as the variable name to contain the impedance vs. frequency. Click the Update button.

When the calculation is finished, the window displays the magnitude and phase as functions of frequency. The magnitude should be identical to the plot (for one line section) shown in Impedance at Node B2 as Function of Frequency. If you look in your workspace, you should have a variable named ZData. It is a two-column matrix containing frequency in column 1 and complex impedance in column 2.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS