⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 program_4c.m

📁 《Dynamical Systems with Applications using MATLAB》一书是用来介绍离散和连续系统下动态非线性系统理论的经典教材(分形、混沌、非线性系统)。这里的附件包含
💻 M
字号:
% Chapter 4 - Electromagnetic Waves and Optical Resonators.
% Program_4c - Animated bifurcation diagram for a nonlinear optical resonator.
% Copyright Birkhauser 2004. Stephen Lynch.

% Animated bifurcation diagram for a simple fiber ring resonator.
clear

for j = 1:60 
    F(j) = getframe;
format long;
halfN=7999;N=2*halfN+1;N1=1+halfN;
C=0.345913;
E1(1)=0;kappa=0.001*j;Pmax=120;phi=0;

% Ramp the power up
for n=1:halfN
    E2(n+1)=E1(n)*exp(i*(abs(C*E1(n))^2-phi));
    E1(n+1)=i*sqrt(1-kappa)*sqrt(n*Pmax/N1)+sqrt(kappa)*E2(n+1);
    Esqr(n+1)=abs(E1(n+1))^2;
end

% Ramp the power down
for n=N1:N
    E2(n+1)=E1(n)*exp(i*(abs(C*E1(n))^2-phi));
    E1(n+1)=i*sqrt(1-kappa)*sqrt(2*Pmax-n*Pmax/N1)+sqrt(kappa)*E2(n+1);
    Esqr(n+1)=abs(E1(n+1))^2;
end

for n=1:halfN
    Esqr1(n)=Esqr(N+1-n);
    ptsup(n)=n*Pmax/N1;
end

% Plot the bifurcation diagrams
fsize=15;

hold 
plot(ptsup(1:halfN),Esqr(1:halfN),'.','MarkerSize',1);
plot(ptsup(1:halfN),Esqr1(1:halfN),'.','MarkerSize',1);
xlabel('Input Power','FontSize',fsize);
ylabel('Output Power','FontSize',fsize);
axis([0 120 0 180])
title('Bifurcation Diagram for an Optical Resonator','FontSize',fsize);
 
 F(j) = getframe;

end

movie(F,5)

% End of Program_4c.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -