FILMS demonstrates thin-film coatings

$$\mathcal{M}_m = \pmatrix{\cos{n_mk_ms_m} & -
\frac{i}{n_m}\sin{n_mk_ms_m} \cr
       -in_m\sin{n_mk_ms_m} & \cos{n_mk_ms_m} \cr} $$

$$\mathcal{M} = \mathcal{M}_1 \mathcal{M}_2 %%

$$\mathcal{M} =
\pmatrix{A & B  \cr C & D  \cr} $$

$$\rho = \frac{An_0 + Bn_tn_0 - C - Dn_t}{An_0 + Bn_tn_0 + C + Dn_t} $$

by Chuck DiMarzio Northeastern University May 2009

!! This file may be copied, used, or modified for educational and
!! research purposes provided that this header information is not
!! removed or altered, and provided that the book is cited in
!! publications, as DiMarzio, Charles A., Optics for Engineers,
!! CRC Press, Boca Raton, FL, 2011.
!! http://www.crcpress.com
!! Other distribution is prohibited without permission.

Contents

Set up parameters

lambda=(250:10:2500)*1e-9;  % meters, Wide bandwidth to see what happens
lambdadesign=500e-9;        % Design wavelength
n0=1;                       % Start in air
ncoating=1.35;              % Magnesium fluoride
nt=1.5;                     % Nominal glass value
kdesign=2*pi./lambdadesign;
s=pi/2/kdesign/ncoating;    % Quarter wave coating
%

Compute Reflection as a function of wavelength

rho=zeros(size(lambda));
for nlambda=1:length(lambda);
  k=2*pi/lambda(nlambda);
  m=[cos(ncoating*k*s),1i/ncoating*sin(ncoating*k*s);...
     1i*ncoating*sin(ncoating*k*s),cos(ncoating*k*s)];
  A=m(1,1);B=m(1,2);C=m(2,1);D=m(2,2);
  rho(nlambda)=(A*n0+B*nt*n0-C-D*nt)/(A*n0+B*nt*n0+C+D*nt);
end;

Repeat for ideal coating

$$n = \sqrt{n_t}$$

ncoating1=sqrt(nt);
s1=pi/2/kdesign/ncoating1;  % Quarter wave coating
rho1=zeros(size(lambda));
for nlambda=1:length(lambda);
  k=2*pi/lambda(nlambda);
  m=[cos(ncoating1*k*s1),1i/ncoating1*sin(ncoating1*k*s1);...
     1i*ncoating1*sin(ncoating1*k*s1),cos(ncoating1*k*s1)];
  A=m(1,1);B=m(1,2);C=m(2,1);D=m(2,2);
  rho1(nlambda)=(A*n0+B*nt*n0-C-D*nt)/(A*n0+B*nt*n0+C+D*nt);
end;

Plot results

fig1=figure;plot(lambda*1e9,abs(rho).^2,'-',...
                 lambda*1e9,abs(rho1).^2,'--');grid on;
xlabel('\lambda, Wavelength, nm');
ylabel('R, Reflectivity');
legend('MgFl','Perfect','Location','SouthEast');