# 5.1
import math
D=8*10**-3;
A=D**2;
print ('A=%f'%A)
J=8*10**-3;
K=16*10**-3;
B=4*J*K;
print ('B=%f'%B)
print ('since A<B so the instrument is underdamped')
th=(100*math.pi)/180;
i=10*10**-3;
F=0.2*10**-6;
G=(K*th+F)/i;
l=65*10**-3;
d=25*10**-3;
N=G/(B*l*d);
print ("Number of turns=%.0f " %N)
i=F/G*10**6;
print ("current required to overcome friction=%.1f uA " %i)
# 5.2
import math
eta=0.6;
fn=2400;
M=0.98;
#M=1/(((1-u**2)**2)+(2*u*eta)**2)**0.5; ..........(i)
# On solving the above equation we get u=0.79
u=0.79;
fu=u*fn;
print ("upper value of range=%.0f Hz" %fu)
#Now let M=1.02, on solving equation (i) we have u=0.29
u=0.29;
fl=u*fn;
print ("lower value of range=%.0f Hz" %fl)
print ('So, the range of the frequency is from 696 to 1896 Hz')
# 5.3
import math
eta=0.64;
u=0.1;
alpha_1=math.degrees(math.atan(2*eta*u/(1-u**2)))
print ("phase displacement for the fundamental=%.2f degree" %alpha_1)
u=0.5;
alpha_5=math.degrees(math.atan((2*eta*u/(1-u**2))))
print ("phase displacement for the 5th harmonic=%.2f degree" %alpha_5)
#5.4
import math
To=1.0/2000;
T=1.0/50;
#Rn=1/(1+n**2*(To/T)**2)
R1=1.0/(1+1.0**2*(To/T)**2);
R3=1.0/(1+3**2*(To/T)**2);
R5=1.0/(1+5**2*(To/T)**2);
R7=1.0/(1+7**2*(To/T)**2);
R11=1.0/(1+11**2*(To/T)**2);
R13=1.0/(1+13**2*(To/T)**2);
PE3=(R3-1/1)*100;
print ("Percentage error for the production of 3rd harmonics=%.2f" %PE3)
PE5=(R5-1/1)*100;
print ("Percentage error for the production of 5th harmonics=%.2f" %PE5)
PE7=(R7-1/1)*100;
print ("Percentage error for the production of 7th harmonics=%.2f" %PE7)
PE11=(R11-1/1)*100;
print ("Percentage error for the production of 11th harmonics=%.2f" %PE11)
PE13=(R13-1/1)*100;
print ("Percentage error for the production of 13th harmonics=%.2f" %PE13)
#displacement of nth harmonic alpha=atan2*n/((T/To)-n**2*(To/T))
alpha_1=math.degrees(math.atan(2*1/((T/To)-(1**2*(To/T)))));
alpha_13=(math.degrees(math.atan(2*13/((T/To)-(13**2*(To/T))))));
alpha_1_equivalent_13=13*alpha_1;
phase_displacement_13=alpha_13-alpha_1_equivalent_13;
print (" Displacement of 13th harmonic=%.2f degree" %phase_displacement_13)
# 5.5
import math
W_min=2.5*6.25*10**-6;
f=500000;
S_min=W_min*f;
print ("minimum tape speed=%.2f m/s" %S_min)
# 5.6
import math
Num_per_sec=12000;
S=1.5*10**3;
Number_density=Num_per_sec/S;
print ("Number density of the tape=%.0f numbers/mm" %Number_density)