Questions about near-field calculations

45 views
Skip to first unread message

zhengxin song

unread,
May 15, 2023, 2:39:30 AM5/15/23
to Smuthi
Dear all:

When I calculate the near field of particles on a substrate, for a substrate with absorption, my program comes up with a warning like the one below.
error.jpg
Not only is the total electric field not calculated, but even the incident electric field is not calculated. How can I modify the program to calculate the near-field distribution correctly?

I would be very grateful if I could get some help.

Best regards,
Song Zhengxin
Etot_y.jpgEtot.jpgEinit.jpg


near field.py

Amos Egel

unread,
May 15, 2023, 5:37:25 AM5/15/23
to zhengxin song, Smuthi
Dear Zhengxin,

as a quick fix that allows you to properly see the fields, I recommend to set zmin to a lerger value in the show_near_field command. You can set for example zmin=-0.2.

As an alternative, it might also help to play around with the vmin / vmax options of the graphical output (I haven't checked that).

Some explanation:
The underlying problem is a numerical inaccuracy in the transfer matrix (or, scattering matrix) scheme for plane wave propagation in stratified media which produces wrong fields when we go deeper into the absorbing bottom layer.

The initial field illumination is from op, so in the bottom layer we actually have only a downwards propagating component. Numerically, the upwards propagating component is, however, computed to ~10^-17, i.e., we have a tiny numerical error in the up-propagating component.
That small error is then tremendeously amplified, because the bottom layer has a strong absorption. Downward propagating waves in the bottom layer are damped with a factor exp(a * z), where a is a large number. So, towards negative z, the wave quickly decays. The upwards propagating wave has a factor exp(-a * z), so towards negative z, the wave quickly grows. In reality, that component doesn't exist, but as I said, there is a small contribution here due to a numerical error. As a consequence, we have a (wrong) field contribution of ~10^-17 * exp(-a * z) that becomes significant after some distance in the negative z and then dominates the whole plot.

Please give me a quick reply if updating zmin to a value that is not too far in the negative is a good option for you. Otherwise we can work out another fix that involves manually suppressing the wrong upgoing field components in the bottom layer.

Best regards, Amos





--
Smuthi project repository: https://gitlab.com/AmosEgel/smuthi
Online documentation https://smuthi.readthedocs.io/en/latest/
---
You received this message because you are subscribed to the Google Groups "Smuthi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smuthi+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smuthi/662f45cb-7c17-4b7f-b805-502c3ee4aeb7n%40googlegroups.com.

zhengxin song

unread,
May 15, 2023, 10:02:53 AM5/15/23
to Smuthi
Dear Amos,

Your method is working! Here is the electric field diagram I calculated. Thank you very much for your help!

Best regards,
Zhengxin
Figure_5.jpg

Reply all
Reply to author
Forward
0 new messages