Updated 07 Jul 2016
Transfer Matrix Method is a commonly used tool in Optics. Here it is applied to a dielectric stack. Redheffer star product is used to combine scattering matrices of different layers. At the end for a range of wavelength , I plot transmittance and reflectance spectrum. I have referred the following links to make this code.
Ref (1): http://emlab.utep.edu/ee5390cem.htm
Sathyanarayan Rao (2020). Transmittance and Reflectance Spectra of Multilayered Dielectric Stack using Transfer Matrix Method (https://www.mathworks.com/matlabcentral/fileexchange/47637-transmittance-and-reflectance-spectra-of-multilayered-dielectric-stack-using-transfer-matrix-method), MATLAB Central File Exchange. Retrieved .
Jack Blauert is right. The Reflection Scattering matrix and the initialization of the Sg haven't been included in the loop iterating over different wavelengths. Simple Cut-Paste fixes the problem.
The code is wrong
Very well code. But how to update this code if I want to calculate one layer with complex permittivity as a function of wavelength? Thanks!
very well,thanks a lot.It is very useful for me to study the Transmission Matrix Method with MATLAB!!!
codes maybe are wrong for changing the range of wavelength
The reason the code doesn't work is that the global scattering matrix is not being reset for each wave vector. You can fix this by moving the wave vector loop to include setting the global scattering matrix to the reset values.
Code is wrong! change wavelength step or range youll see
Hi, I would like to know if its possible to have complex permittivities for each layers.
Values change for same wavelength when changing wavelength steps.
Complex permittivy are OK ?
Are you sure about the position of the Lambda loop? I do your code the scatering matrices are updated more often than they should and you get a different refelctance for the same wavelength if you just change the section. 100nm to 130nm looks a lot different than 90 to 130nm. Is is consistent you think?
Thanks a lot and kind regards
A sign error in line 115 is corrected from X=expm(-Om*k0(q)*L(i)) to X=expm(Om*k0(q)*L(i));