8/3/2019 Chapter 3 State Variables
1/55
Chapter 3: Modeling in the Time Domain1
Chapter 3
Modeling in the Time Domain
8/3/2019 Chapter 3 State Variables
2/55
Chapter 3: Modeling in the Time Domain2
Cramers rule (1704-1752 Gabriel Cramer)
Ax+ By=f
Cx+Dy=g how do you solve it?
Lets eliminate y ADx+BDy=fD
- BCx+BDy=gB
(AD-BC)x=fD-gB x= (fD-gB)/(AD-BC)
Determinant=AD-BC
8/3/2019 Chapter 3 State Variables
3/55
Chapter 3: Modeling in the Time Domain3
Cramers rule
BCAD
fCgAy
BCAD
gBfDx
BCAD
gC
fA
yBCAD
Dg
Bf
x
BCADDet
g
f
y
x
DC
BA
!
!
-
!
-
!
!
!
-
Ax+By=f
Cx+Dy=g
8/3/2019 Chapter 3 State Variables
4/55
Chapter 3: Modeling in the Time Domain4
Examples; Cramers rule
1
5
491
5
38
1*12*3
31
43
1*12*3
23
14
3
4
21
13
32
43
!
!!
!
-
!
-
!
!
!
-
!
!
yx
yx
BCADDet
y
x
yx
yx
8/3/2019 Chapter 3 State Variables
5/55
Chapter 3: Modeling in the Time Domain5
Review of Matrices
? A ? A
-
!
-
!
-
-
!
-
!
-
-
!
-
-
963
852
741
987
654
321
,2
121
42
31
43
21
1210
86
87
65
43
21
T
T
T
T
yxy
x
8/3/2019 Chapter 3 State Variables
6/55
Chapter 3: Modeling in the Time Domain6
Review of Matrices
_ a
_ a j
j
T
Xyx
yxyx
Xyxy
x
AA
BABA
cwcz
cycx
wz
yxc
1i1ij
11j1
AC222
1
AC221
matrixsymmetric
11
113
33
33
43
21
76
54
43
21
76
54
)(
,86
42
43
212
!
-
!
!!
!
-
!
-
!
-
-
!
-
-
!
-
!
-
-
!
-
8/3/2019 Chapter 3 State Variables
7/55
Chapter 3: Modeling in the Time Domain7
Review of Matrices
!
-
{
-
!
-
!
-
-
-
!
-
!
-
-
zyx
zyx
zyx
z
y
x
ABBA
987
654
32
987
654
321
**
4631
3423
4*82*73*81*7
4*62*53*61*5
43
21*
87
65
5043
2219
8*46*37*45*3
8*26*17*25*1
87
65*
43
21
8/3/2019 Chapter 3 State Variables
8/55
Chapter 3: Modeling in the Time Domain8
Introduction
Frequency-domain technique rapidly providing stability and transient
response information Immediate can see the effect of varyingsystem parameters
State-space approach (modern, ortime-domain approach)can be used fornon-linear system with backlash,saturation and dead zones
8/3/2019 Chapter 3 State Variables
9/55
Chapter 3: Modeling in the Time Domain9
State-space Representation
Select a particular subset of allpossible system variables; state
variables For an nth order system, write n
simultaneous, first-order differentialequations in terms of the statevariables; simultaneous differentialequationsstate equations
8/3/2019 Chapter 3 State Variables
10/55
Chapter 3: Modeling in the Time Domain10
State-space Representation
Solve the simultaneous equations withthe known initial conditions of all thestate variables at t
0
as well as thesystem input
Algebraically combine the statevariables with the systems input and
find all other system variablesoutputequations State equation +output equation
state space representation
8/3/2019 Chapter 3 State Variables
11/55
Chapter 3: Modeling in the Time Domain11
State-space representation
x=Ax+Bu
y=Cx+Du
x=state vector Y=output vectorx=time derivative of the state vector
u=input vector
A=system matrixB=input matrix
C=output matrix
D=feedforward matrix
8/3/2019 Chapter 3 State Variables
12/55
Chapter 3: Modeling in the Time Domain12
Example
fz
x
z
x
fxzfxxzx
xz
xz
fxxx
-
-
-
!
-
!!!
!
!
!
1
0
23
10
3232
32
8/3/2019 Chapter 3 State Variables
13/55
Chapter 3: Modeling in the Time Domain13
Example II
f
y
zx
y
zx
fxzy
fxxxxzyxzy
xz
fxxxx
-
-
-
!
-
!
!!!
!!
!
!
1
00
234
100010
432
432
432
8/3/2019 Chapter 3 State Variables
14/55
Chapter 3: Modeling in the Time Domain14
Next Move?
-
!
-
-
!
-
!!
!
!
!!
!
v
xy
v
x
v
x
xxxv
xv
Solution
xx
xxx
]01[
23
10
32
5at t
0)0(,1)0(
032
8/3/2019 Chapter 3 State Variables
15/55
Chapter 3: Modeling in the Time Domain15
-
!
-
-!
-
-
!
-
-
!
-
-
!
-
!(
((!(
3.011.0
30
01
)1.0()1.0(
3
0
0
1
23
10
)0(
)0(
23
10
)0(
)0(1.0
2
)()()()( 2
vx
v
x
v
xtLet
tty
ttytytty
8/3/2019 Chapter 3 State Variables
16/55
Chapter 3: Modeling in the Time Domain16
-
!
-
-
!
-
-
!
-
-
!
-
-
!
-
!
24.0
97.01.0
4.2
3.0
3.0
1
)2.0(
)2.0(
4.2
3.0
3.0
1
23
10
)1.0(
)1.0(
23
10
)1.0(
)1.0(
2.0
v
x
v
x
v
x
t
8/3/2019 Chapter 3 State Variables
17/55
Chapter 3: Modeling in the Time Domain17
iii
iii
iii
ii
vtvv
xtxx
vxv
vx
Scheme
*
*
23
1
1
(!
(!
!
!
Simple Euler Scheme
8/3/2019 Chapter 3 State Variables
18/55
Chapter 3: Modeling in the Time Domain18
Exact Solution of the Example
)2sin2
12(cos)(
2)1(
1)1()(
)()32(0)0(,1)0(
032
2
2
ttetx
s
ssX
ssXssxx
xxx
t !
!
!!!
!
8/3/2019 Chapter 3 State Variables
19/55
Chapter 3: Modeling in the Time Domain19
Simple Euler Scheme
Time x(I) v(I) x dot v dot x(I+1) v(I+1) Exact
0 1 0 0 -3 1 -0.03 1
0.01 1 -0.03 -0.03 -2.94 0.9997 -0.0594 0.999851
0.02 0.9997 -0.0594 -0.0594 -2.8803 0.999106 -0.0882 0.999408
0.03 0.999106 -0.0882 -0.0882 -2.82091 0.998224 -0.11641 0.998677
0.04 0.998224 -0.11641 -0.11641 -2.76185 0.99706 -0.14403 0.9976640.05 0.99706 -0.14403 -0.14403 -2.70312 0.99562 -0.17106 0.996374
0.06 0.99562 -0.17106 -0.17106 -2.64474 0.993909 -0.19751 0.994814
0.07 0.993909 -0.19751 -0.19751 -2.58671 0.991934 -0.22338 0.99299
0.08 0.991934 -0.22338 -0.22338 -2.52905 0.9897 -0.24867 0.990907
0.09 0.9897 -0.24867 -0.24867 -2.47177 0.987213 -0.27338 0.98857
0.1 0.987213 -0.27338 -0.27338 -2.41487 0.98448 -0.29753 0.985987
0.11 0.98448 -0.29753 -0.29753 -2.35837 0.981504 -0.32112 0.983161
0.12 0.981504 -0.32112 -0.32112 -2.30228 0.978293 -0.34414 0.98010.13 0.978293 -0.34414 -0.34414 -2.2466 0.974852 -0.36661 0.976808
0.14 0.974852 -0.36661 -0.36661 -2.19134 0.971186 -0.38852 0.973291
0.15 0.971186 -0.38852 -0.38852 -2.13652 0.9673 -0.40988 0.969555
0.16 0.9673 -0.40988 -0.40988 -2.08213 0.963202 -0.43071 0.965604
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
0 2 4 6
Euler Scheme
exact
8/3/2019 Chapter 3 State Variables
20/55
Chapter 3: Modeling in the Time Domain20
)22(6
1
),(*
)
2
,
2
(*
)2
,2
(*
),(*
),(
1
1
1
nnnnii
niin
n
iin
n
iin
iin
iiii
DCBAyy
CytfhD
By
htfhC
Ay
htfhB
ytfhA
ythfyy
!
!
!
!
!
!
Runge- Kutta Scheme; General
8/3/2019 Chapter 3 State Variables
21/55
Chapter 3: Modeling in the Time Domain21Figure 3.1RLnetwork
Initial condition i(0)
Ldi/dt+Ri=v(t) state equation
i(t) is state variable; but you
can pick up something else;e.g. vR
8/3/2019 Chapter 3 State Variables
22/55
Chapter 3: Modeling in the Time Domain22
RLnetwork
Laplace transform
L[sI(s)-i(o)]+RI(s)=V(s)
For unit step v(t)=1, V(s)=1/s I(s)=1/{s(Ls+R)}+ i(o)L/(Ls+R)
1/{s(Ls+R)}=(1/L)[A/s+B/(s+R/L)]
A=L/R, B=-L/R I(s)=(1/R)[1/s-1/(s+R/L)]+ i(o)/(s+R/L)
i(t)=(1/R)[1-e-(R/L)t]+ i(o) e-(R/L)t
8/3/2019 Chapter 3 State Variables
23/55
Chapter 3: Modeling in the Time Domain23
RLnetwork
i(t) state variable Ldi/dt+Ri=v(t) state equation If initial condition i(0), input v(t) are
known, we know i(t) Then we know other network variables;
output equations
VR(
t)=R
i(t
) VL(t)=V(t)-Ri(t) As VL(t)=Ldi/dt di/dt= VL(t)/L= [V(t)-Ri(t)]/L
8/3/2019 Chapter 3 State Variables
24/55
Chapter 3: Modeling in the Time Domain24
Figure 3.2RLC network
Second order system; twostate variables needed; e.g.i(t), q(t) charge on thecapacitor
8/3/2019 Chapter 3 State Variables
25/55
Chapter 3: Modeling in the Time Domain25
RLC network
Ldi/dt+Ri+(1/c)+idt=v(t) i(t)=dq/dt, i=q
Lq+Rq+(1/c)q=v(t) To make two first-order equations dq/dt=i
di/dt=-(1/LC)q-R
/Li+v(t)/L State equations If we know initial conditions, and
input v(t), we can solve the problem
8/3/2019 Chapter 3 State Variables
26/55
Chapter 3: Modeling in the Time Domain26
RLC network
Output equation
vL(t)=-(1/C)q(t)-Ri(t)+v(t) [note that
vL+vR+vC=v(t)] Both system equations and output
equationstate-space representation
You can pick up other state variables,e.g. vR, vC i(t) must be continuous, i=vR/R
8/3/2019 Chapter 3 State Variables
27/55
Chapter 3: Modeling in the Time Domain27
RLC network
vL=Ldi/dt=(L/R) dvR/dt
As vL+vR+vC=v(t)
(L/R) dvR/dt+vR+vC= v(t) dvR/dt=-(R/L) vR-(R/L) vC+(R/L)v(t)
vC=(1/c)(vR/R)dt
Differentiate dvC/dt=(1/RC)vR New state equations
8/3/2019 Chapter 3 State Variables
28/55
Chapter 3: Modeling in the Time Domain28
State-space representation
State variables are linearlyindependent; no state variable can be
written as a linear combination of theother state variables
Summary of the RLC state-spacerepresentation
8/3/2019 Chapter 3 State Variables
29/55
Chapter 3: Modeling in the Time Domain29
1D,R-C
1-C),(
v(t)u,10
B,
110
A,/
/
)(1LC
1
!
-
!!
!
!
-
!
-
!
-
!
-
!
!!
!
tvy
DuCxy
equationsoutput
Li
qx
L
R
LC
dtdi
dtdqx
tvL
iLRq
dtdii
dtdq
BuAxx
L
8/3/2019 Chapter 3 State Variables
30/55
Chapter 3: Modeling in the Time Domain30
Figure 3.3Graphicrepresentationof state space
and a statevector
For RLC network;
vR, vC wereselected as statevariables Function of time t
8/3/2019 Chapter 3 State Variables
31/55
Chapter 3: Modeling in the Time Domain31
State-space representation
x=Ax+Bu
y=Cx+Du
x=state vector Y=output vectorx=time derivative of the state vector
u=input vector
A=system matrix
B=input matrix
C=output matrix
D=feedforward matrix
8/3/2019 Chapter 3 State Variables
32/55
Chapter 3: Modeling in the Time Domain32
Applying the State-space representation
A minimum number of state variablesmust be selected as components ofthe state vector (sufficient todescribe completely the state of thesystem
State variables must be linearly
independent Usually number of energy-storageelements becomes number of statevariables
8/3/2019 Chapter 3 State Variables
33/55
Chapter 3: Modeling in the Time Domain33
Figure 3.4Block diagram of amass and damper
Mdv/dt+Dv=f(t);(Ms+D)V(s)=F(s)
One energy-storageelement (mass)
First order equation, so one state-variable may be enough; but massmust have relative position use two
state-variables, v(t), x(t)
8/3/2019 Chapter 3 State Variables
34/55
Chapter 3: Modeling in the Time Domain34
Example 3.1 Electrical network for representation in
state space
Output iR(t)
8/3/2019 Chapter 3 State Variables
35/55
Chapter 3: Modeling in the Time Domain35
Solution to the Example 3.1
Write equation for all energy-storageelements; inductor & capacitor
CdvC/dt=iC LdiL/dt=vL Select vC& iLas state variables
Next, change iC& vLin terms of statevariables and input v(t)
iC= iL- iR= iL- vC/R
vL= v(t)-vC
8/3/2019 Chapter 3 State Variables
36/55
Chapter 3: Modeling in the Time Domain36
-
-
!
-
-
-
!
-
!
!
!
!
!
L
C
L
C
L
C
C
CL
LCC
CL
LCC
i
v
R
tv
Li
v
L
CRCi
v
vR
output
tvLvLdt
di
iC
vRCdt
dv
tvvdtdiL
ivRdt
dvC
01
i
)(1
0
01
11
1i
)(11
11
)(
1
R
R
8/3/2019 Chapter 3 State Variables
37/55
Chapter 3: Modeling in the Time Domain37
Figure 3.6
Electrical network forExample 3.2
8/3/2019 Chapter 3 State Variables
38/55
Chapter 3: Modeling in the Time Domain38
Figure 3.7
Translationalmechanical system
8/3/2019 Chapter 3 State Variables
39/55
Chapter 3: Modeling in the Time Domain39
Figure 3.8
Electric circuitfor Skill-AssessmentExercise 3.1
8/3/2019 Chapter 3 State Variables
40/55
Chapter 3: Modeling in the Time Domain40
Figure 3.9Translationalmechanical systemfor Skill-AssessmentExercise 3.2
8/3/2019 Chapter 3 State Variables
41/55
Chapter 3: Modeling in the Time Domain41
Figure 3.10a. Transfer function; b. equivalent block diagramshowing phase-variables. Note: y(t) = c(t)
8/3/2019 Chapter 3 State Variables
42/55
Chapter 3: Modeling in the Time Domain42
24926-24-
2424269
)(24)(24269
24269
24
)(
)(
1
3213
32
21
3
2
1
23
23
xcy
rxxxx
xx
xx
cx
cxcx
rcccc
sRsCsss
ssssR
sC
!!
!
!
!
!
!
!
!
!
!
State variables
Output equation
System
equations
8/3/2019 Chapter 3 State Variables
43/55
Chapter 3: Modeling in the Time Domain43
? A
001
1
0
0
92624
100
010
24926-24-
3
2
1
3
2
1
2
2
1
1
3212
32
21
-
!
-
-
-
!
-
!!
!
!
!
x
xx
y
r
x
x
x
x
x
x
xcy
rxxxx
xx
xx
8/3/2019 Chapter 3 State Variables
44/55
Chapter 3: Modeling in the Time Domain44
Can you explain?
8/3/2019 Chapter 3 State Variables
45/55
Chapter 3: Modeling in the Time Domain45
Figure 3.11
Decomposing atransfer function
Output equation
y(t)=b0x1+b1x2+b2x3
8/3/2019 Chapter 3 State Variables
46/55
Chapter 3: Modeling in the Time Domain46
Figure 3.12a. Transfer function;b. decomposedtransfer function;c. equivalent block
diagram. Note:y(t) = c(t)
8/3/2019 Chapter 3 State Variables
47/55
Chapter 3: Modeling in the Time Domain47
? A
172
27
)()27()(
1
00
92624
100010
3
2
1
123
12
3
2
1
2
2
1
-
!
!!
-
-
-
!
-
x
x
x
y
xxxy
sXsssC
r
x
xx
x
xx
8/3/2019 Chapter 3 State Variables
48/55
Chapter 3: Modeling in the Time Domain48
Figure 3.13Walking robots,such as Hannibalshown here, canbe used to explore
hostileenvironments andrough terrain,such as that foundon other planetsor inside
volcanoes.
Bruce Frisch/S.S./Photo Researchers
8/3/2019 Chapter 3 State Variables
49/55
Chapter 3: Modeling in the Time Domain49
Converting to a Transfer Function
)()(
)()(
)(])([
)()()()(
)()()(
)()()()()()(
)()()(
1
1
1
1
DBAsICsU
sYsT
sUDBAsIC
sDUsBUAsICsY
sBUAsIsX
sBUsXAsIsDUsCXsY
sBUsAXssX
DuCxy
BuAxx
!!
!
!
!
!!
!
!!
8/3/2019 Chapter 3 State Variables
50/55
Chapter 3: Modeling in the Time Domain50
Example 3.6
? A
12s3ss
)1(2
)3(1
1323
)(
321
10
01
321
100
010
00
00
00
)(
001
0
0
10
321
100
010
23
2
2
1
3
2
1
3
2
1
2
2
1
-
!
-
!
-
-
!
-
!
-
-
-
!
-
sss
sss
sss
AsI
s
s
s
s
s
s
AsI
x
x
x
y
u
x
x
x
x
x
x
8/3/2019 Chapter 3 State Variables
51/55
Chapter 3: Modeling in the Time Domain51
? A
? A
? A
12s3ss
)23(10
10
10
)23(10
00112s3ss
1
0
0
10
12s3ss
)1(2
)3(1
1323
001
)()(
0
001
0
0
10
23
2
2
23
23
2
2
1
!
-
!
-
-
!
!
!
!
-
!
ss
s
ss
sss
sss
sssDBAsICsT
D
C
B
Example 3.6
8/3/2019 Chapter 3 State Variables
52/55
Chapter 3: Modeling in the Time Domain52
Figure 3.14
a.Simple pendulum;b. force components
of Mg;c. free-body diagram
8/3/2019 Chapter 3 State Variables
53/55
Chapter 3: Modeling in the Time Domain53
Figure 3.15
Nonlinear translationalmechanical systemfor Skill-AssessmentExercise 3.5
8/3/2019 Chapter 3 State Variables
54/55
Chapter 3: Modeling in the Time Domain54
Figure 3.16
Pharmaceutical drug-levelconcentrations in a human
8/3/2019 Chapter 3 State Variables
55/55
Chapter 3: Modeling in the Time Domain55
Figure 3.17
Aquifer systemmodel