%circsource %Circle source initial condition for angular spectrum code % %Call asprop.m after running this script %Written by Robin Cleveland, Boston University %ME720, Acoustics 2 clear all %clear all variables close all %close all figure windows %%%%%%%%%%% %USER INPUT %%%%%%%%%%% %Physical parameters for source f=2e6; %frequency a=1.5e-3; %radius c0=1500; %sound speed %Attenuation alpha=2.5e-14*f.^2; %water alpha=0; %Grid Size lenx=512; xmax=15*a; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %CALCULATIONS START FOR SOURCE CONDITION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Rayleigh distance and wavenumber k=2*pi*f/c0; ka=k*a zrayl=0.5*ka*a %x and y spatial vectors xvec=linspace(-xmax,xmax,lenx)'; yvec=xvec'; leny=length(yvec); %Create spatial array with source velocity condition rsq=(xvec.*xvec)*ones(size(yvec))+ones(size(xvec))*(yvec.*yvec); %distance from origin squared Usxy=double(rsq<=(a*a)); %Usxy is unity for all points with radius less than a %Plot source condition figure(1); imagesc(abs(Usxy)); title('Velocity Source Condition');