Skip to content

navlalli/colour-soap-films

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DOI

The interference colours of soap films

This project shows how the colours exhibited by illuminated soap films can be found by applying an interference relation derived for monochromatic waves at a discrete number of wavelengths in the light source. Coherence effects on the interference colours of soap films discusses this method and its expected range of validity. All variables and equations implemented in src/interference.py are detailed in Coherence effects on the interference colours of soap films.

The examples in src may be run using python with a conda environment created from conda-env.yml:

conda env create -f conda-env.yml

All tests can be checked by running pytest from the command line.

Examples

Blackbody radiator

src/example_blackbody.py shows how soap film interference colours may be calculated when the light source is a blackbody radiator of specified temperature. This calculation considers an infinite number of interfering waves. A fully vectorised implementation is provided in addition to a non-vectorised implementation. The non-vectorised method is more explicit, whilst the vectorised approach is significantly faster. The scaled spectral distribution of the light source and the resulting interference colours are shown for blackbodies of temperatures 3500 K, 6500 K and 9500 K:

Source Colour-thickness
3500 K 3500 K
Source for 3500 K Thickness-colour for 3500 K
6500 K 6500 K
Source for 6500 K Thickness-colour for 6500 K
9500 K 9500 K
Source for 9500 K Thickness-colour for 9500 K

Daylight

src/example_daylight.py presents how the interference colours of a soap film may be calculated when the soap film is illuminated by daylight. This was done by using the D65 illuminant to represent daylight. Here, the coloured fringes are more widely spaced apart due to the larger value used for theta_air:

Source Colour-thickness
Source for daylight Thickness-colour for daylight

Gaussian source

src/example_gaussian.py shows how the interference colours of a soap film may be calculated when the spectral distribution of the light source (source_sd) is specified by defining the numpy array through a calculation. The following shows the interference colours calculated when the light source has a Gaussian or double Gaussian spectral distribution:

Source Colour-thickness
$\overline{\lambda} = 440$ nm $\overline{\lambda} = 440$ nm
Gaussian source with mean wavelength at 440 nm Thickness-colour for Gaussian source with mean wavelength at 440 nm
$\overline{\lambda} = 550$ nm $\overline{\lambda} = 550$ nm
Gaussian source with mean wavelength at 550 nm Thickness-colour for Gaussian source with mean wavelength at 550 nm
$\overline{\lambda} = 660$ nm $\overline{\lambda} = 660$ nm
Gaussian source with mean wavelength at 660 nm Thickness-colour for Gaussian source with mean wavelength at 660 nm
$\overline{\lambda} \in \lbrace 440, 550 \rbrace$ nm $\overline{\lambda} \in \lbrace 440, 550 \rbrace$ nm
Sourced comprised of the sum of two Gaussians, centred at 440 and 550 nm Sourced comprised of the sum of two Gaussians, centred at 440 and 550 nm
$\overline{\lambda} \in \lbrace 440, 660 \rbrace$ nm $\overline{\lambda} \in \lbrace 440, 660 \rbrace$ nm
Sourced comprised of the sum of two Gaussians, centred at 440 and 660 nm Sourced comprised of the sum of two Gaussians, centred at 440 and 660 nm

Journal articles

An adapted version of this code was used in The stability of magnetic soap films and Coherence effects on the interference colours of soap films.

License

This code is distributed under the MIT License.