stackRT function not working



I’m currently looking at surface plasmon excitation on thin metal films as in the Simple Glass-Silver-Air Slab tutorial. I make no modifications to the supplied .fsp and .lsf files, and yet I am unable to reproduce the theoretical transfer-matrix results in FDTD Solution with the stackRT function. The below image illustrates the problem for a 50nm Ag film illuminated at 500nm.

Has anyone any idea why this may be occurring? I am using FDTD Solutions 8.15.758.
Thank you in advance!


Hi Thomas,

I ran the simulation files with the latest release of FDTD (v.8.15.786) and I was able to reproduce the results shown in the KB page. I would suggest upgrading to the latest version and check if you still see a different result. It is possible that there was some issue in the version you are using.

Let me know if this works for you.



I’m having the same problem as mentioned. I’m currently using the version 8.16.903. What should I do?




I recommend that you check the polarization.

I am using 8.16.966 version and it works correctly.



Sorry for not to be more specific. I’m working with Al and testing for 400 nm incident wavelength. What polarization are you referring? I’m having problems with the stackrt. At 600 nm it works well but at 400 nm no.

Thank you.


Do you know if there is a plasmonic effect to Aluminum at 400 nm? We need to check this first.



I believe there is.


yes, it should exhibit plasmonic effect. the eps is negative

It is most likely a meshing problem. I will check this and get back to you.



I’m attaching the one for Ag as well. My problem is, the stackrt function
is not calculating correctly.

Thank you,



Hello, again.

I’ve done a test with Ag (50 nm). See the results. What do you think?

Thank you,



I see there is a problem with the 400 nm regardless of the metal used which is weird. I will check for the 350 nm now because I want to understand if this happens at wavelengths smaller than 400 nm! Did you check this?

There is a post where the stackrt, or rather the transfer matrix method, had problems calculating the transmission. Have a look and tell me if it is relevant to your case.


I don’t think the problem is the same here. My problem was that R=r.r is no longer valid if the incident medium is absorbing. But in this case, The incident medium is glass or air and the substrate is Air, which is 100% valid.


I tried the simulation for silver at 400 nm and here is the result I got:

The FDTD and theory agree and we need to increase the range to see the dip.

I ran the simulation for the 300 nm too. No resonance probably because at this wavelength the epsilon is around zero.


Hi @mrsdias and @aya_zaki,

I tried the same simulations for lambda=300 and 400nm as @aya_zaki, and I got the same results. The only change I made to the original simulation file in the KB example was changing the center wavelength of the source. The script does not need any change.

@mrsdias, have you made any other changes? For example to the material fit?


@fgomez Yes, I had a question about the material fit. I noticed the example use a specific material fit "copy 1 ". Why is it using such a fit? Is it related to the accuracy of stackrt?



I have not changed anything, just the frequency. Should I change the



Try to download the file again and change the frequency point only. The fitting of silver in the file of the Knowledge base is already good.


Hello. What are the necessary changes you did to optimized the FDTD & theory results. Can you attach the simulation and script file for 450nm, 500nm, 550nm.