summaryrefslogtreecommitdiff
path: root/1985/CH7/EX7.5/Chapter7_Example5.sce
blob: e3583ec13a0ff96e906e1df87f4b29bcbbc41b6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
clc
clear
//Input data
P=1.5//The acoustic power produced by the loudspeaker in J/s
r=20//Distance in m

//Calculations
I=(P/(4*3.14*r^2))//Intensity of the sound produced by the loudspeaker in W/m^2
b=10*log10(I/10^-12)//Intensity level in dB

//Output
printf('The intensity level at a distance of %i m is %3.1f dB',r,b)