- /
-
Rotor Acoustic Interference (Intensity)
on 13 Oct 2024
- 37
- 286
- 0
- 3
- 860
Cite your audio source here (if applicable):
drawframe(1);
Write your drawframe function below
function drawframe(f)
x=([0:1/1024:1-1/1024]-0.5)*2*10;
y = x;
[X,Y] = meshgrid(x,y);
Z=X.*0+1.0;
%rotor parameters
xr=[-1,1,0,0]*2;
yr=[0,0,1,-1]*2;
zr0=[0,0,0.1,-0.1];
phr=[pi/2,0,0,0];
ar=[1.0,1.0,1.0,1.0];
nr=[1,1,-1,-1]*13;
k= 4.0;
fps=24;
dt=0.04;
tmax = 4;
tfinal = tmax*fps*dt;
time = [0:dt:(tfinal)];
t = time(f);
p=X*0;
Z=2;
phr(1)=phr(1)+4*pi*t/tfinal;
zr=zr0+35-k/2*cos(t/tfinal*pi*2);
%loop through rotors and compute complex pressure
for(j=1:length(xr))
d2=(xr(j)-X).^2+(yr(j)-Y).^2+(zr(j)-Z).^2;
d=sqrt(d2);
d2ref=(xr(j)-X).^2+(yr(j)-Y).^2+(zr(j)+Z).^2;
dref=sqrt(d2ref);
ph=atan2(xr(j)-X,yr(j)-Y)*nr(j)+phr(j)-t/tfinal*2*pi*8;
th=-asin((zr(j)-Z)./d);
thref=-asin((zr(j)+Z)./d);
p=p+(cos(th).^2).*ar(j).*exp(k*1i*2*pi*(d)+1i*ph)./d;
p=p+(cos(thref).^2).*ar(j).*exp(k*1i*2*pi*(dref)+1i*ph)./dref;
end
persistent fig h
if isempty(fig)
fig = figure('Color', 'black');
ax = axes('Parent', fig);
h = imagesc(ax, -log10(abs(p)+0.0005) );
axis off;
colormap(bone)
%colormap([0.45*colormap(hot)+0.55*colormap(pink);flipud(0.55*colormap(bone)+0.45*fliplr(colormap(hot)))]);
axis square;
end
h.CData= -log10(abs(p)+0.0005)
%h.CData = atan2(real(p),imag(p));
drawnow
end
Movie
Audio
This submission does not have audio.