from math import log10
#Variable Declaration
#delta_L=L2-L1
#Calculation
#I proportional to square of amplitude so when amplitude is doubled intensity will becomes 4 times
#L1=10*l0g10(I1/I0)
#L2=10*log10(I2/I0)
#delta_L=L2-L1
#delta_L=10*log(I1/I0)-10*log(I2/I0)=10*log(I2/I1)
I21=4;#I2/I1=4 because intensity=amp^2
delta_L=10*log10(I21);#increase in intensity level
#Result
print 'Increase in intensity level =',round(delta_L,2),'dB'
from math import sqrt
#Variable Declaration
#L2-L1=10*log10(I2/I1)
#so , we can write that
L2=40 #i dB
L1=10 #in dB
#where L1 and L2 are intensity level of two waves of same frequency
#Calculation
L=L2-L1;
#let I2/I1=I
I=10**(L/10);
#let a2/a1=a
a=sqrt(I);#Ratio of their amplitudes
#Result
print 'Ratio of their amplitudes =',round(a,3)
from math import log10
#Variable Declaration
I1=25.2 #in Wm^-2
I2=0.90 #in Wm^-2
#Calculation
B=10*log10(I1/I2) #Relative loudness of sound in dB
#Result
print 'Relative loudness of sound = ',round(B,2),'dB'
from math import log10
#Variable Declaration
I=1e4 #in W/(m*m)
I0=1e-12 #in W/(m*m)
#Calculation
B=10*log10(I/I0);#intensity level
#Result
print "intensity level = ",B,'dB'
#Variable Declaration
B=5 # in dB
#Calculation
#B=10*log(I2/I1)
#let I2/I1=x
#10*log(x)=5
x=10**(5./10);
#Result
print 'Amplified sound is',round(x,3),'times more intense than the unamplified sound'
#Variable Declaration
d=198; #in meter
t=1.2;#in second
#Calculation
#velocity=distance/time
v=2*d/t;#velocity
#Result
print 'velocity =',v,'m/s'
#Variable Declaration
V=5600 #in m^3
T=2 #in second
s=700 #in m^2
#Calculation
a=0.16*V/(s*T)
#Result
print "absorption coefficient =",a
#Variable Declaration
absorp1=92.90; #in m^^2
absorp2=92.90;#in m^2
V=2265.6;#in m^3
#Calculations
T1=0.16*V/(absorp1);
T2=0.16*V/(absorp1+absorp2);
ans=T2/T1;#effect on Reverberation time
#Result
print "Reverberation time reduced to ",ans,"of original value"
#Variable Declaration
v=25.2*20.3*8.04 ;#in m^3
T=0.75; #in second
#Calculations
absorp1=500*0.3176 ;#in m^2
absorp2=(0.16*v)/T;
T1=(0.16*v)/(absorp1+absorp2);#reverbaration time
#Result
print "reverbaration time =",round(T1,3),'sec'
#Variable Declaration
v=45*100*17.78;#in m^3
#Calculations
absorp1=(700*0.03)+(600*0.06)+(400*0.025)+(600*0.3);
absorp_p=600*4.3;
T1=(0.16*v)/(absorp1);#Reverbaration time (empty hall)
T2=(0.16*v)/(absorp_p+absorp1);#Reverbaration time with full capacity
#Results
print 'Reverbaration time (empty hall) =',round(T1,2),'sec' #printing mistake at the end in the textbook
print 'Reverbaration time with full capacity =',round(T2,2),'sec'