0

I'm attempting to validate my FDTD optics simulator results.

Visually, I can see that my output is nearly identical to that produced by Meep, the only difference being a slight phase shift. Using a point source in the middle of a 1k+1 by 1k+1 domain, I can place the image produced by my code next to that produced by Meep, and they appear to be part of the same simulation (in the 2D case).

Meep on the left, my code on the right

(Ez field from a 2D TMz simulation, PML disabled)

However, for my thesis, I need a way to numerically validate my results, using Meep as a benchmark (though I would welcome suggestions for a better package).

(For simplicity's sake, I'm only considering the 2D, Hx/Hy/Ez case here, with the Ez output field pictured above.)

It's been suggested that I:

  1. Calculate a Poynting vector field for both Meep's and my output
  2. Compensate for scaling by finding max/min for each, and scaling the data so that they cover the same domain
  3. Integrate (?) and calculate the difference

I am told that analyzing the Poynting vector field, rather than the raw Ez data, should eliminate the phase difference.

I've been through Taflove's FDTD bible, but haven't found anything that applies to this case (though I may be missing something).

I've been beating my head against the wall on this one for far longer than I care to admit. Any references, example code (C#, C, C++, CUDA, OpenCL, Python, Mathematica, Matlab, etc.) would be invaluable, or any easy-ish-to-follow (as far as emag can be) steps, or, for that matter, any advice.

Edit If this isn't the correct place to ask this question, please point me towards the one that is. This topic falls somewhere on the inside of the math, physics and engineering triangle, though my specific area is electrical engineering.

3Dave
  • 101
  • Have you thought about comparing to a simple, analytical solution such as the Sommerfeld half-plane? You can generate this solution quite easily using Fresnel integral code from, say, Numerical Recipes. This was part of my standard repertoire when I wrote FDTD code. – Ron Gordon Feb 02 '14 at 16:28
  • @RonGordon I've briefly looked at the analytical solution, but, honestly, got a little lost. I'm gradually learning to read papers on this stuff, but it's a skill that's taking time to develop. I'll go-a-Googling. In your opinion, is Numerical Recipes the best place to start researching that? (Honestly, that seems like a better way to go, rather than relying on the correctness of another software package.) – 3Dave Feb 02 '14 at 16:31
  • NR is the best place to learn about issues you come across in basic scientific computing, not really to learn about things like the Sommerfeld solution. If I were you, I would invest the time to understand this solution if at all within your power. In any case, you may profit form the scicomp.SE community: http://scicomp.stackexchange.com – Ron Gordon Feb 02 '14 at 16:34
  • @RonGordon Awesome - thanks for the advice. I'm a software guy from way back that decided to go down the EE path in school, which worked very well until I hit a road block with my master's thesis. Source code is easier for me to read and absorb than formal math. I'll post future questions on scicomp. – 3Dave Feb 02 '14 at 16:37

0 Answers0