I'm try in to simulate a Coronae (diffraction of droplet). There are color depends by wavelength, and intensity depends by diffraction. How can I control both color by wavelength (lambda) and intensity (I) ?
I can only control lambda to have different color of diffraction pattern now.
lambda=400; % wavelength [nm]
a=10e3; % obstruct disc radius [nm](um)
x=linspace(-0.2,0.2,1000);y=x;[X,Y]=meshgrid(x,y);r=sqrt(X.^2+Y.^2);% diffraction pattern
u=2.*pi.*a./lambda;J=besselj(1,u.*sin(r));I=sqrt((u.*((1+cos(r))./2).*(J./sin(r))).^2); % Intensity
% colormap
w=lambda;if (w >= 380) && (w < 440) R = -(w - 440.) / (440. - 380.); G = 0.0; B = 1.0; elseif (w >= 440) && (w < 490) R = 0.0; G = (w - 440.) / (490. - 440.); B = 1.0; elseif (w >= 490) && (w < 510) R = 0.0; G = 1.0; B = -(w - 510.) / (510. - 490.); elseif (w >= 510) && (w < 580) R = (w - 510.) / (580. - 510.); G = 1.0; B = 0.0; elseif (w >= 580) && (w < 645) R = 1.0; G = -(w - 645.) / (645. - 580.); B = 0.0; elseif (w >= 645) && (w <= 780) R = 1.0; G = 0.0; B = 0.0; else R = 0.0; G = 0.0; B = 0.0;endc=[R,G,B]; h=linspace(0,1,256); % illumination (intensity) from [0,1]
for i=1:length(h) S{i}=h(i).*c;endmap=cell2mat(S');% figure
pcolor(X,Y,I); shading flat; axis image; title([num2str(lambda)]);colormap(map);
This is what I'm trying to simulate. (picture from google search)
And this is what I get so far (can change color by wavelength)
Best Answer