HomerReid / scuff-em

A comprehensive and full-featured computational physics suite for boundary-element analysis of electromagnetic scattering, fluctuation-induced phenomena (Casimir forces and radiative heat transfer), nanophotonics, RF device engineering, electrostatics, and more. Includes a core library with C++ and python APIs as well as many command-line applications.
http://www.homerreid.com/scuff-em
GNU General Public License v2.0
125 stars 50 forks source link

Simulating weak scatterers #121

Closed davidkleiven closed 7 years ago

davidkleiven commented 7 years ago

Hi,

I am interested in simulation weak scatterers with refractive index around n=0.99999. To test the code I am simulating scattering from a sphere and comparing with the Mie scattering results. However, it works fine for the cases n=0.999 and n=0.9999, but when I try with 0.99999 the results deviate much more from the exact solution. I have tried refining the mesh, but it does not seem to help much. Is there a limit on how small differences in refractive index scuff-em can handle? If so, where does it come from?

Thanks in advance.

HomerReid commented 7 years ago

I haven't ever considered objects with such weak dielectric contrast. If n differs from 1 by one part in 10^5, then \epsilon differs from 1 by one part in 10^10, so we are effectively wasting 10 out of the 15 digits available for storing numbers in standard 64-bit floating-point registers, and there are many places in which numerical inaccuracies could then arise.

You might try your calculations in my volume-integral solver, BUFF-EM, which works explicitly with the quantity \epsilon-1 and may yield better results for ultra-low index-contrast materials.

http://homerreid.github.io/buff-em-documentation

davidkleiven commented 7 years ago

Thanks for the answer, numerical precision was my first thought as well I just wanted to check if it could be due to something else. I will check out BUFF-EM. I will close the issue.

A tiny detail: I don't think the argument that epsilon differs from 1 by one part in 10^10 is correct. If n = 0.99999 and epsilon = n^2 = 0.99998 it differs from 1 by 2 parts in 10^5. Anyway, it does not change the answer.

HomerReid commented 7 years ago

You're right---my mistake.