0% found this document useful (0 votes)
12 views

Ece451 Lec 2

The document discusses state space representation in dynamic systems, defining key concepts such as state variables, state vectors, and state space. It explains how the behavior of a system can be described using state differential equations and output equations in matrix form. Examples of RLC circuits and mechanical systems illustrate the application of these concepts in modeling system dynamics.

Uploaded by

Fady Adel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Ece451 Lec 2

The document discusses state space representation in dynamic systems, defining key concepts such as state variables, state vectors, and state space. It explains how the behavior of a system can be described using state differential equations and output equations in matrix form. Examples of RLC circuits and mechanical systems illustrate the application of these concepts in modeling system dynamics.

Uploaded by

Fady Adel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Lec 7

State Space Representation


System output
input

𝑋1 , 𝑋2 , … … … , 𝑋𝑛
State

The state of a dynamic system is the smallest set of


variables such that the knowledge of these variables a
t = t0, with the knowledge of input for t≥t0 completely
determines the behavior of the system for any time
t≥t0.
State Variables
• The state variables of a dynamic system are the variable which make
up the smallest set of variables that determine the state of the
dynamic system.

• If at least n variables are needed to completely describe the behavior


of a dynamic system, then such n variables are a set of state variables.
State Vector
• If n state variables are needed to completely describe the behavior of
a given system, then these n state variables can be considered the n
components of a vector x. Such a vector is called a state vector.

• A state vector is a vector that determines uniquely, the system state


x(t) for any time t≥t0 once the state at t = t0 is given and the input u
(t) for t≥t0 is specified.
State Space
• The n dimensional space where x1 axis, x2 axis, …. , xn axis, where x1,
x2, …. , xn are state cariables, is called the state space.

• Any state can be represented by a point in the state space.


Definitions

• Define n state variables: x1(t), x2(t), ……… xn(t). Then the


system may be described by
The State Differential Equation:
The state of a system is described by the set of first-order differential equations
written in terms of the state variables [x1 x2 ... xn]. These first-order differential
equations can be written in general form as

x 1  a11x1  a12 x 2   a1n x n  b11u1   b1m u m


x 2  a 21x1  a 22 x 2   a 2 n x n  b 21u1   b 2 m u m

x n  a n1x1  a n 2 x 2   a nn x n  b n1u1   b nm u m
Thus, this set of simultaneous differential equations can be written in matrix
form as follows:

 x1   a 11 a 12  a 1n   x1 
       b11  b1m   u1 
 a 2n  x 2  
    
d  x 2  a 21 a 22
   
dt           
       b n1  b nm  u m 
 x n   a n1 a n2  a nn   x n 

n: number of state variables, m: number of inputs.

The column matrix consisting of the state variables is called the state vector
and is written as

 x1 
x 
x   2
 
 
x n 
• The outputs y1(t), y2(t), ……… yl(t) of the system may
be given by
 y1 
y 
Y (t )   2   output vector

 
 yl 

 y1   c11 c12  c1n   x1 


 y  c     d11  d1m   u1 
c22  c2 n   x2  
 2    21         
      
       d l1  d lm  u m 
 yl   cl1 cl 2  cln   xn 
The vector of input signals is defined as u. Then the system can be
represented by the compact notation of the state differential equation as

x  A x  B u
This differential equation is also commonly called the state equation. The
matrix A is an nxn square matrix, and B is an nxm matrix. The state differential
equation relates the rate of change of the state of the system to the state of the
system and the input signals. In general, the outputs of a linear system can be
related to the state variables and the input signals by the output equation

y C xDu
Where y is the set of output signals expressed in column vector form. The
state-space representation (or state-variable representation) is comprised of
the state variable differential equation and the output equation.
State Space Representation
• A continuous linear time invariant state space model takes the
following form:

A = State Matrix B = Input Matrix


C = Output Matrix D = Feedforward Matrix
Block Diagram
• A(t) is called the state matrix,
• B(t) the input matrix,
• C(t) the output matrix, and
• D(t) the direct transmission matrix.
• A block diagram representation
Example-1
For an RLC Circuit:

• The input is voltage source v(t) and the output is Vr(t)


• For the electric circuit, the states are
current in the coil and volt on the
For an RLC Circuit: capacitor
• The state variables are i(t) and Vc (t).
• X1(t) = i(t) x2(t)=vc(t)
 Ri  VC  vt 
di
L
dt

But , i t   c dvc dt

  i  Vc  vt 
di R 1 1 dVc 1
 And ,  i (t )
dt L L L dt c
x1 (t )   x1  x2  u t 
 R 1 1  1
x2 (t )  x1
L L L c

y  vR t   Ri (t )
For an RLC Circuit:

• The state variables are • In Matrix Form:


i(t) and Vc (t).

x  Ax  Bu u  vt 
 i (t )   di dt 
x(t )    x   
Vc(t ) dVc dt 

 R / L  1 / L  1 L 
A B 
 1/ C 0   0 

y  Cx  Du y  vR t   Ri (t )

C  R 0 D0
Example-2
• Consider the mechanical system shown in figure. We assume that the system is linear. The
external force u(t) is the input to the system, and the displacement y(t) of the mass is the
output. The displacement y(t) is measured from the equilibrium position in the absence of the
external force. This system is a single-input, single-output system.

• From the diagram, the system equation is

𝑚𝑦(𝑡)
ሷ + 𝑏𝑦(𝑡)
ሶ + 𝑘𝑦(𝑡) = 𝑢(𝑡)

• This system is of second order. This means that the system


involves two integrators. Let us define state variables 𝑥1 (𝑡)and
𝑥2 (𝑡)as

𝑥1 𝑡 = 𝑦(𝑡)
𝑥2 𝑡 = 𝑦(𝑡)

Example-2
𝑥1 𝑡 = 𝑦(𝑡) 𝑥2 𝑡 = 𝑦(𝑡)
ሶ 𝑚𝑦(𝑡)
ሷ + 𝑏𝑦(𝑡)
ሶ + 𝑘𝑦(𝑡) = 𝑢(𝑡)

• Then we obtain
𝑥ሶ 1 𝑡 = 𝑥2 (𝑡)
𝑏 𝑘 1
𝑥ሶ 2 𝑡 = − 𝑦ሶ 𝑡 − 𝑦 𝑡 + 𝑢 (𝑡)
𝑚 𝑚 𝑚
• Or
𝑥ሶ 1 𝑡 = 𝑥2 (𝑡)
𝑏 𝑘 1
𝑥ሶ 2 𝑡 = − 𝑥2 𝑡 − 𝑥1 𝑡 + 𝑢 (𝑡)
𝑚 𝑚 𝑚
• The output equation is
𝑦 𝑡 = 𝑥1 𝑡
Example-2
𝑏 𝑘 1
𝑥ሶ 1 𝑡 = 𝑥2 (𝑡) 𝑥ሶ 2 𝑡 = − 𝑥2 𝑡 − 𝑥1 𝑡 + 𝑢 (𝑡) 𝑦 𝑡 = 𝑥1 𝑡
𝑚 𝑚 𝑚

• In a vector-matrix form,

 x1 (t )   0 1   x (t )   0 
 x (t )     k b  1    1  u (t )
   x2 (t )   
 2   m m m

 x1 (t ) 
y (t )  1 0 
 2
x (t ) 
Example-2
• State diagram of the system is

𝑥ሶ 1 𝑡 = 𝑥2 (𝑡)
𝑏 𝑘 1
𝑥ሶ 2 𝑡 = − 𝑥2 𝑡 − 𝑥1 𝑡 + 𝑢 (𝑡)
𝑚 𝑚 𝑚

𝑦 𝑡 = 𝑥1 𝑡

-k/m

-b/m
1/m 𝑥ሶ 2 𝑥1
𝑢(𝑡) 1/s 1/s 𝑦(𝑡)
𝑥2 = 𝑥ሶ 1
Example-2
• State diagram in signal flow and block diagram format

-k/m

-b/m
1/m 𝑥ሶ 2 𝑥1
𝑢(𝑡) 1/s 1/s 𝑦(𝑡)
𝑥2 = 𝑥ሶ 1
Liquid Level System
Example-3

Find State Space Representation


𝒒𝒊 𝒕 = 𝒊𝒏𝒑𝒖𝒕 𝒇𝒍𝒐𝒘 𝒓𝒂𝒕𝒆 (𝒎𝟑 /𝒔𝒆𝒄).
𝒒𝒐 𝒕 = 𝒐𝒖𝒕𝒑𝒖𝒕 𝒇𝒍𝒐𝒘 𝒓𝒂𝒕𝒆 (𝒎𝟑 /𝒔𝒆𝒄).
𝒒𝟏 𝒕 = 𝒇𝒍𝒐𝒘 𝒓𝒂𝒕𝒆 𝒊𝒏 𝒕𝒉𝒆 𝒕𝒂𝒃𝒍𝒆 𝒄𝒐𝒏𝒏𝒆𝒄𝒕𝒊𝒏𝒈 𝒕𝒘𝒐 𝒕𝒂𝒏𝒌𝒔.
𝒉𝟏 𝒕 = 𝑳𝒊𝒒𝒖𝒊𝒅 𝒍𝒆𝒗𝒆𝒍 𝒊𝒏 𝑻𝒂𝒏𝒌𝒔𝟏 (𝒎)
𝒉𝟐 𝒕 = 𝑳𝒊𝒒𝒖𝒊𝒅 𝒍𝒆𝒗𝒆𝒍 𝒊𝒏 𝑻𝒂𝒏𝒌𝒔𝟐 (𝒎).

𝑪𝟏 , 𝑪𝟐 (Cross section area of tank 1 ,2)


Ans:

∵ 𝒊𝒏𝒑𝒖𝒕 𝒒𝒊 𝒕
output 𝒒𝒐 𝒕
𝒅 𝑪 𝟏 𝒉𝟏 𝒕 ሶ
𝒒𝒊 𝒕 − 𝒒𝟏 𝒕 = = 𝑪𝟏 𝒉𝟏 𝒕 ....(1)
𝒅𝒕
𝟏
𝒒𝟏 𝒕 = 𝒉𝟏 𝒕 − 𝒉𝟐 𝒕 .................................(2)
𝑹𝟏
𝒅 𝑪 𝟐 𝒉𝟐 𝒕 ሶ
𝒒𝟏 𝒕 − 𝒒𝒐 𝒕 = = 𝑪𝟐 𝒉𝟐 𝒕 ....(3)
𝒅𝒕
𝒉 𝒕
𝒒𝒐 𝒕 = 𝟐 ................(4)
𝑹𝟐

States are : 𝑿𝟏 𝒕 = 𝒉𝟏 (t) 𝑿𝟐 𝒕 = 𝒉𝟐 (t)


h2  q1 t 
𝒅 𝑪 𝟏 𝒉𝟏 𝒕 dh1 1 1 1
𝒒𝒊 𝒕 − 𝒒𝟏 𝒕 = = 𝑪 𝟏 𝒉𝟏 ሶ 𝒕   h1 
𝒅𝒕 dt c1 R1 c1 R1 c1
𝟏
x2  u t 
 1 1 1
𝒒𝟏 𝒕 = 𝒉𝟏 𝒕 − 𝒉𝟐 𝒕 x1 (t )   x1 
𝑹𝟏 c1 R1 c1 R1 c1

𝒅 𝑪 𝟐 𝒉𝟐 𝒕 dh2 1 1 1
𝒒𝟏 𝒕 − 𝒒𝒐 𝒕 = = 𝑪 𝟐 𝒉𝟐 ሶ 𝒕   h1  (  )h2
𝒅𝒕 dt c2 R1 c2 R1 c2 R2
 1 1 1
𝒉𝟐 𝒕 x2 (t )  x1  (  ) x2
𝒒𝒐 𝒕 = 𝑹𝟐
c2 R1 c2 R1 c2 R2
 1 1 
   1
 x1 (t )

c1 R1 c1 R1  x1 (t ) 
     x (t )   c1  u (t )
 x2 (t )  1 1 1   2   
c R -(  ) 0 
 2 1 c2 R1 c2 R2 

1
qo (t )  x2 (t )
R2
 1   x1 (t ) 
y (t )  0  
 R2   x2 (t ) 
ANALYSIS OF STATE VARIABLE MODELS USING MATLAB

Given a transfer function, we can obtain an equivalent state-space representation


and vice versa. The function tf can be used to convert a state-space
representation to a transfer function representation; the function ss can be used
to convert a transfer function representation to a state-space representation. The
functions are shown in Figure 4, where sys_tf represents a transfer function model
and sys_ss is a state space representation.

x  Ax  Bu Y(s)  G(s)U(s)
x  Ax  Bu y  Cx  Du
State-space object
y  Cx  Du

sys_ss=ss(sys_tf)

sys_tf=tf(sys_ss)

sys=ss(A,B,C,D) x  Ax  Bu
Y(s)  G(s)U(s)
y  Cx  Du
The ss function

Linear system model conversion


Figure 4.
Dorf and Bishop, Modern Control Systems
For instance, consider the third-order system

Y(s) 2 s2  8 s  6
G(s)  
R (s) s3  8 s 2  16 s  6

We can obtain a state-space representation using the ss function. The state-


space representation of the system given by G(s) is
Transfer function:
Matlab code 2 s^2 + 8 s + 6
----------------------
s^3 + 8 s^2 + 16 s + 6
num=[2 8 6];den=[1 8 16 6];
Answer a=
sys_tf=tf(num,den) x1 x2 x3
x1 -8 -4 -1.5
sys_ss=ss(sys_tf) x2
x3
4 0 0
0 1 0

b=

 8  4  1.5  2
u1
x1 2

A   4 0  , B  0
x2 0
0 x3 0

 0 0  0
c=
1 y1
x1 x2 x3
1 1 0.75

d=

C  1 1 0.75 and D  0


u1
y1 0

Continuous-time model.
 8  4  1.5  2
A   4 0 0  , B  0
 0 1 0  0

C  1 1 0.75 and D  0

1
R(s) x1 x2
x3 Y(s)
2 1/s 4 1/s 1 1/s 0.75

-8

-4

-1.5

Block diagram with x1 defined as the leftmost state variable.

You might also like