Science programming

Multilayer thin film optics calculator: Click here

This is a Python (NumPy) program I wrote that uses the Fresnel equations and transfer-matrix method to calculate transmission and reflection from multilayer thin films. (Thick films are also OK.) It also calculates the Poynting vector and the absorbed energy density as a function of depth, as well as the parameters (ψ and Δ) measured in ellipsometry. Here is the manual with installation instructions. I explain the formulas in this paper on arxiv. (If this program doesn't have the features you like, here is my list of other programs with similar / overlapping functionality.)

Units package for Python: Click here

This is a Python package I wrote to deal with units and dimensional analysis. It is designed to be compatible with all numerical calculation routines, even those using specialized non-Python code like FORTRAN libraries etc.

Units package for Mathematica: Click here for Mathematica notebook

This is a Mathematica package I wrote long ago to deal with units and dimensional analysis in Mathematica. It has a similar design to the Python one. Again, it is designed to be compatible with everything, even numerical operations like FindRoot and NIntegrate. Click the link and open the notebook in Mathematica for information on how to install and use it. [If you are not using FindRoot or NIntegrate, I suggest the Automatic Units package or Mathematica’s built-in unit package instead.]

Python program to calculate equilibrium semiconductor band diagrams: Click here

This program solves the Poisson-Boltzmann Equation via finite differences, for planar multilayer semiconductor stacks.

Javascript photon conversion calculator: Click here

This is a little javascript tool I made to convert between light frequency, wavelength, wavenumber, photon energy, etc.

Python program to calculate surface plasmon polariton modes in planar multilayers: Click here

This program calculates SPP modes, or more generally any transverse-magnetic (TM) mode, at a planar interface, or in a stack of arbitrarily many layers, including magnetic and anisotropic materials.

MATLAB FROG algorithm: Click here

This is a set of MATLAB programs for processing and analyzing “Frequency-Resolved Optical Gating” (“FROG”) measurements. FROG is a technique for measuring laser pulses. To analyze the data, you have to do a sort of multidimensional optimization. The algorithm is from the literature, although I invented some variations on the algorithm that I found worked better–at least, they worked better for my data.

LAMMPS source-code modification for outputting electric fields: Click here

I needed to know the local electric fields in a LAMMPS molecular dynamics simulation. This requires some modification of the LAMMPS source code. I wrote up the procedure nicely in case anyone else needs to do this.

Simple little Python program to calculate sides and angles of triangles: Click here

using the Law of Sines and Law of Cosines, as we all learned in grade school geometry.