Teaching & Software


Andreas B. Dahlin


This is a personal webpage created by me. It does not necessarily reflect the opinions and policies of the University I am affiliated with.


Copyright ©

Andreas B. Dahlin

Teaching Material

Matlab Programs


This program calculates the transmission, reflection and absorption in an arbitrary thin film multilayer system.

Download the MATLAB file here: TransferMatrix3.m

The figure shows the result generated by the program when run as is. In this case, it generates the far field angular spectrum (670 nm incident light) of a 50 nm gold film on glass in water. The surface plasmon excitation is seen as a dip in the reflection. The simulation also includes a dielectric coating on the gold film (n = 1.4) with different thickness (hence the series of graphs). This can be thought of as a simulation of a plasmonic biosensor system.

The TransferMatrix program can be used to simulate transmission through and reflection from any kind of thin film multilayer - just change the parameters in the beginning of the file! You can also change to a wavelength spectrum at a fixed angle of incidence. If a material is dispersive you should just include a new refractive index calculation in the wavelength loop.

I use the TransferMatrix program to simulate the transmission of light through my thin film multilayers. Although the program naturally does not consider the precense of pores in the layer it still gives a good estimate of peaks and dips due to Fabry-Perot interference and simplifies interpretation of experimental spectra of nanopore arrays.

You are free to use the MATLAB code for any purpose but please cite the reference: J. Junesch, T. Sannomiya, A.B. Dahlin, ACS Nano 2012. The supporting information for this paper describes the calculations.


This program calculates the dispersion relation for transverse magnetic surface waves in an arbitrary thin film multilayer system.

Download the MATLAB file here: SurfaceWavesTM6.m

This program can be user configured as the transfer matrix calculations. When used as is, it will calculate the dispersion relation of hybridized surface plasmon modes in a metal-insulator-metal system (20 nm Au on both sides of a 50 nm n = 2.24 dielectric in air). The figure below shows the results of solving for the higher energy hybridized bonding mode. The plots generated are for dispersion, propagation length and fields. (The magnetic field gives a 1D plot for TM modes while the electric field is more complicated to visualize since it has two components.)

The algorithm solves the equations by finding the real and imaginary parts of the k vector by minimization. The program starts with generating a plot of the numerical residual for different values of the k initial guess. You should click in the plot at a location where you see a minimum. Different minima correspond to different modes.

You are free to use the MATLAB code for any purpose but please cite a suitable reference like: A.B. Dahlin, M. Mapar, K. Xiong, F. Mazzotta, F. Höök, T. Sannomiya, Advanced Optical Materials 2014. The supporting information for this paper describes the calculations in detail.

Fysikingenjörens Verktyg (TIF275)

Mitt främsta bidrag till kursen är att jag gjorde det mesta av arbetet med att utveckla de så kallade Universeumprojekten. Studenterna ska i grupper arbeta med att förstå och beskriva i text fysiken bakom något fenomen man kan komma i kontakt med på Universeum, Skandinaviens största "science center".

Här finns beskrivningar till Universeumsprojekten 2014: Universeumprojekt