%Single Ring Resonator Simulation;
clear all
clc
% alpha=1;
% r=148;
% %lambda=1.5:1/20:5.0;
% lambda=1.525:0.001:1.565;
% neff=2.3;
% k=2.*pi./lambda;
% beta=k.*neff; %(2.4)
% theta=2.*pi.*r.*beta;
% t=sqrt(1-k.^2); %(2.2)
% phit=0;
% %on resonance
% t=abs(t).*exp(j.*phit); %(2.9)-(2.10)
% Ei1=1;
% Et1=(-alpha+t.*exp(-j.*theta))./(-alpha.*conj(t)+exp(-j.*theta)); %(2.6)
% Pt1=(alpha.^2+abs(t).^2-2.*alpha.*abs(t).*cos(theta+phit))./(1+alpha.^2.*abs(t).^2-2.*alpha.*abs(t).*cos(theta+phit));
% %(2.9)
% %Pt1=((alpha-abs(t)).^2)./(1-alpha.*abs(t)).^2; %(2.11)
%
% y1=Et1;
% y2=Pt1;
% plot(lambda,y1,'b');
% hold on
% plot(lambda,y2,'r');
% grid
% part 2
% r=0.85;
% a=0.85;
% %beta=1:0.01:4;
% neff=2.5;
% r1=0.9;
% r2=0.9;
% lambda=1.305:0.001:1.525;
% beta=2.*pi.*neff./lambda;
% b=cos(beta);
% L=2.*pi.*r;
% theta=beta.*L;
% k=sqrt(1-r.^2);
% Tn=(a.^2+r.^2-2.*a.*r.*cos(theta))./(1+(r.*a).^2-2.*a.*r.*cos(theta));
% Td=(1-r1.^2).*(1-r2.^2).*a./(1-2.*r1.*r2.*a.*cos(theta)+(r1.*r2.*a).^2);
% Tp=(r2.^2.*a.^2-2.*r1.*r2.*a.*cos(theta)+r1.^2)./(1-2.*r1.*r2.*a.*cos(theta)+(r1.*r2.*a).^2);
% plot(lambda,Tn,'r');
% hold on
% plot(lambda,Td,'g');
% hold on
% plot(lambda,Tp,'b');
% xlabel('Wavelength [\mum]');
% ylabel('Transmission');
% % part 3
% a=1;
% r1=0;
% r2=0.2;
% r3=0.4;
% r4=0.6;
% r5=0.8;
% r6=0.95;
% theta=-pi:0.01:pi;
% phit1=pi+theta+atan((r1.*sin(theta))./(a-r1.*cos(theta)))+atan((r1.*a.*sin(theta))./(1-r1.*a.*cos(theta)));
% phit2=pi+theta+atan((r2.*sin(theta))./(a-r2.*cos(theta)))+atan((r2.*a.*sin(theta))./(1-r2.*a.*cos(theta)));
% phit3=pi+theta+atan((r3.*sin(theta))./(a-r3.*cos(theta)))+atan((r3.*a.*sin(theta))./(1-r3.*a.*cos(theta)));
% phit4=pi+theta+atan((r4.*sin(theta))./(a-r4.*cos(theta)))+atan((r4.*a.*sin(theta))./(1-r4.*a.*cos(theta)));
% phit5=pi+theta+atan((r5.*sin(theta))./(a-r5.*cos(theta)))+atan((r5.*a.*sin(theta))./(1-r5.*a.*cos(theta)));
% phit6=pi+theta+atan((r6.*sin(theta))./(a-r6.*cos(theta)))+atan((r6.*a.*sin(theta))./(1-r6.*a.*cos(theta)));
% plot(theta,phit1,'r');
% hold on
% plot(theta,phit2,'g');
% hold on
% plot(theta,phit3,'b');
% hold on
% plot(theta,phit4,'c');
% hold on
% plot(theta,phit5,'m');
% hold on
% plot(theta,phit6,'b');
% hold on
% xticks([-pi -pi/2 0 pi/2 pi])
% xticklabels({'-\pi','-\pi/2','0','\pi/2','\pi'})
% yticks([0 pi 2*pi])
% yticklabels({'0','\pi','2\pi'})
% xlabel('Detuning \phi');
% ylabel('Effective phase delay \psi');
% % part 4
% r=0.85;
% a1=0.8;
% a2=0.85;
% a3=0.9;
% a4=0.95;
% theta=-pi:0.01:pi;
% phit1=pi+theta+atan((r.*sin(theta))./(a1-r.*cos(theta)))+atan((r.*a1.*sin(theta))./(1-r.*a1.*cos(theta)));
% phit2=pi+theta+atan((r.*sin(theta))./(a2-r.*cos(theta)))+atan((r.*a2.*sin(theta))./(1-r.*a2.*cos(theta)));
% phit3=pi+theta+atan((r.*sin(theta))./(a3-r.*cos(theta)))+atan((r.*a3.*sin(theta))./(1-r.*a3.*cos(theta)));
% phit4=pi+theta+atan((r.*sin(theta))./(a4-r.*cos(theta)))+atan((r.*a4.*sin(theta))./(1-r.*a4.*cos(theta)));
% plot(theta,phit1,'r');
% hold on
% plot(theta,phit2,'m');
% hold on
% plot(theta,phit3,'black');
% hold on
% plot(theta,phit4,'g');
% hold on
% xticks([-pi -pi/2 0 pi/2 pi])
% xticklabels({'-\pi','-\pi/2','0','\pi/2','\pi'})
% yticks([0 pi 2*pi])
% yticklabels({'0','\pi','2\pi'})
% xlabel('Detuning \phi');
% ylabel('Effective phase delay \psi');
% part 4-2
r=0.85;
a=0.8;
theta=-pi:0.01:pi;
phit=pi+theta+atan((r.*sin(theta))./(a-r.*cos(theta)))+atan((r.*a.*sin(theta))./(1-r.*a.*cos(theta)));
plot(theta,phit,'r');
- 1
- 2
前往页