# 2.1
import math;
t=0.35;
P=1500*10**3;
E=180*10**9;
r=36.5;
x=16;
y=3;
a=math.pi*36.5*10**-3;
da=(0.05*a*P/E)*((r/t)**0.2)*((x/y)**0.33)*((x/t)**3);
print ("Displacement of the free end = %.2f m" % da)
# 2.2
import math;
P=100*10**3;
A=1500*10**-6;
F=P*A;
Cs=F/3;
Ls=Cs+40;
print ("Natural length of spring = %.2f mm" % Ls)
P1=10*10**3;
F1=P1*A;
Ss=3+2*.5;
D=F1/Ss;
print ("Displacement of point C = %.2f mm" % D)
# 2.3
import math;
D=15.0*10**-3;
P=300*10**3;
sm=300*10**6;
t=(3*D**2*P/(16*sm))**0.5*10**3;
print ("Thickness = %.2f mm" %t)
P=150*10**3;
v=0.28;
E=200.0*10**9;
dm=3.0*(1-v**2)*D**4*P/(256.0*E*t**3);
print ("Deflection at center for Pressure of 150 kN/m2= %.4f mm" %dm)
d=8900;
wn=(20*t*10**-3/D**2)*(E/(3*d*(1-v**2)))**0.5;
print ("Natural frequency of the diaphragm =%.0f rad/sec" %wn)
# 2.4
import math;
T=100;
G=80*10**9;
d=2*15*10**-3;
th=16*T/(math.pi*G*d**3)
print ("Angle of twist= %.6f rad" %th)
# 2.5
import math;
d=60*10**-3;
Q=80*10**-3;
A=(math.pi/4)*d**2;
v=Q/A;
vi=10**-3;
de=10**3;
Re=v*de*d/vi;
print ("Reynoids number = %.2f mm" %Re)
d2=60*10**-3;
d1=100*10**-3;
A2=(math.pi/4)*d2**2;
M=1/((1-(d2/d1)**2)**0.5);
Cd=0.99;
w=1*10**3;
Qact=80*10**-3;
Pd=((Qact/(Cd*M*A2))**2)*w/(2)*10**-3;
print ("Differential pressure = %.0f kN/m2 " %Pd)
Po=0.28;
D=10*10**-3;
E=206*10**9;
t=0.2*10**-3;
dm=(3*(1-Po**2)*D**4*Pd)/(256*E*t**3);
deff=dm*10**6;
print ("Deflection at the center of diaphragm = %.2f micro m" %deff)
# 2.6
import math;
Pd=10*10**3;
d=1000;
VmeanW= (2*Pd/d)**0.5;
print ("Mean velocity of water = %.2f m/s" %VmeanW)
d=0.65;
Va= (2*Pd/d)**0.5;
print ("Velocity of air= %.1f m/s" %Va)
# 2.7
import math;
print ('let coefficient of discharge Cd=1')
H1=0.9;
L=1.2;
g=9.81;
Q=(2.0/3)*L*(2*g)**0.5*(H1)**(1.5);
th=45;
H2=Q*(15.0/8)/(2.0*g)
print ("Depth of flow = %.1f m" %H2)
# 2.8
import math
Cd=0.6;
H=0.5;
dH=0.01;
g=9.81;
Q=(8.0/15)*Cd*(2*g)**0.5*(H)**(2.5);
dQ=(2.5*dH/H)*Q;
print ("Uncertinity in discharge = %.4f m3/s" %dQ)
# 2.9
import math;
Rnormal=10000.0/2;
Rpl=10000/50;
Rc1=Rnormal-3850;
Dnormal=Rc1/Rpl;
print ("Displacement = %.2f mm" %Dnormal)
Rc2=Rnormal-7560;
Dnormal=Rc2/Rpl;
print ("Displacement = %.2f mm" %Dnormal)
print ('One print lacement is positive and other is negative so two print lacements are in the opposite direction')
Re=10.0*1/200;
print ("Resolution = %.2f mm" %Re)
#2.11
import math;
RAB=125;
Rtotal=5000;
R2=0.0
R2=(75.0/125.0)*Rtotal
R4=2500;
ei=5;
eo=((R2/Rtotal)-(R4/Rtotal))*ei;
print ("Output voltage = %f V" %R2)
# 2.12
import math;
Rm=10000;
Rp=Rm/15;
R=600;
P=5;
ei= (P*R)**0.5;
print ("Maximum excitation voltage = %.1f V" %ei)
S=ei/360;
print ("Sensitivity = %.3f V/degree" %S)
# 2.13
import math;
Rwga=1.0/400;
Re=Rwga/5;
print ("Resolution = %.4f mm" %Re)
# 2.14
import math;
mo=0.8;
sr=250;
sm=sr/mo;
R=sm*1*10**-3;
print ("Resolution of 1mm movement = %.4f degree/mm" %R)
Rq=300.0/1000;
print ("Required Resolution of 1mm movement = %.3f degree/mm" %Rq)
print ('Since the resolution of potentiometer is higher than the resolution required so it is suitable for the application')
# 2.15
import math;
Pd=(10.0**2)/150;
print ("Power dissipation = %.3f W" %Pd)
th_pot=80+Pd*30;
PDa=(10*10**-3)*(th_pot-35);
print ("Power dissipation = %.3f W" %PDa)
print ('Since power dissipation is higher than the dissipation allowed so potentiometer is not suitable')
# 2.16
import math;
Gf=4.2;
v=(Gf-1)/2;
print ('Possion s ratio=%f' %v)
# 2.17
import math;
strain=-5*10**-6;
Gf=-12.1;
R=120;
dR_nickel=Gf*R*strain;
print ("Change in resistance of nickel = %.3f ohm" %dR_nickel)
Gf=2;
R=120;
dR_nicrome=Gf*R*strain;
print ("Change in resistance of nicrome = %.3f ohm" %dR_nicrome)
# 2.18
import math;
s=100.0*10**6;
E=200.0*10**9;
strain=s/E;
Gf=2.0;
r_per_unit=Gf*strain*100.0;
print ("Percentage change in resistance = %.1f " %r_per_unit)
#2.19
import math;
b=0.02;
d=0.003;
I=(b*d**3)/12;
E=200*10**9;
x=12.7*10**-3;
l=0.25;
F=3*E*I*x/l**3;
x=0.15;
M=F*x;
t=0.003;
s=(M*t)/(I*2);
strain=s/E;
dR=0.152;
R=120;
Gf=(dR/R)/strain;
print ("Gauge factor = %.2f " %Gf)
# 2.20
import math;
dR=0.013;
R=240;
l=0.1;
Gf=2.2;
dl=(dR/R)*l/Gf*10**6;
print (" Change in length= %.1f um " %dl)
strain=dl*10**-6/l;
E=207*10**9;
s=E*strain;
A=4*10**-4;
F=s*A;
print (" Force= %.2f N " %F)
# 2.21
import math;
th1=30;
th2=60;
th0=th1+th2/2;
Rth1=4.8;
Rth2=6.2;
Rth0=5.5;
ath0=(1/Rth0)*(Rth2-Rth1)/(th2-th1);
print (" alpha at o degree= %.4f /degree C " %ath0)
print ('5.5(1+0.0085(th-45))')
# 2.22
import math;
th1=100;
th2=130;
th0=th1+th2/2;
Rth1=573.40;
Rth2=605.52;
Rth0=589.48;
ath0=(1/Rth0)*(Rth2-Rth1)/(th2-th1);
print ("alpha at o degree= %.5f /degree C " %ath0)
print ('Linear approximation is: Rth= 589.48(1+0.00182(th-115))')
# 2.23
import math;
Rth0=100;
ath0=0.00392;
dth=65-25;
R65=Rth0*(1+ath0*dth);
print ("resistance at 65 degree C= %.2f ohm " %R65)
th=(((150/100)-1)/ath0)+25;
print (" Temperature = %.2f degree C " %th)
# 2.24
import math;
Rth0=10;
ath0=0.00393;
dth=150-20;
R150=Rth0*(1+ath0*dth);
print ("Resistance at 150 degree C=%.2f ohm" %R150)
# Calculate the time
import math;
th=30.0;
th0=50;
tc=120;
t=-120*(math.log(1-(th/th0)));
print ("Time= %.2f s " %t)
#2.26
import math;
R25=100;
ath=-0.05;
dth=35-25;
R35=R25*(1+ath*dth);
print ("Resistance at 35 degree C= %.2f ohm " %R35)
# 2.27
import math;
Ro=3980;
Ta=273;
#3980= a*3980*exp(b/273)
Rt50=794;
Ta50=273+50;
#794= a*3980*exp(b/323)
#on solving
#a=30*10**-6, b=2843
Ta40=273+40;
Rt40=(30*10**-6)*3980*math.exp(2843/313);
print ("Resistance at 40 degree C= %.2f ohm " %Rt40)
Rt100=(30*10**-6)*3980*math.exp(2843/373);
print ("Resistance at 100 degree C= %.2f ohm " %Rt100)
# 2.28
import math;
th=((1-1800/2000)/0.05)+70;
dth=th-70;
print ("Change in temperature= %.1f degree C " %dth)
# 2.29
import math;
C=500*10**-12;
R20=10000*(1-0.05*(20-25));
f20=1/(2*math.pi*R20*C);
print ("Frequency of oscillation at 20 degree C = %.2f Hz " %f20)
R25=10000*(1-0.05*(25-25));
f25=1/(2*math.pi*R25*C);
print ("Frequency of oscillation at 25 degree C = %.2f Hz " %f25)
R30=10000*(1-0.05*(30-25));
f30=1/(2*math.pi*R30*C);
print ("Frequency of oscillation at 30 degree C = %.2f Hz " %f30)
# 2.30
import math;
Se_thermocouple=500-(-72);
print ("Sensitivity of thermocouple= %.1f micro V/degree C" %Se_thermocouple)
Vo=Se_thermocouple*100*10**-6;
print ("Maximum output voltage= %.2f V " %Vo)
# 2.31
import math;
ET=27.07+0.8;
print ("Required e.m.f.= %.2f mV " %ET)
print ('Temperature corresponding to 27.87 mV is 620 degree C')
# 2.32
import math;
Rm=50;
Re=12;
E=33.3*10**-3;
i=0.1*10**-3;
Rs=(E/i)-Rm-Re;
print ("Series resistance=%.2f ohm" %Rs)
Re=13;
i1=E/(Rs+Re+Rm);
AE=((i1-i)/i)*800;
print ("Approximate error due to rise in resistance of 1 ohm in Re=%.2f degree C" %AE)
R_change=50*0.00426*10;
i1=E/(Rs+Re+Rm+R_change);
AE=((i1-i)/i)*800;
print ("Approximate error due to rise in Temp. of 10=%.2f degree C" %AE)
# 2.33
import math;
E_20=0.112*10**-3;# emf at 20degree C
E_900=8.446*10**-3;
E_1200=11.946*10**-3;
E1=E_900-E_20;
E2=E_1200-E_20;
#E1=1.08*R1/(R1+2.5+R2 (i)
#E2=1.08*(R1+2.5)/(R1+2.5+R2 (ii)
#on solving (i) and (ii)
R1=5.95;
R2=762.6;
print ("Value of resistance R1=%.2f ohm" %R1)
print ("Value of resistance R2=%.2f ohm" %R2)
# 2.34
import math;
th=20;
Vz=2.73+th*10*10**-3;
Voffset=-2.73;
Vout=Vz+Voffset;
Rbias=(5-0.2)/10**-3;
Rzero=500;
th=50;
Vz=2.73+th*10*10**-3;
VmaxT=Vz+Voffset;
Vsupply=5;
Rl=(VmaxT*Rbias)/(Vsupply-VmaxT);
print ("Value of resistance R1=%.2f ohm" %R1)
print ('value of resistance RL>>Rl')
# 2.35
import math;
L1=2;
La=1-0.02;
Lnew=2/La;
dl=Lnew-L1;
print ("Change in inductance=%.2f mH" %dl)
# 2.36
import math;
linearity_percentage=(0.003/1.5)*100;
print ("percentage linearity=%.2f " %linearity_percentage)
# 2.37
import math;
displacement=0.5;
Vo=2*10**-3;
Se_LVDT=Vo/displacement;
print ("senstivity of the LVDT=%.3f V/mm" %Se_LVDT)
Af=250;
Se_instrument=Se_LVDT*Af;
print ("Senstivity of the instrument=%.1f V/mm" %Se_instrument)
sd=5/100;
Vo_min=50/5;
Re_instrument=1*1.0/1000;
print ("resolution of instrument=%.3f mm" %Re_instrument)
# 2.38
import math;
b=0.02;
t=0.004;
I=(1.0/12)*b*t**3;
F=25;
l=0.25;
E=200.0*10**9;
x=(F*l**3)/(3.0*E*I);
print ("deflection=%.2f m" %x)
DpF=x/F;
Se=DpF*0.5*1000;
Re=(10.0/1000)*(2.0/10);
F_min=Re/Se;
F_max=10/Se;
print ("minimum force=%.2f N" %F_min)
print ("maximum force=%.2f N" %F_max)
# 2.39
import math;
print ('permittivity of the air e0=8.85*10**-12')
e0=8.85*10**-12;
w=25.0*10**-3;
d=0.25*10**-3;
Se=-4.0*e0*w/d;
print ("sensitivity of the transducer=%.2f F/m" %Se)
# 2.40
import math;
C1=370*10**-12;
d1=3.5*10**-3;
d2=2.9*10**-3;
C2=C1*d1*10**12/d2;
print ("the value of the capacitance afte the application of pressure=%.2f pF" %C2)
# 2.41
import math;
fo1=100*10**3;
d1=4;
d2=3.7;
fo2=((d2/d1)**0.5)*fo1;
dfo=fo1-fo2/10**-3;
print ("change in frequency of the oscillator=%e kHz" %dfo)
# 2.42
import math;
L_air=(3.1-3)/2;
D_stress=100/L_air;
e0=8.85*10**-12;
l=20*10**-3;
D2=3.1;
D1=3;
C=(2*math.pi)*e0*l*10**12/(math.log(D2/D1));
print ("Capacitance=%.1f pF" %C)
l=(20*10**-3)-(2*10**-3);
C_new=(2*math.pi)*e0*l/(math.log(D2/D1));
C_change=C-C_new*10**12;
print ("change in Capacitance=%.1f pF" %C_change)
#2.43
import math;
M=0.95;
w=2*math.pi*20;
tc=(1/w)*((M**2)/(1-M**2))**0.5;
print ("Time constant=%.2f s" %tc)
ph=((math.pi/2)-(math.atan(w*tc)))*(180/math.pi);
print ("Phase shift=%.1f deg" %ph)
C=(8.85*10**-12*300*10**-6)/(0.125*10**-3);
R=tc*10**-6/C;
print ("Series resistance=%.0f Mohm" %R)
M=1/(1+(1/(2*math.pi*5*tc)**2))**0.5;
print ("Amplitude ratio=%.1f " %M)
Eb=100;
x=0.125*10**-3;
Vs=Eb/x;
print ("Voltage sensitivity=%d V/m" %Vs)
#2.44
import math;
e0=8.85*10**-12;
A=500*10**-6;
d=0.2*10**-3;
C=e0*A/d;
d1=0.18*10**-3;
C_new=e0*A/d1;
C_change=C_new-C;
Ratio=(C_change/C)/(0.02/0.2);
print ("ratio of per unit change of capacitance to per unit change of diaplacement=%.2f" %Ratio)
d1=0.19*10**-3;
e1=1;
d2=0.01*10**-3;
e2=8;
C=(e0*A)/((d1/e1)+(d2/e2));
d1_new=0.17*10**-3;
C_new=(e0*A)/((d1_new/e1)+(d2/e2));
C_change=C_new-C;
Ratio=(C_change/C)/(0.02/0.2);
print (" New ratio of per unit change of capacitance to per unit change of diaplacement=%.2f" %Ratio)
# 2.47
import math;
g=0.055;
t=2*10**-3;
P=1.5*10**6;
Eo=g*t*P;
print ("Output voltage=%.0f V" %Eo)
e=40.6*10**-12;
d=e*g*10**12;
print (" Charge sensitivity=%.2f pC/N" %d)
# 2.48
import math;
g=0.055;
t=1.5*10**-3;
Eo=100;
P= Eo/(g*t);
A=25*10**-6;
F=P*A;
print (" Force=%.0f N" %F)
# 2.49
import math;
A=25*10**-6;
F=5;
P=F/A;
d=150*10**-12;
e=12.5*10**-9;
g=d/(e);
t=1.25*10**-3;
Eo=(g*t*P);
strain=P/(12*10**6);
Q=d*F*10**12;
C=Q/Eo;
print (" strain=%.4f " %strain)
print (" Charge=%.0f pC" %Q)
print (" capacitance=%.0f pF" %C)
# 2.50
import math;
d=2*10**-12;
t=1*10**-3;
Fmax=0.01;
e0=8.85*10**-12;
er=5;
A=100*10**-6;
Eo_peak_to_peak=2*d*t*Fmax*10**3/(e0*er*A);
print (" peak voltage swing under open conditions=%.2f mV" %Eo_peak_to_peak)
Rl=100*10**6;
Cl=20*10**-12;
d1=1*10**-3;
Cp=e0*er*A/d1;
C=Cp+Cl;
w=1000;
m=(w*Cp*Rl/(1+(w*C*Rl)**2)**0.5);
El_peak_to_peak=(2*d*t*Fmax*10**3/(e0*er*A))*m;
print (" peak voltage swing under loaded conditions=%.2f mV" %El_peak_to_peak)
E=90*10**9;
dt=2*Fmax*t*10**12/(A*E);
print (" Maximum change in crystal thickness=%.2f pm" %dt)
# 2.51
import math;
M=0.95;
tc=1.5*10**-3;
w=(1/tc)*((M**2)/(1-M**2))**0.5;
print (" Minimum frequency=%.2f rad/sec" %w)
ph=((math.pi/2)-(math.atan(w*tc)))*(180/math.pi);
print (" Phase shift=%.2f deg" %ph)
#2.52
import math;
Kq=40*10**-3;
Cp=1000*10**-12;
K=Kq/Cp;
print (" Sensitivity of the transducer=%.2f V/m" %K)
Cc=300*10**-12;
Ca=50*10**-12;
C=Cp+Cc+Ca;
Hf=Kq/C;
print (" High frequency sensitivity =%.2f V/m" %Hf)
R=1*10**6;
tc=R*C;
M=0.95;
w=(1/tc)*((M**2)/(1-M**2))**0.5;
f=w/(2*math.pi);
print (" Minimum frequency=%.2f sec" %f)
print ('now f=10Hz')
f=10;
w=2*math.pi*f;
tc=(1/w)*((M**2)/(1-M**2))**0.5;
C_new=tc/R;
Ce=(C_new-C)*10**6;
print (" External shunt capacitance=%.2f pF" %Ce)
Hf_new=Kq/C_new;
print (" new value of high frequency sensitivity=%.2f V/m" %Hf_new)
# 2.53
import math;
R=10**6;
C=2500*10**-12;
tc=R*C;
t=2*10**-3;
d=100*10**-12;
F=0.1;
e1=10.0**3*(d*F*(math.exp(-t/tc))/C);
print ("Voltage just before t=2ms =%.2f mV" %e1)
el_after=10**3*(d*F*(math.exp(-t/tc)-1)/C);
print (el_after,'voltage just after t=2ms (mV)')
print ("Voltage just after t=2ms =%.2f mV" %el_after)
print ('when t=10ms')
t=10.0*10**-3;
T=2.0*10
e_10=10.0**3*(d*F*(math.exp((-T/tc)-1))*(math.exp(-(t-T))/tc)/C)
print ("output voltage 10 ms after the application of impulse =%.0f mV" %e_10)
# 2.54
import math;
print ('Let T=1');
T=1;
el=0.95;
tc=-T/math.log(el);
print ("Time constant =%.2f s" %tc)
print ('as T=1 so time constant should be approximately equal to 20T')
#2.55
import math;
Kh=-1*10**-6;
I=3;
B=0.5;
t=2*10**-3;
Eh=Kh*I*B*10**3/t;
print ("output voltage =%.2f mV" %Eh)
#2.56
import math;
R1=(30/10*10**-3)-1000;
print ("External resistance required =%.3f ohm" %R1)
Id=30.0*10**3/((2*10**3)+(100*10**3))
print ("Dark current =%.2f mA" %Id)
#2.57
import math;
Vb=10-(10.0/((2*10**3))*10**3);
print ('Potential of point b, Vb= %f'%Vb)
Vd=10-(10/((3*10**3))*2*10**3);
print ('Potential of point d, Vd= %f' %Vd)
Ebd=Vb-Vd;
print ("Outout voltage of bridge =%.2f V" %Ebd)