0% found this document useful (0 votes)
36 views

All All: %% Part A % Plot Colors % Characteristic Impedance (Assume Water) % Velocity Amplitude % R/a % Pressure Values

The document contains code to generate three figures plotting pressure amplitudes and ratios for plane waves with different wavenumbers (ka) versus radial distance (r/a). Figure a) plots on-axis pressure amplitude versus r/a for ka = 3, 6, 9, 12. Figure b) plots the pressure ratio versus r/a for the same ka values. Figure c) calculates pressure ratio versus r/a for a single ka and identifies the r/a value of 0.9, corresponding to a radial distance of 0.35 m.

Uploaded by

Adam Foltz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

All All: %% Part A % Plot Colors % Characteristic Impedance (Assume Water) % Velocity Amplitude % R/a % Pressure Values

The document contains code to generate three figures plotting pressure amplitudes and ratios for plane waves with different wavenumbers (ka) versus radial distance (r/a). Figure a) plots on-axis pressure amplitude versus r/a for ka = 3, 6, 9, 12. Figure b) plots the pressure ratio versus r/a for the same ka values. Figure c) calculates pressure ratio versus r/a for a single ka and identifies the r/a value of 0.9, corresponding to a radial distance of 0.35 m.

Uploaded by

Adam Foltz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

7.4.6.

c)
clear all
close all
clc
%% Part A
figure
% Plot Colors
C = ['k','r','g','b'];
% Characteristic Impedance (assume water)
pc = 1.54e6;
% velocity amplitude
U = 1;
% r/a
x1 = 0:.01:10;
% pressure values
p1(4,1001) = 0;
hold on
for ka = 3:3:12
p1(ka/3,:) = 2*pc*U*abs(sin(.5*ka*x1.*(sqrt(1+(1./x1).^2)-1)));
plot(x1,p1(ka/3,:),C(ka/3))
end
% format plot
title('On-Axis Pressure Amplitude vs. r/a')
xlabel('r/a')
ylabel('Pressure')
legend('ka = 3','ka = 6','ka = 9','ka = 12')

%% Part B
figure
% pressure values
hold on
p2(4,1001) = 0;
for ka = 3:3:12
x2 = x1(x1 > ka/2); % only r/a greater than ka/2
par1 = .5*pc*U*(1./x2)*ka;
p2(ka/3,:) = [nan(1,1001-length(x2)),par1];
plot(x2,p1(ka/3,1002-length(x2):end)./p2(ka/3,1002-length(x2):end),C(ka/3))
end
% format plot
axis([0,10,.9,1])
title(Pressure Ratio vs. r/a')
xlabel('r/a')
ylabel('Pressure Ratio')
legend('ka = 3','ka = 6','ka = 9','ka = 12')
%% Part C
figure
% pressure values
p3(1,1001) = 0;
% ka
f = 4000;
w = 2*pi*f;
c = 1500;
k = w/c;

a = .2;
ka = k*a;
% pressure values (eqn 1)
p31 = 2*pc*U*abs(sin(.5*ka*x1.*(sqrt(1+(1./x1).^2)-1)));
% pressure values (eqn 2)
x2 = x1(x1 > ka/2); % only r/a greater than ka/2
par1 = .5*pc*U*(1./x2)*ka;
p32 = [nan(1,1001-length(x2)),par1];
% pressure ratio
pr = p31(1,1002-length(x2):end)./p32(1,1002-length(x2):end);
% plot
plot(x2,pr)
axis([0,10,.9,1])
title(Pressure Ratio vs. r/a')
xlabel('r/a')
ylabel('Pressure Ratio')
% find r/a = .9
i = 1;
while pr(i) < .9
i = i+1;
end
% r
x2(i-1)*a

a)
6

3.5

On-Axis Pressure Amplitude vs. r/a

x 10

ka =
ka =
ka =
ka =

3
6
9
12

Pressure

2.5

1.5

0.5

5
r/a

10

b)
Pressure Ratio vs. r/a
1
ka =
ka =
ka =
ka =

0.99
0.98

3
6
9
12

Pressure Ratio

0.97
0.96
0.95
0.94
0.93
0.92
0.91
0.9

5
r/a

10

c)
Pressure Ratio vs. r/a
1
0.99
0.98

Pressure Ratio

0.97
0.96
0.95
0.94
0.93
0.92
0.91
0.9

r = 0.3500 m

5
r/a

10

You might also like