Skip to content

Commit

Permalink
minor fixes to docs (#2004)
Browse files Browse the repository at this point in the history
* minor fixes to docs

* add example to plot complex refractive index
  • Loading branch information
oskooi committed Mar 17, 2022
1 parent 15b3c56 commit ea14d10
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 28 deletions.
2 changes: 1 addition & 1 deletion doc/docs/Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Instead, what one does is to accumulate the Fourier transforms $\mathbf{E}_\omeg

$$\tilde{f}(\omega) = \frac{1}{\sqrt{2\pi}} \sum_n e^{i\omega n \Delta t} f(n\Delta t) \Delta t \approx \frac{1}{\sqrt{2\pi}} \int e^{i\omega t} f(t) dt$$ and then, at the end of the time-stepping, computing $P(\omega)$ by the fluxes of these Fourier-transformed fields. Meep takes care of all of this for you automatically, of course — you simply specify the regions over which you want to integrate the flux, and the frequencies that you want to compute.

There are other possible methods of time-series analysis, of course. One method that is sometimes very effective is to construct a [Padé approximant](https://en.wikipedia.org/wiki/Padé_approximant) of the time series of field values at some point, from which one can often extrapolate a very accurate discrete-time Fourier transform (see [IEEE Microwave and Wireless Components Letters, Vol. 11, pp. 223-5, 2001](http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=923035)), including sharp peaks and other resonant features, from a relatively short time series. Meep does not provide a Padé computation for you, but of course you can output the fields at a point over time, ideally in a single-mode waveguide for transmittance spectra via a single point, and compute the Padé approximant yourself by standard methods.
There are other possible methods of time-series analysis, of course. One method that is sometimes very effective is to construct a [Padé approximant](https://en.wikipedia.org/wiki/Padé_approximant) of the time series of field values at some point, from which one can often extrapolate a very accurate discrete-time Fourier transform (see [IEEE Microwave and Wireless Components Letters, Vol. 11, pp. 223-5 (2001)](http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=923035)), including sharp peaks and other resonant features, from a relatively short time series. Meep does not provide a Padé computation for you, but of course you can output the fields at a point over time, ideally in a single-mode waveguide for transmittance spectra via a single point, and compute the Padé approximant yourself by standard methods.

The power $P(\omega)$ by itself is not very useful — one needs to *normalize*, dividing by the incident power at each frequency, to get the transmittance spectrum. Typically, this is done by running the simulation *twice*: once with only the incident wave and no scattering structure, and once with the scattering structure, where the first calculation is used for normalization.

Expand Down
33 changes: 33 additions & 0 deletions doc/docs/Materials.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,37 @@ In Scheme, the materials library is already included when Meep is run, so you ca
(set! geometry (list (make cylinder (material Al) ...)))
```

As a final example, we plot the complex refractive index of SiO$_2$ from the materials library over the visible wavelength range of 400 nm to 700 nm.

```py
from meep.materials import SiO2
import numpy as np
import matplotlib.pyplot as plt

wvl_min = 0.4 # units of μm
wvl_max = 0.7 # units of μm
nwvls = 21
wvls = np.linspace(wvl_min, wvl_max, nwvls)

SiO2_epsilon = np.array([SiO2.epsilon(1/w)[0][0] for w in wvls])

plt.subplot(1,2,1)
plt.plot(wvls,np.real(SiO2_epsilon),'bo-')
plt.xlabel('wavelength (μm)')
plt.ylabel('real(ε)')

plt.subplot(1,2,2)
plt.plot(wvls,np.imag(SiO2_epsilon),'ro-')
plt.xlabel('wavelength (μm)')
plt.ylabel('imag(ε)')

plt.suptitle('SiO$_2$ from Meep materials library')
plt.subplots_adjust(wspace=0.4)
plt.show()
```

<center>
![SiO2 from the materials library](images/SiO2_materials_library.png)
</center>

**Note:** for narrowband calculations, some of the Lorentzian susceptibility terms may be unnecessary and will contribute to consuming more computational resources than are required (due to the additional storage and time stepping of the polarization fields). Computational efficiency can be improved (without significantly affecting accuracy) by removing from the material definitions those Lorentzian susceptibility terms which are far outside the spectral region of interest. In addition, when using the materials library the Courant parameter may need to be reduced to achieve meaningful results, see [Numerical Stability](Materials.md#numerical-stability).

0 comments on commit ea14d10

Please sign in to comment.