Contents

1. Prism Problem

apex_deg=60;
apex=apex_deg*pi/180;
lambda=500e-9; % Meters
lambda_um=lambda*1e6;
% http://refractiveindex.info/?shelf=glass&book=SF10&page=SCHOTT
n=sqrt(1+(1.62153902*lambda_um.^2)./(lambda_um.^2-0.0122241457)+...
    (0.256287842*lambda_um.^2)./(lambda_um.^2-0.0595736775)+...
    (1.64447552*lambda_um.^2)./(lambda_um.^2-147.468793))
deltamin=2*asin(n*sin(apex/2))-apex;
deltamin_deg=deltamin*180/pi % 11945/slides2r3-52
theta1=asin(n*sin(apex/2)); % 11945/slides2r3-52
theta1_deg=theta1*180/pi
n =
    1.7432
deltamin_deg =
   61.2845
theta1_deg =
   60.6423

Calculation for all wavelengths

lambda=[400:100:1500]*1e-9;
lambda_um=lambda*1e6;
% http://refractiveindex.info/?shelf=glass&book=SF10&page=SCHOTT
n=sqrt(1+(1.62153902*lambda_um.^2)./(lambda_um.^2-0.0122241457)+...
    (0.256287842*lambda_um.^2)./(lambda_um.^2-0.0595736775)+...
    (1.64447552*lambda_um.^2)./(lambda_um.^2-147.468793));
sintheta1prime=sin(theta1);
sintheta2prime=sqrt(n.^2-sin(theta1)^2)*sin(apex)-...
               sintheta1prime*cos(apex);  % 11945/slides2r3-51
theta2prime=asin(sintheta2prime);
delta=theta1+theta2prime-apex;  % 11945/slides2r3-51
figure;plot(lambda*1e9,delta*180/pi,'-o');grid on;
xlabel('\lambda, Wavelength, nm');
ylabel('\delta, Deviation, deg');
%
clear;

2. Negative Lens Problem

f=-1; % Focal length in m
s=[2:40];
sprime=1./(1/f-1./s); % sprime is always negative:  Virtual image
figure;plot(s,sprime);grid on; % Image distance
xlabel('s, Object Distance, m');
ylabel('s'', Image Distance, m');

Magnification

m=-sprime./s;m_z=-m.^2; % m_z is ds'/ds
figure;plot(s,m,'b-',s,m_z,'g--');grid on; % Magnification
xlabel('s, Object Distance, m');
ylabel('m, m_z, Magnifications');
legend('m','m_z');
% At least 3:1 compression in the z direction, getting worse with
% increasing distance.

clear;

3. Scanner Problem

stop diameter NA = sin(theta)

M=10;NA=0.53;
ftube=160;
fobjective=ftube/M;
theta=asin(NA);d_pupil=2*fobjective*tan(theta)
%
% FOV !!! Oops.  That 20 should have been mm, not cm.  That's an
% insanely large field stop for a microscope.
d_fieldstop=20;
FOV=d_fieldstop/M
d_pupil =
   20.0001
FOV =
     2

Scanning part

fs=1:200; % Focal length of scanner lens
thetad=atand(d_fieldstop/2./fs); % Need to scan +/- this angle
dpupil_at_mirror=d_fieldstop*fs/ftube;
figure;plot(dpupil_at_mirror,thetad);
grid on;
xlabel('Diameter at Scanner');
ylabel('Scan Half Angle, Deg.');
% Pick 20 degrees and about 3.44 mm diameter

Find the fs needed

figure;plot(fs,thetad);
grid on;
xlabel('f_s, Focal Length of Scanner Lens, mm');
ylabel('Scan Half Angle, Deg.');
% For this, f_s = 27.5 degrees (from plot)

clear;

4. Aberrations

f1=0.05;f2=0.50;d1=f1/5;d2=f2/5; % Use meters
s=1000;m=-f2/f1;
sprime=-(f2/f1)^2*s-f1*m*(1+m)
% Further away because we are using the telescope "backward"
%
% For lens 1, object distance is large and image is near the focus, so
% use a plano-convex with the convex side toward the object.  For lens
% 2, the object is near the front focus and the image is far, so use
% another plano-convex lens, but put the convex side toward the
% object.  The plane sides of the lenses are toward each other.
% One of the principal planes is at the convex side, and the other is
% one third the thickness away.
th1=5e-3;th2=2e-2;
% Distance between principal planes should be sum of focal length.
% Distance between vertices is
z_v1prime_v2 = f1+f2-th1*2/3-th2*2/3
sprime =
  -1.0000e+05
z_v1prime_v2 =
    0.5333

Spherical aberration

n=1.5;
p1=-1;q1=1;p2=1;q2=-1; % 11945/slides5r1-28
ls1=(d1/2)^2/8/f1^3*1/(n*(n-1))*...
    ((n+2)/(n-1)*q1^2+4*(n+1)*p1*q1+(3*n+2)*(n-1)*p1^2+n^3/(n-1));
ls2=(d2/2)^2/8/f2^3*1/(n*(n-1))*...
    ((n+2)/(n-1)*q2^2+4*(n+1)*p2*q2+(3*n+2)*(n-1)*p2^2+n^3/(n-1));
ls=ls1+ls2 % Total spherical aberration in diopters
equivalent_focal_length=1/ls
ls =
    0.2567
equivalent_focal_length =
    3.8961

Alternative Configuration

Now the image from the first lens (and object for the second) are at infinite distance. The original object and final image are close. Therefore we should place the lenses with convex sides toward each other. Then

z_v1prime_v2 = f1+f2
%
% Both p and q reverse signs.

p1=1;q1=-1;p2=-1;q2=1; % 11945/slides5r1-28
ls1=(d1/2)^2/8/f1^3*1/(n*(n-1))*...
    ((n+2)/(n-1)*q1^2+4*(n+1)*p1*q1+(3*n+2)*(n-1)*p1^2+n^3/(n-1));
ls2=(d2/2)^2/8/f2^3*1/(n*(n-1))*...
    ((n+2)/(n-1)*q2^2+4*(n+1)*p2*q2+(3*n+2)*(n-1)*p2^2+n^3/(n-1));
ls=ls1+ls2 % Total spherical aberration in diopters
equivalent_focal_length=1/ls
z_v1prime_v2 =
    0.5500
ls =
    0.2567
equivalent_focal_length =
    3.8961

Just for comparison, the wrong way,

p1=1;q1=1;p2=-1;q2=-1; % 11945/slides5r1-28
ls1=(d1/2)^2/8/f1^3*1/(n*(n-1))*...
    ((n+2)/(n-1)*q1^2+4*(n+1)*p1*q1+(3*n+2)*(n-1)*p1^2+n^3/(n-1));
ls2=(d2/2)^2/8/f2^3*1/(n*(n-1))*...
    ((n+2)/(n-1)*q2^2+4*(n+1)*p2*q2+(3*n+2)*(n-1)*p2^2+n^3/(n-1));
ls=ls1+ls2 % Total spherical aberration in diopters
equivalent_focal_length=1/ls
% four times the aberration
ls =
    0.9900
equivalent_focal_length =
    1.0101