% ***********************************************************************
% quartz.m
% ***********************************************************************
%
% Data description:
% Real refractive index of quartz (200-1000nm)
% Prepared by: Mark Iwanchyshyn and Gladimir Baranoski on April 2019
%
% ***********************************************************************
% 
% Original data source:
%
%   W.J. Tropf and M.E. Thomas, “Properties of Crystals and Glasses” 
%   (Table 23, alpha-SiO2 quartz, ordinary ray) in Handbook of Optics
%   (Volume IV: Optical Propertis of Materials, Nonlinear Optics, 
%   Quantum Optics), M. Bass, C.M. DeCusatis, V. Lakshminarayanan, 
%   G. Li, C. MacDonald, V.N. Mahajan and E.V. Stryland, eds., 
%   pp. 2:1–93, Optical Society of America, McGraw-Hill, Inc., New York,
%   USA, 2010. Chapter 2.
%
%   Usage range recomended by the source: 180-710 nm.
%
%   Graph generated using Matlab 2014a
% ***********************************************************************
clear all

A = [0.663044, 0.517852, 0.175912, 0.565380, 1.675299];
B = [0.060, 0.106, 0.119, 8.884, 20.742];

% arbitrarily chosen wavelengths, selected to match the 
% the spectral resolution considered in the Splits simulations
wave = 200:5:1000;


fid=fopen('quartz.txt','wb');

for i=1:length(wave)
    
    % w2 is wavelength squared, in micrometers (not nm)
    w2 = (wave(i)/1000.0)^2;
    
    aux=0;
    for j=1:5
        aux=aux+(A(j)*w2)/(w2-B(j)^2);
    end
    data(i)=sqrt(aux+1.0);
    
    fprintf(fid,'%d  %3.4g \n',wave(i),data(i));
end
fclose(fid);


plot(wave,data,'b-','linewidth',3);
axis([min(wave) max(wave) 1.5 1.7]);
set(gca,'FontSize', 14);
grid on
title('Quartz','fontsize',14)
ylabel('refractive index','fontsize',14);
xlabel('wavelength (nm)','fontsize',14);
set(gcf,'PaperUnits','inches','PaperPosition',[0 0 6 5]);
pause
print('-dpng', '-r100','quartz.png');
close 
   



