% Book: Laser Electronics by Verdeyen
% Problem: Chapter 5 problem 4b
% Script Author: meg noah meg_noah@student.uml.edu
function Lasers_Ch5_Pr4b
textsize = 10;titlesize = 14;axissize = 12;
pi = 4.0*atan(1.0);
nx=200;d=0.5;R=20.0;L=632.8e-9;dmax=3.0*R/2.0;
z = zeros(nx);for i = 1:nx;z(i) = dmax*i/(nx)-dmax/2;end;
z0 = 4.0*sqrt(3)*R;z02=48*R^2;
w = 1000.0*sqrt((L*z0/pi)*(1+(z.^2)/z02));
axes('fontsize',axissize,'position',[.15 .19 .81 .7]);
ifigure = 1;figure(ifigure);cla;
title(['R=20m d=30 \lambda_0=632.8 nm'], ...
       'fontsize',titlesize);
ylabel('Spot Size [mm]','fontsize',titlesize);
xlabel('z [m]','fontsize',titlesize);hold on;
h1=plot(z,w,'color',[0 0 .7]);
