Home

Introduction

Contents

Scripts

FeedBack

Date 06/09/2010
Script S1_2_19.m
Download Script S1_2_19.m
%=============================================
%Cavity 2
%=============================================
%
%--------------------------
%initial values in amstrong
%--------------------------
%Lambda
Lambda=6328;
%deviation
dev=0.016;
%distance between the mirrors
d=0.5e+10;
%c in amstrong al secondo
c=3.0e+18;
%the reflexivity r and its square root ep
r=0.95;
%e la sua radice quadrata
ep=sqrt(r);
%
%-----------------------------
%preliminary calculi
%-----------------------------
%the extremes of lambda
minL=(Lambda-dev);
maxL=(Lambda+dev);
deltaL=maxL-minL;
%
%the range of the lambda id divided in max=1000 parts
max=1000;
lambda=linspace(minL,maxL,max);
%
%---------------------------------------
%corrisponding values of the frequencies
%---------------------------------------
%
nu=c./lambda;
numin=c/maxL;
numax=c/minL;
%the range of frequencies
deltanu=numax-numin;
%deltaF is the minimum frequency allowed in the cavity (see the problem)
deltaF=c/(2*d)
%their ratio
num_nu=deltanu/deltaF
%-------------------------------------------------------------
%the values of m (most aren't integers)
m=nu/deltaF;
%-------------------------------------------------------------
%calculus of the intensity
%-------------------------------------------------------------
%the phase fi1
fi1=(4*pi*d)./lambda;
%fi in radians in the interval 0-2*pi
fi=mod(fi1,2*pi);
denb=-2*ep*cos(fi);
dena=1+r;
den=dena+denb;
I=1./den;
%fi in degrees in the interval 0-360
fi_g=fi*180/pi;
%
%-----------------------------------
%the array of max rows and 4 columns
%-----------------------------------
val=[nu' m' fi_g' I'];
%
%--------------------------------------------------
%the array val becomes vI where in the last columns
%intensities are sorted in ascending order
%--------------------------------------------------
[Isort Iindsort]=sort(val(:,4));
for i=1:max
vI(i,:)=val(Iindsort(i),:);
end
vI;
%the array vL contain the last N rows of vI
N=8;
Nm1=N-1;
jmin=max-Nm1;
p=1;
for j=jmin:max
vL(p,:)=vI(j,:);
p=p+1;
end
vL;
%the array vL becomes vLL
%with the nu in increasing order
[Lsort Lindsort]=sort(vL(:,1));
for i=1:N
vLL(i,:)=vL(Lindsort(i),:);
end
vLL;
%

%-------------------------------------
%from vLL are derived the final values
%-------------------------------------
for q=1:N
mnu(q)=vLL(q,1);
mm(q)=vLL(q,2);
mfigr(q)=vLL(q,3);
mI(q)=vLL(q,4);
end
mnu
mm
mfigr
mI
%
%-----------------------
%difference between nu(i+1) and nu(i)
for t=1:N-1
t1=t+1;
diffL(t)=mnu(t1)-mnu(t);
% diffmm(t)=2*d/(mm(t)*mm(t1));
end
diffL
% diffmm
%---------------------------------------------------
%plot of the intensities function of the frequencies
%---------------------------------------------------
%
nuplot1=mnu/1.0e+14
nuplot=nuplot1-4.7408
plot(nuplot,mI,'r-*'),grid on
axis([2.5e-5 4.6e-5 920 1070])
title('intensities function of the frequencies in Hz')
%=====================================================
%
Top