# Demo entry 6762125

Sound source

Submitted by anonymous on Oct 10, 2018 at 11:55
Language: Matlab. Code size: 998 Bytes.

% question definition
k = 10;
R = 5;
theta = linspace(0, 2*pi, 100);
rho = linspace(5, 5, 100);
[x1, x2] = pol2cart(theta, rho);
r = rho;
%
% Ans1
% G0 = -1/2/pi * log(r);
G0 = 1i/4 * besselh(0, k*r);
figure(1)
polar(theta, abs(G0));
title('$\left| G_{k}(\mathbf{x},\mathbf{y})\right|$',...
'Interpret', 'latex', 'Fontsize',  16)
%
% Ans2
% r_i definition
r1 = rho.*cos(theta);
r2 = rho.*sin(theta);
G0y = 1i/4 * k * r1 ./(r.^3) .* besselh(1, k*r);
figure(2)
polar(theta, abs(G0y), 'r')
title('$\left|\frac{\partial{G_{k}(\mathbf{x},\mathbf{y})}} {\partial{y_{1}}}\right|$',...
'Interpret', 'latex', 'Fontsize',  16)
%
% Ans3
delta = 0;
G0yy = 1i/4 * (-k^2 * r1.*r2./power(r,2) .* besselh(0, k*r) + k*(...
2*r1.*r2./power(r,3) - delta./r).*besselh(1, k*r));
figure(3)
polar(theta, abs(G0yy), 'g')
title('$\left| \frac{\partial^{2}{G_{k}(\mathbf{x},\mathbf{y})}} {\partial{y_{1}}\partial{y_{2}}}\right|$',...
'Interpret', 'latex', 'Fontsize',  18)


This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.