Ee 422G Notes: Chapter 7 Instructor: Cheung

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

EE 422G Notes: Chapter 7 Instructor: Cheung

Use State Variable to represent circuits

Let’s start with a simple example:


R=2Ω L=1H
+ a +

u(t) i C=1F y(t)

- -
NOTE: in this chapter, we will use u(t) (not to be confused with the step function)
to denote the input and use x(t) to denote the state.

1. Define the states:


Similar to the discrete-case, we define the states based on the memory
storage elements. For passive circuit, the memory storage elements are the
capacitors and inductors:
dvC diL
iC = C and vL = L
dt dt
As the knowledge capacitor voltage and inductor current allows us to infer
the capacitor current and the inductor voltage by taking derivatives, we
define state variables to be the capacitor voltage and inductor current.
x1 = v c (t )
x 2 = iL (t )
Note that there is one state variable for each memory storage element.

2. Derive the “State” and “Output” equations – express the derivatives of the
states and the output in terms of the current state and the input ONLY.
dx1 1
KCL at node a: = x2
dt C
dx 2 1 R 1
KVL: = − x1 − x 2 + u
dt L L L
These two equations can be more compactly written in matrix form:
 x&1   0 1 / C  x1   0 
  =    +  u
 x&2   − 1 / L − R / L  x2  1 / L 
The above matrix equation is called the State Equation because it relates the
change (1st-order derivative) of the state to the current state and input.

We can also relate the output to the state variables as follows:


 x1 
Output Equation: y (t ) = (1 0 ) 
 x2 

Page 7-5
EE 422G Notes: Chapter 7 Instructor: Cheung

Using this approach, we can write the state-variable representation for any circuit.
In general, the state and output equations are always in the following form:

x& = Ax + Bu
y = Cx + Du

In our previous example, we have


 0 1/ C   0 
A =  , B =  , C = (1 0), D = 0
 − 1/ L − R / L 1 / L 
Be very careful about the dimensions of each matrix. Let’s do another example:

Step 1: Define the state variable: vc as x1, iL as x2


Step 2: Express the derivatives x&1 , x& 2 and output y in terms of x1, x2 and input vs.
x 
y = R2i R2 = R2i L = R2 x 2 = (0 1) 1  Output Equation
 x2 
1 1 1  v − x1  −1 1 1
x&1 = iC = (iR1 − iL ) =  s − x 2  = x1 − x 2 + vs (1)
C C C  R1  R1C C R1C

v L = ( vc − y ) = (x1 − R2 x2 ) = x1 − 2 x 2
1 1 1 1 R
x& 2 = (2)
L L L L L

Combining (1) and (2):


 1 1
− −  1 
 x&1   CR1 C   x1  + 
⇒ =  CR  v
 x2   1 R2   x2   1  s
−  0 
 L L  State Equation

Page 7-6
EE 422G Notes: Chapter 7 Instructor: Cheung

To summarize:
For electrical network: select i L and v C as state variables.
Step 1: Select each iL and vc as state variables
diL
Step 2: For each iL , write a KVL ( i&L = will be included)
dt
For each vc , write a KCL ( v&C will be included)
Step 3: Other KCL and KVL, and element relation to eliminate “other”
variables (other than states (iL, vc ) and sources (input).
=>state equation.
Step 4 : Output equation

State Equation from Transfer Functions

State Equation => Tell how to realize and simulate (system realization) the systems
N ( s ) bm s m + bm−1s m−1 + ... + b1s + b0
Given H ( s) = = n (Assume m<n ⇒ BIBO)
D(s ) s + an−1s n−1 + ... + a1s + a0

x& = Ax + Bu
Find (u --- scalar, y--- scalar)
y = Cx + Du
−1
Such that C ( sI − A) B + D (the transfer function expression derived directly
from the state equations) equals the given transfer function.

N ( s)
Given a system H ( s) = , we can implement this with the following block
D(s )
diagram:

1 v (t )
u(t ) N (s) y (t )
D(s )

Assume the denominator polynomial is an nth-degree polynomial, define our state


vector as a n-dimensional vector follows:
 x1 (t )   v(t )   x&1 (t )   x 2 (t )   0 1 0 ... 0 0  x1 (t ) 
   d        
 x2 (t )   dt v (t )   x& 2 (t )   x3 (t )   0 0 1 ... 0 0  x2 (t ) 
 M  =  M  ⇒  M  =  M  = M M M M M M  M 
   d n−2        
 xn−1 (t )   dt n − 2 v (t )   x& n−1 (t )   xn (t )   0 0 0 ... 0 1  xn−1 (t ) 
 x (t )   d nn−−11 v (t )   x& (t )   x& (t )   ? ? ? ? ? ?  xn (t ) 
 n   dt   n   n  

Page 7-7
EE 422G Notes: Chapter 7 Instructor: Cheung

Note that our definition already provide almost the complete form of a state
equation, except that we don’t have an expression for x&n (t ) .
That has to come from the system. In the first part of our system:

1
u(t ) v (t )
D(s )

U ( s ) = D ( s )V ( s )
Or:
= s nV ( s ) + an−1s n −1V ( s ) + K + a1sV ( s ) + a0V ( s )

Applying inverse Laplace Transform:


dn d n−1 d
u( t ) = n
v ( t ) + a n −1 n −1
v (t ) + K + a1 v (t ) + a0v (t )
dt dt dt
= xn (t ) + an−1 xn (t ) + ... + a1 x2 (t ) + a0 x1 (t )
&
x& n (t ) = u (t ) − an −1 xn (t ) − ... − a1 x2 (t ) − a0 x1 (t )

Now plug it back to our system:

 x&1   0 1 0 0 K 0  x1   0 
      
 x&2   0 0 1 0 K 0  x2   0 
 M = K K K K K K  M   M 
+ u( t )
      
 x&n   − a0 − a1 − a2 − a3 K − an−1  xn   1 

Let N ( s ) = b s m + b1 s m −1 + K + bm −1 s + bm . The output equation can be written as


Y ( s ) = N ( s )V ( s )
= bm s mV ( s ) + bm−1s m−1V ( s ) + K + b1sV ( s ) + b0V ( s )
In time domain:
dm d m−1 d
y (t ) = bm m
v ( t ) + bm −1 m −1
v (t ) + K + b1 v (t ) + b0v (t )
dt dt dt
= bm xm+1 (t ) + bm −1 xm (t ) + K + b1 x2 (t ) + b0 x1 (t )
 x1 
 
 x2 
= (b0 b1 L bm )
M 
 
 xm+1 

Page 7-8
EE 422G Notes: Chapter 7 Instructor: Cheung

4 s 2 + 3s − 1
Example/ H ( s ) =
6s3 + 7s2 + s + 5

First, we normalize H(s) so that the leading coefficient of the denominator


2 s2 + 1 s − 1
polynomial is 1: H ( s ) = 3 3 2 2 6
s + 7 s + s+5
1
6 6 6
By inspection, we can just write out the state equations:
 x&1  0 1 0  x1   0 
      
 x& 2  =  0 0 1  x2  +  0 u
 x&   −5 −1 −7  x   1
 3  6 6 6  3   
 x1 
 
y = (−1 6 1
2
2 ) x
3  2
x 
 3
Where do we go from here?

After obtaining the state variable representation, it will allow us to

1. Analyze its stability, controllability and observability


a. The “eigenvalues” of our state matrix A are precisely the poles of the
linear system.
b. A system is called controllable if, regardless of its initial state, we can
drive its state to any value within finite time by using a suitable input.
A system is controllable if and only if the following matrix is
invertible:
[B | AB | AB 2
| L | AB n −1 ]
c. A system is called observable if we can determine the initial state
given any output. A system is observable if and only if the following
matrix is invertible:
 C 
 CA 
 
 CA 2

 
 M 
CA n −1 

Page 7-9
EE 422G Notes: Chapter 7 Instructor: Cheung

2. Simulate it with a computer by discretization

x& = Ax + Bu
To simulate we can follow the procedure below:
y = Cx + Du

1. At t = 0 , x (t ) = 0 (or can be any initial state)


2. Compute dynamics: x& (t ) = Ax(t ) + Bu(t )
3. Compute output: y (t ) = Cx (t ) + Du(t )
4. Compute new state by Taylor Series Expansion:
x (t + ∆t ) = x(t ) + x& (t )∆t
5. t = t + ∆t
6. Go to step 2.

This implementation assumes the input is constant and the state vector is
linear within the sample interval [t , t + ∆t ) . While the first assumption is not
too unreasonable, we can improve upon the second one by combining step 2
and 4 together to compute
x(t + ∆t ) = e A∆t x(t ) + (e A∆t − I ) A −1Bu (t )
This involves a matrix exponential which can be computed by using Taylor
Series:
1 2 2 1 33
e At = I + At + A t + A t + ......
2! 3!

But I am afraid we are running out of time. For further reference on the use of
State-Variable Representation, please consult the excellent text “Linear System
Theory and Design” by C.T. Chen.

Page 7-10

You might also like