71HW3
71HW3
Homework - 3
Fall 2021
1. (Nutrient) First please read Section 4.6 (Drug Administration) in the textbook of
Feedback Systems: An Introduction for Scientists and Engineers by Karl J. Astrom
and Richard M. Murray, 2nd edition for a general background of compartment mod-
els.
Now we will use it to model the nutrients such as vitamins and minerals in our
body. We consider a simplified two-compartment model, e.g., the gastrointestinal
(digestive) system and the blood circulatory system. We consider that a nutrient
with concentration c0 is injected in the digestive system at a volume flow rate of u
and that the concentration in the blood circulatory system is the output. Let cg and
cb be the concentrations of the nutrient in the two compartments and let V1 and V2
be the volumes of the compartments. The dynamical model for mass balances for
the compartments are
dcg
V1 = q(cb cg ) q0 cg + c0 u
dt
dcb
V2 = q(cg cb )
dt
y = cb
where q represents flow rate between the compartments and q0 represents the flow
rate out of the digestive system that is not going to the blood circulation system.
Introducing the variables
a0 = q0 /V1 , a1 = q/V1 , a2 = q/V2 , and b0 = c0 /V1 and let
c
state variable x = g . The model can be written as,
cb
a0 a1 a1 b ⇥ ⇤
ẋ = Ax + Bu = x + 0 u, y = Cx = 0 1 x
a2 a2 0
也 3 0⼼印⼊ 1 45后 2
N 14015K
叺 40.5Kit0.5K2
N z90W⼊ twi
410.5ki 4S.no 8
zsowzcwiyyfkl
kltkz Kizwò 4GW 6
and from the closeloopfunction
CESI AtBkTI Bku
⼆
蕊 恐恐 ⼼ 阰 a
如
C WEI
k scigervalue m.zi
zsowoo_E
Sio.li N
签恐 ⼊
o.ltz.
⼼
o 4
i o 4
hit4 ⼋ 014 1.8j 017
个
K2 6.4 N o 4 i 8j
个 0.7 ⼋ 0.7 1.4i
总筘 N 0.7 1.45
0.9
9点三毖 9to.
⼊
n
0.9 a9j
z o9
Where p is the position of the scooter; ✓ is the angle of the rider (with upright being
✓ = 0); M is the mass of the scooter; m , J , and ` the rider’s mass, moment-of-
inertia, and leg length ( half of rider height); c and are coefficients of friction, R is
the radius of the wheels, and g is the acceleration due to gravity.
The System has the following parameters:
Page 2
as nmjp_mlas ⼼ Ü tcptMISMGETRa
⼆0 1b
mlcoslaitgtmiitrio
1019
mgcs.ru
o 25 1 5 9.81 C 011 to.ol Ju 0
N m 30kg R
40i 30as ⼼Ò to 中430⽖⼼Òzazrc
30050 i 130ò too ⼼ 294.3she 0
㓹䨊 燚4
⻔ ⼆⼥
utca ME x Jt lb Ymcas叮
⻄ twnjtmD WFoigitljtmhciptmlos0 ro
tmlCJtmhSMQG mzgps.no as0
tRCJtml i.i
ERCJtmhtmyvsmo.ws0 lJtmlik
mlcosoro ml.at mV Sho 07
Mtm Gtmlyyi Us20
let l la XML SO tlb X Mtm
Mtm rE LMtmj.mglsnytcmlcosoptnhoso.no i
Mtm JtmlD
mtiosthizmlosoz. U
mlosOTRMMtwDmglsno LMtmmi
CMLcodap widcoscas.ru ǗJ
Mtm m v j my cos20
义以 3
义⼯以
4
义3 uRCJtmHtmyismxzcosxz Dtmycx
mlosxz.ir X4
mltgtmEJSMIXDX LMtmigtmlij
mvoix X4
Enlcosxz.HR tlMtmmghhxz mtmrx
cmkoslxzsx3 mz.ws sin x 奵
Mtm Jtmly
m2ltcosxz ly
1100 X
b TH 红0
加⼆ 0 X4 0
⼽ 0
mzgESMXzos cmtNDmglsmx
DX KNLK o.tl
weget too
蕊
为 my Ex 1 mlYCX3 mlrx.lt Rotmlyu
义4 必 以 mglxz EMtmytmlgx stml.RU
义⼆
AxtB A
qiin hutmmgv.mil 咒蠡吵了
have specified
from b we
purawetevdusi AE sequilibumpo.hn
䛗熊 i ⻔ 内 is unstable
B超
㤍
reachability Matrix
2A 13 BAB PB A313
麣 灜 吐 的B
89700
19356
ran
4s the system isreachable
e we know
131 8 8 8
1989 讪900 650057590
45951900 150013290
A
澏䲜灜 愈㖌
IN At BK ⼋⼗6802 nu to 3M to 3 96.3⻔
⼋⼗ 3 96.3D
i the system is stable the eigenvalue are all less than
zero
f
The scooter has the following features:
- It is controlled by a lever control that reports the desired velocity in m/s
- It is fitted with a speedometer that reports in m/s
- O↵-the-shelf motor controller that controls the motor torque (⌧ ) in newton meters.
(a) Using the above equations to derive the state-space model of the system in
terms of ẋ = f2(x, 3 u), y = h(x, u) where the control input u = ⌧ , output y =
p
p 6✓ 7
and c = 6 7
4ṗ5Please write down the system model using the parameters
✓
✓˙
(`, M, m, J, , g, c) rather than using the specified parameter values.
(b) Assume that the motor torque is zero, i.e. ⌧ (t) = 0. Calculate the equilibrium
points and linearize the system around the equilibrium point(s). [Note: Please
write down your results using the parameters (`, M, m, J, , g, c) rather than
using the specified parameter values. And please write down certain details
about how you derive the results rather than merely providing the final results.]
(c) Study the stability of the equilibrium points calculated in (b) using the linearized
state-space models obtained in (b). [Note: In this question, you can use the
specified parameter values.]
(d) For the equilibrium point with ✓ = 0, compute the reachability matrix for the
system and show that the system is reachable (Note: Please use the specified
parameter values. You can use Python control package and command W =
control.ctrb(A,B) and det(W).)
(e) Now let us only focus on the equilibrium point with ✓ = 0. A state feed-
back is defined as ⌧ = Kx, i.e., the input torque varies with the state of the
˙ Show that the fol-
system. Here the state of the system is x = (p, ✓, ṗ, ✓).
lowing state feedback stabilizes the linearization of the self-balancing scooter:
K = [ 61.2, 6920, 200, 1772]. [Note: Please use the specified parameter val-
ues.]
(f) Now, simulate the non-linear system with the same state feedback as in part
(e) (You can use ODE function in Python to simulate). Try di↵erent initial
conditions and show that the controller asymptotically stablizes the system for
some initial conditions while it fails to do so for some others. That is, for the non-
linear system, the state feedback controller locally stabilizes the system. Here
locally means that the controller stabilizes the system if the initial condition is
not very far away from the equilibrium point, but fails to stabilize the system
if the initial condition is far away from the equilibrium point. Provide plots of
✓(t) for both types of initial conditions.
Page 3