Hello,
To compute transmission spectra, I recently tried two approaches that
came to two different results.
The first approach is the standard way using flux planes as given in the
meep examples on the webpage.
In the second approach, I store the time data for points in a plane in
front of the scatterer. I also do the same for a free space simulation.
Then, using MATLAB, I analyze the transforms of the time data as
follows:
- Matlab snippet
fstart = 195 * 1e12 / 3e8 / 1e6; % convert to meep units
fstop = 330 * 1e12 / 3e8 / 1e6; % convert to meep units
fcen = (fstart + fstop)/2;
samplerate = 1/fcen/50; % field sampled at this rate in at-every
dt = samplerate*1e-6/3e8;% convert time back into physical units
% the following data comes from h5 files outputted by meep
EN = fft(noscat_ez); % Ez values along plane without scatterer
ES = fft(scat_ez); % Ez values along plane with scatterer
HN = fft(noscat_hx); % Hx values along plane without scatterer
HS = fft(scat_hx); % Hx values along plane with scatterer
POWS = real( sum(conj(ES - EN) .* (HS - HN) , 2)); % Scattered power
POWN = real( sum(conj(EN) .* HN , 2)); % Incident power
POW = POWS ./ POWN; % Reflectivity
f = (1/dt)/2*linspace(0,1,length(ES)/2+1);
plot(f,-POW(1:floor(length(POW)/2+1)),'k');
-
The attached plot shows a comparison of the two reflection spectra.
There is an strong frequency shifting/scaling present. This is
unrelated to the resolution of the simulation.
This may be related to a previous unresolved discussion:
http://www.mail-archive.com/meep-discuss@ab-initio.mit.edu/msg02073.html
http://www.mail-archive.com/meep-discuss@ab-initio.mit.edu/msg00456.html
Previously Prof. Johnson wrote
When the pulse is this wide (in frequency), you can observe a
computational detail: Meep's Gaussian pulse is not actually precisely a
Guassian, it is the derivative of a Gaussian (this ensures that there is
no net charge left in the computational cell after the pulse is gone,
which prevents divergences in some cases with periodic boundaries). The
difference between the two is small except for very broad Gaussians in
frequency (short pulses in time).
Because the main reason to use a short pulse is to get a broad-spectrum
response, and you have to normalize such a response by the input
spectrum anyway as explained in the manual, the exact shape of the
spectrum shouldn't actually matter.
As we can see in my example above, the normalization doesn't cure the
problems caused by a shifting in the spectra (at least not in my matlab
processing of the time data).
I'm not sure if this is a bug in meep or if there's something I don't
understand in the processing of the time data.
Best Regards,
Matt
e2.png
Description: Binary data
___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss