31.08.2018 Views

Eduardo Kausel-Fundamental solutions in elastodynamics_ a compendium-Cambridge University Press (2006)

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

212 MATLAB programs<br />

function [] = Cavity3D(r, pois)<br />

% Spherical (3-D) cavity <strong>in</strong> a full, homogeneous space<br />

% subjected to a harmonic/impulsive pressure p<br />

% Arguments:<br />

% r = R/R0 = (distance to receiver)/(radius of cavity)<br />

% pois = Poisson’s ratio<br />

%<br />

% This program assumes p0=1 (unit pressure), and r0=1 (radius of cavity)<br />

% Basic parameters<br />

a2 = (2-2*pois)/(1-2*pois);<br />

a = sqrt(a2); % Cp/Cs<br />

R0 = 1;<br />

% Radius of cavity<br />

R = r*R0;<br />

% Receiver<br />

rho = 1;<br />

% mass density<br />

Cs = 1;<br />

% S-wave velocity<br />

Cp = a*Cs;<br />

% P-wave velocity<br />

mu = rho*Csˆ2; % shear modulus<br />

% Frequency and time vectors<br />

nf = 1024;<br />

wmax = 16*pi;<br />

dw = wmax/nf;<br />

w = [dw:dw:wmax];<br />

tmax = 6;<br />

% maximum dimensionless time<br />

nt = 200;<br />

% No. of time steps<br />

dt = tmax/nt; % time step<br />

T = [0:nt]*dt; % dimensionless, delayed time (= t*Cp/R)<br />

% Response <strong>in</strong> frequency doma<strong>in</strong><br />

fac = 0.25*R0/mu; % assum<strong>in</strong>g p=1 here<br />

w0 = w*R0/Cp;<br />

w1 = w0*r;<br />

G0 = 1+i*w0;<br />

G1 = 1+i*w1;<br />

G = fac*(G0./(G0-0.25*a2*w0.ˆ2)); % Cavity wall at R0<br />

plot(w,real(G));<br />

hold on;<br />

plot(w,imag(G),‘r’);<br />

grid on;<br />

tit = spr<strong>in</strong>tf(...<br />

‘T.F. for pressure <strong>in</strong> spherical cavity, R/R0=%5.4f, \\nu=%5.2f’,...<br />

r, pois);<br />

titx = ‘Frequency (rad/s)’;<br />

title (tit);<br />

xlabel(titx);<br />

H = G.*exp(-i*(r-1)*w0).*G1./G0/rˆ2; %Receiver at R<br />

plot(w,real(H),‘:’);<br />

plot(w,imag(H),‘r:’);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!