Class 4a - Systems and Solutions

advertisement
Systems and Solutions
Class 4
1st Order Systems
1st Order Systems
dx

 x  f t 
dt
x 0  xo
  time constant (s)
x  Instrument response (output)
f t   Quantity to be measured (input)
1st Order Systems
dx

 x  f t 
dt
x 0  xo
Step Input
Ramp Input
Harmonic Input
f (t )  K s us t 
f (t )  K r tus t 
f (t )  K h cost 
1st Order Systems with Step Input
dx
  x  K sut 
dt
x 0  xo
0, t  0
u t   

1, t  0 
2
u(t)
1
0
-1
0
Time, t
1
2
1st Order Systems with Step Input
Solution by Integration
dx
  x  Ks
dt
x 0  xo
x
dx
K
xo
s
x
dx
K
xo
s
x
t
  dt
0
  dt
0
u  K s  x, du   dx
u
dx

 Ks  x
dt
dx
 dt
Ks  x
x
t
t
du
 
  dt ,
u 0
uo
u
u
  ln    t , ln     t 
 uo 
 uo 
Ks  x
x  Ks

 e t 
K s  xo xo  K s
x t   K s   xo  K s e t 
Error Ratio
1st Order Systems with Step Input
Error Ratio and Excitation Ratio
1
Error:
Output deviation from input
0.8
Excitation:
Output deviation from its initial value
0.4
Excitation Ratio
0.6
Error Ratio
0.2
time, t
0
Current Error
StartingError
Current deviation from input value

Starting deviation from input value
K x
x  Ks
 s

 e t 
K s  xo xo  K s
Error Ratio  rerr 
rerr
rerr
0
1
2
3
4
5
Current Excitation
Desired Excitation
Output deviation from its initial value
rex 
Input deviation from initial output
x  xo
K  xo
x  xo
rex 
 1 s

K s  xo
K s  xo K s  xo
ExcitationRatio  rex 
 K  xo
x  xo 

rex  1   s

K

x
K

x
o
s
o 
 s
 K x 
  1  rerr  1  e t 
rex  1   s
 K s  xo 
1st Order Systems with Step Input
Solution by Superposition
Assume a solution of the form
x t   xh t   x p t 
dx
 x  Ks
dt
x 0  xo

where
xh  xh  0
and
x p  x p  K s
Solutionof the particular equation
x p  x p  K s
For the homogenoeus ODE
xh  xh  0
is foundby observation
x p t   K s
Assume
The complete solution is thereofore
xh t   Cert  xh t   rCert
x t   x p t   xh t   K s  Cet 
Substituting into homogeneous ODE
xh  xh  0,rCe  Ce  0, r  1Ce  0
rt
rt
r  1, r   1   xh t   Cet 
rt
To satisfy the initial condition,
x 0  K s  C  xo , C  xo  K s
x t   K s   xo  K s e t 
1st Order Systems with Step Input
Solution by Laplace Transform
X ( s )  xo
dx
 x  Ks
dt
x 0  xo

 sX ( s )  xo   X ( s ) 
A
B 

X ( s )  xo  


s
s

1



Ks
s
Ks
 xo
s
K  sxo
X ( s )s  1  s
s
K  sxo
X ( s)  s
s s  1
x s  K s xo 
X ( s)  o
s s  1  
sX ( s )  X ( s ) 
s  K s xo
s s  1  
 s  K s xo 
  K s xo
A  s  0


 s s  1   s 0
 s  K s xo 

B  s  1  


s
s

1


 s1 
B
 1   K s xo
 1  K s xo
1 
 K x 1  K s xo 

X ( s )  xo  s o 
s  1   
 s
K
x  Ks
X ( s)  s  o
s s  1  
x t   K s   xo  K s e t 
1st Order Systems with Unit Step Input and Unit Time Constant
MATLAB Simulation by Transfer Function
>> num=1;
>> den=[1 1];
>> sys = tf(num,den);
>> step(sys)
>> grid
dx
 x  f t 
dt
x 0   0

sX ( s )  X ( s )  F s 
X ( s )s  1  F s 
0.9
0.8
0.7
Transfer
Function
0.6
Amplitude
X ( s)
1

F s  s  1
Step Response
1
0.5
0.4
0.3
0.2
0.1
0
0
1
2
3
Time (sec)
4
5
6
1st Order Systems with Unit Step Input and Unit Time Constant
MATLAB Simulation by Simulink
dx
 x  u t 
dt
dx 1
 u t   x 
dt 

1st Order Systems with Ramp Input
dx
  x  xo  K r tut 
dt
x 0  xo
0, t  0
u t   

1, t  0 
tut 
1st Order Systems with Ramp Input
Solution by Superposition
Assume a solution of the form
dx

 x  xo  Krt
dt
x 0  x o
x t   xh t   x p t 
Solutionof the particular equation
x p  x p  xo  K r t
Assume a solution of the form
x p t   At  B, x p t   A
where
xh  xh  0
Substituteinto the ODE
A  At  B  xo  K r t
and
x p  x p  xo  K r t
A  Kr
For the homogenoeus ODE
xh  xh  0
A  B  xo ,
B  xo  A  xo  K r
x p t   K r t     xo
Assume
The complete solution is thereofore
xh t   Cert  xh t   rCert
x t   x p t   xh t   xo  K r t     Cet 
Substituting into homogeneous ODE
xh  xh  0,rCe  Ce  0, r  1Ce  0
rt
rt
r  1, r   1   xh t   Cet 
rt
To satisfy the initial condition,
x 0   xo  K r  C  xo , C  K r
x t   xo  K r t     K r e t 
x t   xo  K r t  K r 1  e t  
1st Order Systems with Ramp Input
Steady State Error and Relative Error
dx
 x  xo  K r tut 
dt
x 0  xo

error  Input - Output
error   xo  K r t   x t 
error  K r 1  e
t 

Steady state error
ess  lim error 
t 
ess  lim K r 1  e t  
t 
ess  K r
Error
Relative error 
Steady State Error
K r 1  e t  
Errr 
 1  e t 
K r
x t   xo  K r t  K r 1  e t  
1
0.9
Errr
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
t
0
0.5
1
1.5
2
2.5
3
3.5
4
1st Order Systems with Ramp Input
Relative Input and Relative Excitation
dx
 x  xo  K r tut 
dt
x 0  xo

x t   xo  K r t  K r 1  e
t 

4
3.5
3
Relative Input
2.5
1
2
Input - Initial Value
S.S.E
Kt
Relative Input  r  t 
K r
Relative Input 
Current Excitation
Relative Excitation  exr 
Steady State Error
K r t  K r 1  e t  
exr 
 t   1  e t  
K r
1.5
Relative Excitation
1
0.5
0
t
0
0.5
1
1.5
2
2.5
3
3.5
4
1st Order Systems with Ramp Input
Solution by Laplace Transform
dx
 x  xo  K r t , x 0   xo
dt
x
K
 sX ( s )  xo   X ( s )  o  2r
s
s
x
K
sX ( s )  X ( s )  o  2r  xo
s
s
xo s 2  xo s  K r
X ( s )s  1 
s2
xo s 2  xo s  K r
X ( s) 
s 2 s  1
1
K
s2  s  r

xo
X ( s )  xo
s 2 s  1  

 A B

C

X ( s )  xo  2  
s s  1   
s
K
 2 1
s  s r

xo
A  s2  2
 s s  1  




  K x
r
o


 s 0
K
  2 1
 s  s r
d

xo
B   s2  2
ds   s s  1  
 
 


   xo  K r

xo

  s 0
K 
 2 1
s  s r 

xo 
C  s  1   2
 K r xo
 s s  1   



 s1 
X ( s) 
K r xo  K r
K r


2
s  1  
s
s
x t   K r t  xo  K r  K re t 
x t   xo  K r t  K r 1  e t  
1st Order Systems with Unit Ramp Input and Unit Time Constant
MATLAB Simulation by Transfer Function
dx
 x  f t 
dt
x 0   0
sX ( s )  X ( s )  F s 
X ( s )s  1  F s 
X ( s)
1
G( s) 

F s  s  1
G( s)
1
1
H ( s) 

 2
s
s(s  1) s  s

 MATLAB does not have a ‘ramp’
command to plot the ramp response
of the system. However, note that
the response, Rst(s) of a system with
transfer function G(s) to unit step
input is Rst(s) = G(s)/s, and its
response to a unit ramp input is
Rrmp(s) = G(s)/s2 = (G(s)/s)/s . Thus,
the response of G(s) to unit ramp is
equal to the response of H(s) =
G(s)/s to unit step.
 We may use MATLAB’s ‘step’
command to obtain the ramp
response of a system G(s) simply by
obtaining the step response of H(s) =
G(s)/s to unit step.
>> num = [0 0 1];
>> den = [1 1 0];
>> t=0:0.1:5;
>> sys = step(num,den,t);
>> plot(t,sys,'o',t,t,'-')
>> grid
5
4.5
4
3.5
3
2.5
2
1.5
1
0.5
0
0
1
2
3
4
5
1st Order Systems with Unit Step Input and Unit Time Constant
MATLAB Simulation by Simulink
dx
 x  tut 
dt
dx 1
 tut   x 
dt 

1st Order Systems with Harmonic Input
1
dx

 x  K h cost 
dt
x 0  0
0
-1
0
2
4
6
8
10
12
1st Order Systems with Harmonic Input
Solution by Superposition
sin    2   sin  cos 2   cos  sin  2   cos 
cos   2   cos  cos 2   sin  sin  2   sin  
Solutionof the particular equation
x p  x p  K h cos(t )
dx
 x  K h cost 
dt
x 0   0

Assume a solution of the form
x p t   A cos(t   )
Assume a solution of the form
x t   xh t   x p t 
x p t    A sin( t   )
wherexh  xh  0 andx p  x p  xo  K r t
Substituteinto the ODE
For the homogenoeus ODE
xh  xh  0
A cos(t     2)  A cos(t   )  K h cos(t )
x p t    A cos(t     2)
From the vector plot
Assume
A2  A   K h
xh t   Cert  xh t   rCert
A  Kh
Substituting into homogeneous ODE
xh  xh  0,rCe rt  Cert  0, r  1Cert  0
r  1, r   1   xh t   Cet 
2
2
1   
  tan 1  
τAω
2
A
ϕ
Kh
ωt
1st Order Systems with Harmonic Input
Amplitude Ratio and Phase
f(t)
1
dx
 x  K h cost 
dt
x 0  0

x(t)
ra
0
ϕ
x t   A cos(t   )
A  Kh
1   
2
  tan 1  
-1
0
2
4
6
8
10
1.5
Output Amplitude
AmplitudeRatio  ra 
Input Amplitude
ra  A K h 1
1
ϕ (τω)
ra (τω)
1   
Phase    tan 1  
2
0.5
0
-2
10
10
-1
10
0
τω
10
1
10
2
12
1st Order Systems with Harmonic Input
Solution by Complex Exponential
Euler’s Identity
Multiplication &
Division Rules
y
i
e  cos   i sin 
z = Aeiωt
z1  A1ei1
z  Aeit
z  A cos t  iA sin t
z  x  iy
A
z2  A2 ei2
ωt
z1 z2  A1ei1 A2 ei2  A1 A2 ei 1 2 
x
z1 A1ei1
A

 1 ei 1 2 
i 2
z2 A2e
A2
Complex Conjugate
y
z = Aeiωt
z  Aeit
x  Re z   A cos t 
Power Rules
A
z*  Aeit
ωt
1
z  z *
2
-ωt
x
z  Aei
z n  Aei   An ein
n
z1 n  Aei   A ei n
1n
z* = Ae-iωt
1n
Second Order Systems
 In the system shown, the input
displacement, xi, will cause a
deflection in the spring, and
some time will be needed for
the output displacement xo to
reach the input displacement.
xo
xi
c
m
k
Second Order Systems
 F  mx
o
k  xi  xo   c  xi  xo   mxo
mxo  cxo  kxo  cxi  kxi
m
c
xo  xo  xo  cxi  kxi
k
k
xi
xo
c
m
k
 If m/k << 1 s2 and c/k << 1 s, the system may be approximated as a zero
order system with unity gain.
 If, on the other hand, m/k << 1 s2 , but c/k is not, the system may be
approximated by a first order system. Systems with a storage and
dissipative capability but negligible inertial may be modeled using a
first-order differential equation.
Example – Automobile Accelerometer
 Consider the accelerometer used in
seismic and vibration engineering to
determine the motion of large bodies to
which the accelerometer is attached.
 The acceleration of the large body places
the piezoelectric crystal into compression
or tension, causing a surface charge to
develop on the crystal. The charge is
proportional to the motion. As the large
body moves, the mass of the
accelerometer will move with an inertial
response. The stiffness of the spring, k,
provides a restoring force to move the
accelerometer mass back to equilibrium
while internal frictional damping, c,
opposes any displacement away from
equilibrium.
Piezoelectric
crystal
xi
xo
c
m
k
Zero-Order systems
 Can we model the system below as a zero-order system? If the mass,
stiffness, and damping coefficient satisfy certain conditions, we may.
xo
xi
c
m
k
 F  mx
o
k  xi  xo   c  xi  xo   mxo
k  xi  xo   c  xi  xo   m xi  xo   mxi
k  c  m  mx
i
First Order Systems
 Measurement systems that contain
storage elements do not respond
instantaneously to changes in input. The
bulb thermometer is a good example.
When the ambient temperature changes,
the liquid inside the bulb will need to
store a certain amount of energy in order
for it to reach the temperature of the
environment. The temperature of the
bulb sensor changes with time until this
equilibrium is reached, which accounts
physically for its lag in response.
 In general, systems with a storage or
dissipative capability but negligible inertial
forces may be modeled using a first-order
differential equation.
1st Order Systems with Step Input
error ratio =
excitation ratio =
current error current deviation from final value
=
starting error starting deviation from final value
current excitation
current deviation from initial value
=
desired (input) excitation
input deviation from initial value
𝜏
𝑑𝑥
+ 𝑥 = 𝐾𝑢(𝑡)
𝑑𝑡
𝑥 0 = 𝑥0
Excitation ratio may also be called response ratio
= current response / desired response
𝑥 𝑡 = 𝐾 + 𝑥0 − 𝐾 𝑒 −𝑡/𝜏
Error Ratio
𝑥 𝑡 −𝐾
= 𝑒 −𝑡/𝜏
𝑥0 − 𝐾
Excitation
Ratio
𝑥 𝑡 − 𝑥0
= 1 − 𝑒 −𝑡/𝜏
𝐾 − 𝑥0
 Note that the excitation ratio also represents
the system response in case of x0=0 and K=1
Example 1
 A bulb thermometer with a time constant τ
=100 s. is subjected to a step change in the
input temperature. Find the time needed
for the response ratio to reach 90%
Example 1 Solution
 A bulb thermometer with a time constant τ =100 s. is subjected to a
step change in the input temperature. Find the time needed for the
response ratio to reach 90%
𝑥 𝑡 − 𝑥0
= 1 − 𝑒 −𝑡/𝜏 = 0.9
𝐾 − 𝑥0
𝑥 𝑡 −𝐾
= 𝑒 −𝑡/𝜏 = 0.1
𝑥0 − 𝐾
𝑡 𝜏 = ln 10 = 2.3
𝑡 = 2.3 × 𝜏 = 230 𝑠.
≈ 4 minutes
1st Order Systems with Ramp Input
𝜏
𝑑𝑥
+ 𝑥 = 𝑥0 + 𝐾𝑟 𝑡𝑢(𝑡)
𝑑𝑡
𝑥 0 = 𝑥0
excitation ratio =
𝑥 𝑡 = 𝑥0 + 𝐾𝑟 𝑡 − 𝐾𝑟 𝜏(1 − 𝑒 −𝑡/𝜏 )
Error = 𝑥 𝑡 − 𝑓 𝑡 = −𝐾𝑟 𝜏(1 − 𝑒 −𝑡/𝜏 )
Steady State Error
𝑆. 𝑆. 𝐸 = lim 𝑥(𝑡) − 𝑓(𝑡)
𝑡→∞
𝑆. 𝑆. 𝐸 = 𝐾𝑟 𝜏
𝐸𝑥𝑐𝑖𝑡𝑎𝑡𝑖𝑜𝑛 𝑅𝑎𝑡𝑖𝑜 =
𝑥 𝑡 − 𝑥0
𝐾𝑟 𝑡
(1 − 𝑒 −𝑡/𝜏 )
𝐸𝑥𝑐𝑖𝑡𝑎𝑡𝑖𝑜𝑛 𝑅𝑎𝑡𝑖𝑜 = 1 −
𝑡 𝜏
Note that using L’Hospital rule
lim
𝑡 𝜏 →0
= lim
𝑡 𝜏 →0
1−
(1 − 𝑒 −𝑡/𝜏 )
𝑡 𝜏
1 − lim
𝑡 𝜏 →0
1 − 𝑒 −𝑡/𝜏
𝑡 𝜏
𝑒 −𝑡/𝜏
= 1 − lim
= 1−1= 0
𝑡 𝜏 →0 1
excitation ratio =
current excitation
desired (input) excitation
current deviation from initial value
input deviation from initial value
1st Order Systems with Harmonic Input
𝜏
𝑑𝑥
+ 𝑥 = 𝐹 cos⁡
(ωt)
𝑑𝑡
𝑥 𝑡 = 𝐶𝑒 −𝑡/𝜏 + 𝑋cos⁡
(ωt − φ)
C depends on the initial conditions and the
exponential term will vanish with time. We
are interested in the particular steady
solution 𝑋cos⁡
(ωt − φ). Solving for 𝑋 and φ,
we find
𝑋=
𝐹
1 + 𝜏𝜔
φ = tan−1 𝜏𝜔
2
1st Order Systems with Harmonic Input
Define the amplitude ratio 𝐴𝑟 = 𝑋 𝐹 and
the time ratio 𝑇𝑟 = 𝜏 𝑇 where 𝑇 = 2𝜋 𝜔 is
the period of the excitation function,
𝐴𝑟 =
𝑋
=
𝐹
1
1 + 𝜏𝜔
2
=
1
1 + 4𝜋 2 𝑇𝑟 2
φ = tan−1 𝜏𝜔 = tan−1 2𝜋𝑇𝑟
1st Order Systems with Harmonic Input
 The amplitude ratio, Ar(ω), and the
corresponding phase shift, ϕ, are
plotted vs. ωτ. The effects of τ and
ω on frequency response are
shown.
 For those values of ωτ for which the
system responds with Ar near unity,
the measurement system transfers
all or nearly all of the input signal
amplitude to the output and with
very little time delay; that is, X will
be nearly equal to F in magnitude
and ϕ will be near zero degrees.
1st Order Systems with Harmonic Input
 At large values of ωτ the measurement system filters out any frequency
information of the input signal by responding with very small amplitudes,
which is seen by the small Ar(ω) , and by large time delays, as evidenced by
increasingly nonzero ϕ.
1st Order Systems with Harmonic Input
 Any equal product of ω
and τ produces the
same results. If we
wanted to measure
signals with highfrequency content, then
we would need a system
having a small τ.
 On the other hand,
systems of large τ may
be adequate to measure
signals of low-frequency
content. Often the
trade-offs compete
available technology
against cost.
dB = 20 log Ar(ω)
1st Order Systems with Harmonic Input
 The dynamic error,δ(ω), of a system is defined as
δ(ω) = (X(ω) – F)/F
δ(ω) = Ar(ω) –1
It is a measure of the inability of a system to adequately reconstruct the
amplitude of the input signal for a particular input frequency. We normally
want measurement systems to have an amplitude ratio at or near unity over
the anticipated frequency band of the input signal to minimize δ(ω) .
 As perfect reproduction of the input signal is not possible, some dynamic error
is inevitable. We need some way to quantify this. For a first-order system, we
define a frequency bandwidth as the frequency band over which Ar(ω) >
0.707; in terms of the decibel defined as
dB = 20 log Ar(ω)
This is the band of frequencies within which Ar(ω) remains above 3 dB
Example 2
A temperature sensor is to be selected to measure temperature within a
reaction vessel. It is suspected that the temperature will behave as a simple
periodic waveform with a frequency somewhere between 1 and 5 Hz. Sensors
of several sizes are available, each with a known time constant. Based on time
constant, select a suitable sensor, assuming that a dynamic error of 2% is
acceptable.
Example 2. Solution
 A temperature sensor is to be
selected to measure temperature
within a reaction vessel. It is
suspected that the temperature will
behave as a simple periodic
waveform with a frequency
somewhere between 1 and 5 Hz.
Sensors of several sizes are
available, each with a known time
constant. Based on time constant,
select a suitable sensor, assuming
that an absolute value for the
dynamic error of 2% is acceptable.
 Accordingly, a sensor having a time
constant of 6.4 ms or less will work.
𝛿 ω
≤ 0.02
−0.02 ≤ 𝛿 ω ≤ 0.02
−0.02 ≤ 𝐴𝑟 − 1 ≤ 0.02
0.98 ≤ 𝐴𝑟 ≤ 1.02
0.98 ≤
1
1 + 𝜏𝜔
2
≤ 1.0
0 ≤ 𝜏𝜔 ≤ 0.2
The smallest value of 𝐴𝑟 will occur at
the largest frequency
𝜔 = 2𝜋𝑓 = 2𝜋(5)
0 ≤ 2𝜏𝜋(5) ≤ 0.2
𝜏 ≤ 6.4 × 10−3 s.
Example 2. Solution
 A temperature sensor is to be
selected to measure temperature
within a reaction vessel. It is
suspected that the temperature will
behave as a simple periodic
waveform with a frequency
somewhere between 1 and 5 Hz.
Sensors of several sizes are
available, each with a known time
constant. Based on time constant,
select a suitable sensor, assuming
that an absolute value for the
dynamic error of 2% is acceptable.
 Accordingly, a sensor having a time
constant of 6.4 ms or less will work.
𝛿 ω
≤ 0.02
−0.02 ≤ 𝛿 ω ≤ 0.02
−0.02 ≤ 𝐴𝑟 − 1 ≤ 0.02
0.98 ≤ 𝐴𝑟 ≤ 1.02
0.98 ≤
1
1 + 𝜏𝜔
2
≤ 1.0
0 ≤ 𝜏𝜔 ≤ 0.2
The smallest value of 𝐴𝑟 will occur at
the largest frequency
𝜔 = 2𝜋𝑓 = 2𝜋(5)
0 ≤ 2𝜏𝜋(5) ≤ 0.2
𝜏 ≤ 6.4 × 10−3 s.
2nd Order Systems
 Example:
 Spring – mass damper
 RLC Circuits
 Accelerometers
 Mathematical Model:
𝑑2 𝑥
𝑑𝑥
+
2𝜁𝜔
+ 𝜔𝑛 2 𝑥 = 𝑓 𝑡
𝑛
2
𝑑𝑡
𝑑𝑡
𝜁
Damping ratio (dimensionless)
𝜔𝑛
Natural frequency (1/s)
𝑓 𝑡 : Input (quantity to be measured)
𝑥:
Output (instrument response)
2nd Order Systems with step input
𝑓 𝑡 = 𝐾𝑢(𝑡)
𝑢 𝑡 =
0 𝑡<0
1 𝑡≥0
ds
𝑑2 𝑥
𝑑𝑥
2
+
2𝜁𝜔
+
𝜔
𝑥 = 𝐴𝑓 𝑡
𝑛
𝑛
𝑑𝑡 2
𝑑𝑡
𝜁
Damping ratio (dimensionless)
𝜔𝑛
Natural frequency (1/s)
𝑓 𝑡 : Input (quantity to be measured)
𝑥:
Output (instrument response)
𝐴:
Arbitrary constant
2nd Order Systems with step input
2nd Order Systems with step input
2nd Order Systems with periodic input
2nd Order Systems with step input
Download