Computational Electromagnetics with MEEP Part 1: Getting Started

Lesson 2: Dealing with Units in MEEP


MEEP Length vs. SI Length

Phycisists like to be clever. While this is great for the physicsts, it can be endlessly annoying for the student or engineer trying to parse their cleverness. One clever thing the designers behind MEEP did was refuse to enforce a length scale, leaving that up to the user. Are you entering your length in terms of microns? Millimeters? Yards? Football fields? MEEP doesn't care. This is pretty nice once you get a feel for it, and it's ubiquitous in the field of photonics. Buuut it's pretty annoying if you've never seen it before.

So, what does this actually mean in terms of using the software? It means, before you do anything, you must choose your characteristic length, \(a\). This can be a unit, like \(\mu m\), or it can be a convenient length, like the side length of a device, or the thickness of a thin film. You will then enter all the distances in terms of this characteristic length (don't worry, we'll go through examples). In math speak, if \(x\) is a particular length you are interested in entering, and \(x_{MEEP}\) is the length you actually type into the software, then:

\(x_{MEEP} = \frac{x}{a} \)

Let's try a couple of examples.

Say you choose your characteristic length \(a\) to be 1 \(\mu m\). Your device dimensions are \(10 \mu m\) by \(3.5 \mu m\). What dimensions would you enter into MEEP?





You have a device that measures 0.57 mm by 1.14 mm by 2.28 mm. What is the characteristic length \(a\) that makes the lengths you enter into MEEP 1, 2, and 4?





Time, Frequency in MEEP

MEEP does another clever thing, also common in photonics in particular and physics more broadly, and that's to set the speed of light \(c=1\). Or, if you're an engineer and that makes you feel uncomfortable (it makes me queasy), you can instead think of creating a new variable (let's call it \(t_{MEEP}\) which is just regular time multiplied by \(c/a)\) to make it unitless. It just becomes normalized time. In math, that just means that the time displayed by MEEP \(t_{MEEP}\) in terms of the time \(t\) in seconds and the characteristic length \(a\) is just:

\(t_{MEEP} = t * \frac{c}{a} \)

Since time is multiplied by \(c/a\), anything with units of frequency better get multiplied by \(a/c\), and so the frequency we enter into meep \(f_{MEEP}\) in terms of the actual frequency \(f\) (in Hz) is:

\( f_{MEEP} = f * \frac{a}{c} = \frac{a}{\lambda_0}\)

This actually makes entering frequency extremely convenient (at least if you are comfortable using wavelength, denoted here as \(\lambda_0\), the 0 just means free space), because the frequency we enter is just our characteristic length \(a\) divided by the free-space wavelength. OK, let's do a couple examples to get the hang of it.

Suppose you want to simulate a plane wave in free space of frequency 150THz, and your characteristic length a is 1 micron. What frequency would you enter in MEEP?






Suppose that MEEP tells you the time is 4 units, and you know the characteristic length is 3mm. What is the time in seconds?






Summary

MEEP uses unitless quantities for length, time, and frequency, and these are summarized by the following three equations, where \(c\) is the speed of light, \(a\) is your chosen characteristic length, \(x\) is the physical distance, \(t\) is the physical time, \(f\) is the physical frequency, and \(\lambda_0\) is the wavelength in free space:

\(x_{MEEP} = \frac{x}{a} \)

\(t_{MEEP} = t * \frac{c}{a} \)

\( f_{MEEP} = f * \frac{a}{c} = \frac{a}{\lambda_0}\)




If you found this content helpful, it would mean a lot to me if you would support me on Patreon. Help keep this content ad-free, get access to my Discord server, exclusive content, and receive my personal thanks for as little as $2. :)

Become a Patron!