Chapter 4 : Dynamic Characteristics of Instruments and Measurement systems

Example 4.1 Page No : 137

In [1]:
import math 
# calculating the temperature after 1.5 s

# Variables
th0 = 100.;
t = 1.5;
tc = 3.5;

# Calculations
th = th0*(1-math.exp(-t/tc));

# Results
print "temperature after 1.5 s (degree C)", th
temperature after 1.5 s (degree C) 34.8560942469

Example 4.2 Page No : 139

In [2]:
import math 
# calculate time to read half of the temperature difference
# Variables
tc = 10./5;
th = 1.;
th0 = 2.;

# Calculations
t = -tc*math.log(1-(th/th0));

# Results
print "Time to read half of the temperature difference (s)", t
Time to read half of the temperature difference (s) 1.38629436112

Example 4.4 Page No : 141

In [3]:
import math 
# Calculate the temperature after 10s

# Variables
th0 = 25;
thi = 150;
t = 10.;
tc = 6;

# Calculations
th = th0+(thi-th0)*(math.exp(-t/tc));

# Results
print "the temperature after 10s (degree C)", th
the temperature after 10s (degree C) 48.6094503547

Example 4.5 Page No : 143

In [4]:
import math 
# Calculate the value of resistance after 15s

# Variables
R0 = 29.44;
Rs = 100.;
t = 15.;
tc = 5.5;

# Calculations
R_15 = Rs+R0*(1-math.exp(-t/tc));

# Results
print "value of resistance after 15s(ohm)", R_15
value of resistance after 15s(ohm) 127.514700449

Example 4.6 Page No : 145

In [5]:
import math 
# Calculate the depth after one hour

# Variables
Qm = 0.16*10**-3;
Hin = 1.2;
K1 = Qm/(Hin)**0.5;
Qo = 0.2*10**-3;
Ho = (Qo/K1)**2;
R = Hin/Qm;
C = 0.1;
tc = R*C;
t = 3600;

# Calculations
H = Ho+(Hin-Ho)*math.exp(-t/tc);

# Results
print "the depth after one hour(m)", H
the depth after one hour(m) 1.86944492074

Example 4.8 Page No : 147

In [6]:
import math 
#Calculate time constant

# Variables
S = 3.5;
Ac = (math.pi/4)*(0.25)**2;
alpha = 0.18*10**-3;

# Calculations and Results
Vb = S*Ac/alpha;
print "volume of bulb(mm2)", Vb

Rb = ((Vb/math.pi)*(3/.4))**(1./3);
Ab = 4*math.pi*Rb**2;
D = 13.56*10**3;
s = 139;
H = 12;
tc = (D*s*Vb*10**-9)/(H*Ab*10**-6);
print "time constant (s)", tc
volume of bulb(mm2) 954.476934684
time constant (s) 68.8965695836

Example 4.9 Page No : 149

In [8]:
# Variables
ess = 5;
A = 0.1;

# Calculations
tc = ess/A;

# Results
print "time constant(s)", tc
time constant(s) 50.0

Example 4.10 Page No : 151

In [9]:
import math 
# Calculate the temperature at a depth of 1000 m

# Variables
th0 = 20.;
t = 2000.;

# Calculations
thr = th0-0.005*(t-50)-0.25*math.exp(-t/50);

# Results
print "temperature at a depth of 1000 m (degree C)", thr
temperature at a depth of 1000 m (degree C) 10.25

Example 4.11 Page No : 153

In [10]:
import math 
# Calculate the value of resistance at different values of time

# Variables
Gain = 0.3925;
T = 75.;
p_duration = Gain*T;
tc = 5.5;
Rin = 100.;
t = 1;

# Calculations and Results
Rt = p_duration*(1-math.exp(-t/tc))+Rin;
print "Value of resistance after 1s(ohm) = ", Rt
t = 2;
Rt = p_duration*(1-math.exp(-t/tc))+Rin;
print "Value of resistance after 2s(ohm) = ", Rt
t = 3;
Rt = p_duration*(1-math.exp(-t/tc))+Rin;
print "Value of resistance after 3s(ohm) = ", Rt
R_inc = Rt-Rin;
t = 5;
Rt = (R_inc)*(math.exp(-(t-3)/(5.5)))+Rin;
print "Value of resistance after 5s(ohm) = ", Rt
t = 10;
Rt = (R_inc)*(math.exp(-(t-3)/(5.5)))+Rin;
print "Value of resistance after 10s(ohm) = ", Rt
t = 20;
Rt = (R_inc)*(math.exp(-(t-3)/(5.5)))+Rin;
print "Value of resistance after 20s(ohm) = ", Rt
t = 30;
Rt = (R_inc)*(math.exp(-(t-3)/(5.5)))+Rin;
print "Value of resistance after 30s(ohm) = ", Rt
Value of resistance after 1s(ohm) =  104.893898474
Value of resistance after 2s(ohm) =  108.974200608
Value of resistance after 3s(ohm) =  112.376164418
Value of resistance after 5s(ohm) =  108.603215552
Value of resistance after 10s(ohm) =  103.46615228
Value of resistance after 20s(ohm) =  100.562627957
Value of resistance after 30s(ohm) =  100.091326114

Example 4.12 Page No : 155

In [11]:
# Variables
M = 8*10**-3;
K = 1000.;

# Calculations and Results
wn = (K/M)**0.5;
print "for critically damped system eta = 1",
B = 2*(K*M);
print "Damping constant for critically damped system (N/ms-1) = ", B
eta = 0.6;
wd = wn*(1-eta**2)**0.5;
print "frequency of damped oscillations (rad/s) = ", wd
for critically damped system eta = 1 Damping constant for critically damped system (N/ms-1) =  16.0
frequency of damped oscillations (rad/s) =  282.842712475

Example 4.13 Page No : 157

In [12]:
import math 

# Variables
K = (40.*10**-6)/(math.pi/2);
J = 0.5*10**-6;
B = 5.*10**-6;

# Calculations and Results
eta = B/(2*(K*J)**0.5);
print "damping ratio = ", eta
wn = (K/J)**0.5;
print "natural frequency (rad/sec)", wn
wd = wn*(1-(eta)**2)**0.5;
print "frequency of damped oscillations (rad/s)", wd
tc = 1/wn;
print "time constant (s)", tc
ess = 2*eta/wn;
print " steady state error (V)  = ", "for a ramp input of 5V"
ess = 5*2*eta/wn;
print "", ess
T_lag = 2*eta*tc;
print "Time lag (s)", T_lag
damping ratio =  0.70062390205
natural frequency (rad/sec) 7.13649646461
frequency of damped oscillations (rad/s) 5.09210975819
time constant (s) 0.14012478041
 steady state error (V)  =  for a ramp input of 5V
 0.981747704247
Time lag (s) 0.196349540849

Example 4.14 Page No : 159

In [13]:
import math 
# Calculate the natural  frequency 

# Variables
wn = 2*math.pi*30;
print " for a frequency of 30 Hz  wn = (K/M+5*10**-3)**0.5.........(i)",
print "But wn = (K/M)**0.5.........(ii)",
print "for a frequency of 25 Hz  wn = (K/M+5*10**-3+5*10**-3)**0.5.........(iii) ",
print " (ii) and (iii)", "on solving (i)"

# Calculations and Results
M = 6.36*10**-3;
K = 403.6;
print "M = ", M
print "K = ", K
wn = (K/M)**0.5;
f = wn/(2*math.pi);
print "natural frequency (Hz)", f
 for a frequency of 30 Hz  wn = (K/M+5*10**-3)**0.5.........(i) But wn = (K/M)**0.5.........(ii) for a frequency of 25 Hz  wn = (K/M+5*10**-3+5*10**-3)**0.5.........(iii)   (ii) and (iii) on solving (i)
M =  0.00636
K =  403.6
natural frequency (Hz) 40.0928706266

Example 4.15 Page No : 161

In [14]:
# Variables
K = 60.*10**3;
M = 30.;

# Calculations and Results
wn = (K/M)**0.5;
print "natural frequency (rad/sec)", wn
eta = 0.7;
ts = 4/(eta*wn);
print "setteling time (s)", ts
natural frequency (rad/sec) 44.72135955
setteling time (s) 0.127775313

Example 4.16 Page No : 163

In [15]:
import math 
# Calculate time lag and ratio of output and input

# Variables
print "when time period is 600s"
w = 2*math.pi/600;
tc = 60.;

# Calculations and Results
T_lag = (1/w)*math.atan(w*tc);
print "time lag (s) = ", T_lag
M = 1/((1+(w*tc)**2)**0.5);
print "ratio of output and input = ", M
print "when time period is 120s",
w = 2*math.pi/120;
tc = 60;
T_lag = (1/w)*math.atan(w*tc);
print "time lag (s) = ", T_lag
M = 1/((1+(w*tc)**2)**0.5);
print "ratio of output and input = ", M
when time period is 600s
time lag (s) =  53.5698460589
ratio of output and input =  0.846733015965
when time period is 120s time lag (s) =  24.1144042829
ratio of output and input =  0.303314471053

Example 4.17 Page No : 165

In [17]:
import math 
# Calculate the maximum allowable time constant and phase shift

# Variables
M = 1-0.05;
w = 2*math.pi*100;

# Calculations and Results
tc = (((1/M**2)-1)/(w**2))**0.5;
print "maximum allowable time constant (s)", tc
print "phase shift at 50 Hz (degree) = ",
ph = (-math.atan(2*math.pi*50*tc))*(180/math.pi);
print ph
print "phase shift at 100 Hz (degree) = ",
ph = (-math.atan(2*math.pi*100*tc))*(180/math.pi);
print  ph
maximum allowable time constant (s) 0.00052311700055
phase shift at 50 Hz (degree) =  -9.33268272936
phase shift at 100 Hz (degree) =  -18.1948723388

Example 4.18 Page No : 167

In [18]:
import math 
# Calculate maximum value of indicated temperature and delay time

# Variables
T = 120.;
w = 2*math.pi/T;
tc1 = 40.;
tc2 = 20.;

# Calculations and Results
M = (1/((1+(w*tc1)**2)**0.5))*(1/((1+(w*tc2)**2)**0.5));
M_temp = M*10;
print "maximum value of indicated temperature (degree C)", M_temp
ph = ((math.atan(w*tc1)+math.atan(w*tc2)));
T_lag = ph/w;
print "Time lag (s)", T_lag
maximum value of indicated temperature (degree C) 2.975684577
Time lag (s) 36.9326231389

Example 4.19 Page No : 169

In [19]:
import math 


# Find the output 
print "when tc = 0.2",
print "output = 1/(1+(2*0.2)**2)**0.5]math.sin[2t-math.atan(2*0.2)]+3/(1+(2*0.2)**2)**0.5]math.sin[20t-math.atan(20*0.2)]",
print "on solving   output = 0.93 math.sin(2t-21.8)+0.073 math.sin(20t-76)",
print "when tc = 0.002",
print "output = 1/(1+(2*0.002)**2)**0.5]math.sin[2t-math.atan(2*0.002)]+3/(1+(2*0.002)**2)**0.5]math.sin[20t-math.atan(20*0.002)]",
print "on solving   output =  1math.sin(2t-0.23)+0.3 math.sin(20t-2.3)",
when tc = 0.2 output = 1/(1+(2*0.2)**2)**0.5]math.sin[2t-math.atan(2*0.2)]+3/(1+(2*0.2)**2)**0.5]math.sin[20t-math.atan(20*0.2)] on solving   output = 0.93 math.sin(2t-21.8)+0.073 math.sin(20t-76) when tc = 0.002 output = 1/(1+(2*0.002)**2)**0.5]math.sin[2t-math.atan(2*0.002)]+3/(1+(2*0.002)**2)**0.5]math.sin[20t-math.atan(20*0.002)] on solving   output =  1math.sin(2t-0.23)+0.3 math.sin(20t-2.3)

Example 4.20 Page No : 171

In [20]:
import math 

#Calculate maximum and minimum value of indicated temperature, phase shift, time lag 

# Variables
T_max = 640.;
T_min = 600.;
T_mean = (T_max+T_min)/2;
Ai = T_mean-T_min;
w = 2*math.pi/80;
tc = 10;

# Calculations and Results
Ao = Ai/((1+(w*tc)**2))**0.5;
T_max_indicated = T_mean+Ao;
print "Maximum value of indicated temperature(degree C) = ", T_max_indicated
T_min_indicated = T_mean-Ao;
print "Minimum value of indicated temperature(degree C) = ", T_min_indicated
ph = -math.atan(w*tc);
Time_lag = -ph/w;
print "Time lag (s)", Time_lag
Maximum value of indicated temperature(degree C) =  635.728782002
Minimum value of indicated temperature(degree C) =  604.271217998
Time lag (s) 8.47689466383

Example 4.21 Page No : 173

In [21]:
import math 
# determine damping ratio


# Variables
w = 2.;
K = 1.5;
J = 200.*10**-3;
wn = (K/J)**0.5;
u = w/wn;
M = 1.1;

# Calculations and Results
eta = (((1/(M**2))-((1-u**2)**2))/(2*u)**2)**0.5;
print "damping ratio = ", eta
damping ratio =  0.534147321328

Example 4.22 Page No : 175

In [22]:
import math 
# Calculate the frequency range

# Variables
eta = 0.6;
fn = 1000;
M = 1.1;
print "M = 1/[[(1-u**2)**2]+(2*u*eta)**2]**0.5 ..........(i)",
print "on solving u**4-0.5u**2+0.173 = 0",
print "the above equation gives imaginary values for frequency so for eta = 0.6 the output is not 1.1",
print " on solving equation (i) we have", "Now let M = 0.9"
print "u**4-0.56u**2-0.234 = 0",
print "on solving u = 0.916",

# Calculations and Results
u = 0.916;
f = u*fn;
print "maximum value of range (Hz) = ", f
print " the range of the frequency is from 0 to 916 Hz", "So"
M = 1/[[(1-u**2)**2]+(2*u*eta)**2]**0.5 ..........(i) on solving u**4-0.5u**2+0.173 = 0 the above equation gives imaginary values for frequency so for eta = 0.6 the output is not 1.1  on solving equation (i) we have Now let M = 0.9
u**4-0.56u**2-0.234 = 0 on solving u = 0.916 maximum value of range (Hz) =  916.0
 the range of the frequency is from 0 to 916 Hz So

Example 4.23 Page No : 177

In [23]:
import math 
# determine the error

# Variables
w = 6.;
wn = 4.;
u = w/wn;
eta = 0.66;

# Calculations
M = 1/(((1-u**2)**2)+(2*eta*u)**2)**0.5;
Error = (M-1)*100;

# Results
print "error (%) = ", Error
error (%) =  -57.2934157194