Home

Introduction

Contents

Scripts

FeedBack

Date 08/09/2010
Script S1_2_18.m
Download Script S1_2_18.m
%=============================================
%Cavity 1
%=============================================
%
%--------------------------
%initial values in amstrong
%--------------------------
%Lambda
Lambda=6328;
%deviation
dev=0.016;
%distance between the mirrors
d=0.5e+10;
%the reflexivity r and its square root ep
r=0.95;
ep=sqrt(r);
%
%-----------------------------
%preliminary calculi
%-----------------------------
%minimum aand maximum of lambda
minL=(Lambda-dev);
maxL=(Lambda+dev);
%their difference
deltaL=maxL-minL;
%interval of the Lambda is divided in max=1000 parts
max=1000;
lambda=linspace(minL,maxL,max);
%------------------------------------------------
%values of m according to the resonance condition
%most of values aren't integers
m=2*d./lambda;
%------------------------------------------------
%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;
%
%-----------------------------------------------------------
%an array of max rows and 4 columns contains the last values
%-----------------------------------------------------------
val=[lambda' m' fi_g' I'];
%
%val becomes vI where the intensities in the last column
%are sorted in ascending order
[Isort Iindsort]=sort(val(:,4));
for i=1:max
vI(i,:)=val(Iindsort(i),:);
end
vI;
%vL contains the last N rows of vI
N=7;
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 lambda in ascending order
[Lsort Lindsort]=sort(vL(:,1));
for i=1:N
vLL(i,:)=vL(Lindsort(i),:);
end
vLL;
%
%the final values are derived from vLL
for q=1:N
mlambda(q)=vLL(q,1);
mm(q)=vLL(q,2);
mfigr(q)=vLL(q,3);
mI(q)=vLL(q,4);
end
mlambda
mm
mfigr
mI
%
%-----------------------
%difference between lambda(i+1) and lambda(i)
for t=1:N-1
t1=t+1;
diffL(t)=mlambda(t1)-mlambda(t);
diffmm(t)=2*d/(mm(t)*mm(t1));
end
diffL
diffmm
%----------------------------------------------
%plot of the intensities function of the lambda
%in amstrong
%----------------------------------------------
%
plot(mlambda,mI,'r-*'),grid on
title('relative intensities function of the lambda in amstrong')
%=============================================
%
Top