【VRP问题】基于模拟退火算法结合LNS求解车辆路径规划问题附matlab代码

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab王者助手

🍊个人信条:日日行   不怕千万里

⛄ 内容介绍

光学实验的计算机仿真不仅在科学与工程计算方面发挥着重要作用,而且在光学教学方面也引起了广大教育工作者的广泛关注.使用不同工具编写的各种光学实验仿真应用软件大量涌现,掀起了光学实验仿真的热潮. 

⛄ 部分代码

%% solve the mode in the waveguide

close all;clear;clc;tic;

profile on;

profile clear;

%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%   fiber information  %%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

n_core=1.46; % core index

NA=0.12;   % Numerical Aperture

n_clad=sqrt(n_core^2-NA^2); % clad index 

n_eff=(n_clad+n_core)/2; % estimated propagating index

n_air=n_clad;

r_clad=25;

r_core=2.952;

r_air=50;

lambda=1.550;   % wavelength in um

BCs=4;% 1 Dirichelet 2 Newmann 3 Anaytical 4 Transparent

tolerance=1e-4; % How accuate you want the effective index to be? The smaller the tolerance, the more accurate the answer would be. 

field='ex';     % The polarization of the light. 'ex', 'ey' or 'scalar'

N1=201;           % number of points between -r_clad and r_clad

N2=201;           % number of points between r_clad and r_air

%% Analysis Window Discretization

vx=[-r_air N2 -r_core 2*N1+1 r_core N2 r_air];

vy=vx;

index=[n_core,n_clad,n_air];

radius=[r_core,r_clad,r_air];

[X,Y,Index]=fiber(vx,vy,index,radius);

    

% plot index profile

figure

h=surf(X,Y,Index);

set(h,'edgecolor','none')

set(gcf,'renderer','painters');

view(0,90)

colorbar;

axis equal;

%% Initial guess of wavefunction distriution

r=sqrt(X.^2+Y.^2);

V=2*pi*r_core*NA/lambda;

w0=5; 

E0=exp(-r.^2/w0^2);

% plot initial field

figure

h=surf(X,Y,abs(E0).^2);

set(h,'edgecolor','none')

set(gcf,'renderer','painters');

view(0,0)

%% Mode calculation

E=E0;

n_out=[1 1 1 1]; % the index outside the boundary

[n_eff,E]=SVMODES(lambda,n_eff,X,Y,Index,E,BCs,field,tolerance);

n_eff

figure

surf(X,Y,abs(E).^2);

view(0,0);

shading interp;

figure

n=round(size(E,1)/2);

plot(X(1,:),abs(E(n,:)).^2);

toc;

profile report;

⛄ 运行结果

图片

图片

图片

⛄ 参考文献

[1]曲伟娟. 基于Matlab的光学实验仿真[D]. 西北工业大学, 2004.

[2]钟可君, 张海林. 基于Matlab GUI设计的光学实验仿真[J]. 实验室研究与探索, 2010(10):3.

⛄ 完整代码

❤️部分理论引用网络文献,若有侵权联系博主删除
❤️ 关注我领取海量matlab电子书和数学建模资料

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值