Download Use State Variable to represent circuits Let`s start with a simple

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Rectifier wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Multidimensional empirical mode decomposition wikipedia , lookup

Signal-flow graph wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Buck converter wikipedia , lookup

Metadyne wikipedia , lookup

Two-port network wikipedia , lookup

Opto-isolator wikipedia , lookup

Transcript
EE 422G Notes: Chapter 7
Instructor: Cheung
Use State Variable to represent circuits
Let’s start with a simple example:
L=1H
R=2Ω
+
u(t)
a
y(t)
C=1F
i
+
-
-
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:
iC = C
dvC
dt
and
vL = L
diL
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.
KCL at node a:
KVL:
dx1 1
= x2
dt C
dx 2
1
R
1
= − x1 − x 2 + u
dt
L
L
L
These two equations can be more compactly written in matrix form:
1 / C  x1   0 
 x&1   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:
Output Equation:
 x1 
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
1/ C 
 0
 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 
x&1 =
 −1
1
1
1  v − x1
1
1
iC = (iR1 − iL ) =  s
− x 2  =
x1 − x 2 +
vs
C
C
C  R1
C
R1C
 R1C
(1)
x& 2 =
1
1
1
1
R
v L = ( vc − y ) = (x1 − R2 x2 ) = x1 − 2 x 2
L
L
L
L
L
(2)
Combining (1) and (2):
 1
−
 x&1   CR1
⇒ =
 x2   1
 L
1
 1 
C   x1  + 
CR  v

R2   x2   1  s
−
 0 
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
Step 2: For each iL , write a KVL ( i&L =
diL
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
Given H ( s) =
Find
N ( s ) bm s m + bm−1s m−1 + ... + b1s + b0
= n
D(s )
s + an−1s n−1 + ... + a1s + a0
x& = Ax + Bu
(Assume m<n ⇒ BIBO)
(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.
Given a system H ( s) =
N ( s)
, we can implement this with the following block
D(s )
diagram:
u(t )
1
D(s )
v (t )
N (s)
y (t )
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
 

  d
 
 
 x2 (t )   dt v (t )   x& 2 (t )   x3 (t )   0
 M  =  M  ⇒  M  =  M  = M
 

  d n−2
 
 
 xn−1 (t )   dt n − 2 v (t )   x& n−1 (t )   xn (t )   0
 x (t )   d nn−−11 v (t )   x& (t )   x& (t )   ?
 n
  dt
  n  
  n
1 0 ... 0 0  x1 (t ) 


0 1 ... 0 0  x2 (t ) 
M M M M M  M 


0 0 ... 0 1  xn−1 (t ) 
? ? ? ? ?  xn (t ) 
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
D(s )
u(t )
v (t )
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
v
(
t
)
+
a
v (t ) + K + a1 v (t ) + a0v (t )
n −1
n
n −1
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 )
u( t ) =
Now plug it back to our system:
 x&1   0
  
 x&2   0
 M = K
  
 x&n   − a0
1
0
0
0
1
0
K
K
K
− a1
− a2
− a3
0  x1   0 
   
K
0  x2   0 
+
u( t )
K K  M   M 
   
K − an−1  xn   1 
K
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
v
(
t
)
+
b
v (t ) + K + b1 v (t ) + b0v (t )
m −1
m
m −1
dt
dt
dt
= bm xm+1 (t ) + bm −1 xm (t ) + K + b1 x2 (t ) + b0 x1 (t )
y (t ) = bm
= (b0
b1
 x1 


 x2 
L bm )
M 


 xm+1 
Page 7-8
EE 422G Notes: Chapter 7
Example/ H ( s ) =
Instructor: Cheung
4 s 2 + 3s − 1
6s3 + 7s2 + s + 5
First, we normalize H(s) so that the leading coefficient of the denominator
2 s2 + 1 s − 1
6
polynomial is 1: H ( s ) = 3 3 2 2
7
1
s +
s + s+5
6
6
6
By inspection, we can just write out the state equations:
 x&1 
0
 

 x& 2  =  0
 x& 
 −5
 3
 6
y
=
1
0
−1
6
(−1 6
0  x1   0 
   
1  x2  +  0 u
 1
−7  x 
6  3 
 
 x1 
 
1
2 ) x
2
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 


2
 CA 


 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.
2.
3.
4.
At t = 0 , x (t ) = 0 (or can be any initial state)
Compute dynamics: x& (t ) = Ax(t ) + Bu(t )
Compute output: y (t ) = Cx (t ) + Du(t )
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:
e At = I + At +
1 2 2 1 33
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