classdef RCWA < handle
properties
Name
Polarization
LightSource
Period
ModeNumber
IndexProfileResolution
LayerNumber
Layers
FieldDetectorNumber
FieldDetectors
ComputingResults
Reflection
Transmission
end
methods
function mr=RCWA(varargin)
mr.Name='rcwa';
mr.ModeNumber=50;
mr.Period=800;
mr.ComputingResults=Results;
for icount=1:nargin
if ischar(varargin{icount})
switch lower(varargin{icount})
case {'nm','name'}
mr.Name=varargin{icount+1};
case {'period','lambda'}
mr.Period=varargin{icount+1};
case {'nmode','modenumber'}
mr.ModeNumber=varargin{icount+1};
otherwise
disp('Error: Unknown input.');
return;
end
end
end
mr.IndexProfileResolution=2^nextpow2(4*mr.ModeNumber+1);
mr.FieldDetectorNumber=0;
mr.LayerNumber=2;
mr.Layers=cell(mr.LayerNumber,1);
mr.Layers{1}=Layer('period',mr.Period,...
'indresol',mr.IndexProfileResolution);
mr.Layers{1}.SetThickness(0);
mr.Layers{1}.SetLayerThickness(0);
mr.Layers{2}=Layer('period',mr.Period,...
'indresol',mr.IndexProfileResolution);
mr.Layers{2}.SetThickness(0);
mr.Layers{2}.SetLayerThickness(0);
end
function SetModeNumber(mr,nmode)
mr.ModeNumber=nmode;
mr.IndexProfileResolution=2^nextpow2(4*mr.ModeNumber+1);
for icount=1:mr.LayerNumber
mr.Layers{icount}.SetIndexProfileResolution(...
mr.IndexProfileResolution);
end
end
function SetPeriod(mr,period)
mr.Period=period;
for icount=1:mr.LayerNumber
mr.Layers{icount}.SetPeriod(...
mr.Period);
end
end
function AddLayer(mr,varargin)
mr.Layers{mr.LayerNumber+1}=mr.Layers{mr.LayerNumber};
mr.Layers{mr.LayerNumber}=Layer('period',mr.Period,...
'IndexProfileResolution',mr.IndexProfileResolution,...
'lyt',0);
if nargin>1
for icount=1:2:nargin-1
if ischar(varargin{icount})
switch lower(varargin{icount})
case {'layerthick','layerthickness','lyt'}
mr.Layers{mr.LayerNumber}...
.SetLayerThickness(...
varargin{icount+1});
case {'nm','name'}
mr.Layers{mr.LayerNumber}.SetName(...
varargin{icount+1});
case {'index','profile',...
'indexprofile',...
'profileparameters',...
'indexprofileparameters'}
mr.Layers{mr.LayerNumber}...
.SetIndexProfile(...
varargin{icount+1});
otherwise
disp('Error: Unknown input.');
return;
end
end
end
end
mr.Layers{mr.LayerNumber}.Thickness...
=mr.Layers{mr.LayerNumber+1}.Thickness...
+mr.Layers{mr.LayerNumber}.LayerThickness;
mr.Layers{mr.LayerNumber+1}.Thickness...
=mr.Layers{mr.LayerNumber+1}.Thickness...
+mr.Layers{mr.LayerNumber}.LayerThickness;
mr.LayerNumber=mr.LayerNumber+1;
end
function SetLayer(mr,varargin)
if nargin==1
disp('Error: Please specify the layer by index or name.');
elseif mod(nargin,2)
disp('Error: Input argument number incorrect.');
else
if ischar(varargin{1})
for icount=1:mr.LayerNumber
if strcmpi(mr.Layers{icount}.Name,varargin{1})
for jcount=2:2:nargin-1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
switch lower(varargin{jcount})
case {'nm','name'}
mr.Layers{icount}.Name=varargin{jcount+1};
case {'layerthick','layerthickness','lyt'}
delthick=varargin{jcount+1}-mr.Layers{icount}.LayerThickness;
mr.Layers{icount}.LayerThickness=varargin{jcount+1};
for kcount=icount+1:length(mr.Layers)
mr.Layers{kcount}.Thickness...
=mr.Layers{kcount}.Thickness+delthick;
end
case {'index','profile',...
'indexprofile',...
'profileparameters',...
'indexprofileparameters'}
mr.Layers{icount}.SetIndexProfile(varargin{jcount+1});
otherwise
disp('Error: Unknown input.');
return;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end
end
end
else
icount=varargin{1};
for jcount=2:2:nargin-1
switch lower(varargin{jcount})
case {'nm','name'}
mr.Layers{icount}.Name=varargin{jcount+1};
case {'layerthick','layerthickness','lyt'}
delthick=varargin{jcount+1}-...
mr.Layers{icount}.LayerThickness;
mr.Layers{icount}.LayerThickness=...
varargin{jcount+1};
for kcount=icount+1:length(mr.Layers)
mr.Layers{kcount}.Thickness...
=mr.Layers{kcount}.Thickness...
+delthick;
end
case {'index','profile',...
'indexprofile',...
'profileparameters',...
'indexprofileparameters'}
mr.Layers{icount}...
.SetIndexProfile(varargin{jcount+1});
otherwise
disp('Error: Unknown input.');
return;
end
end
end
end
end
function ApplyLightSource(mr,varargin)
mr.LightSource=Source;
mr.Polarization=mr.LightSource.Polarization;
mr.SetLightSource(varargin{:});
end
function SetLightSource(mr,varargin)
if nargin==1
return;
else
for icount=1:2:nargin-1
switch lower(varargin{icount})
case {'pol','polarization'}
mr.LightSource...
.SetPolarization(varargin{icount+1});
mr.Polarization=upper(varargin{icount+1});
case {'wv','wavelength'}
mr.LightSource...
.SetWavelength(varargin{icount+1});
IT狂飙
- 粉丝: 4841
- 资源: 2650
最新资源
- MySQL的重点知识和使用
- 机器人及自动驾驶SLAM定位知识体系构建思维导图
- 本人项目进行中采集的数据集,包含原始数据和处理后的数据,项目持续更新 .zip
- 安卓项目源码AndroidPlayer(仿酷狗播放器)
- 四旋翼无人机,进行simulink建模与仿真,对它的运动学模型和动力学模型进行了必要且详细的研究和分析,运用牛顿-欧拉方程建立了四旋翼的运动学和动力学方程,最后推导出四个旋翼的角速度表达式 采用了一
- 标注自己的数据集,训练、评估、测试、部署自己的人工智能算法.zip
- 安卓项目源码AndroidTXT文本阅读器源码
- BLDC无刷直流电机matlab仿真,转速电流双闭环控制,有感或无感相方式,电机模型自带反电动势输出,默认用无感反电动势过零相方式,里面有霍尔信号(未使用),Simulink仿真
- 目标检测数据集制作VOC、COCO、YOLO等常用数据集格式的制作和常用脚本.zip
- 基于matlab的改进的量子遗传算法对多变量函数寻优完整代码,内容详细,包含运行说明,该代码在量子旋转门调整中做了一些改进,在“Qgate1”中可以看到,旋转角度并不是固定不变的,而是将其与适应度以及
- 安卓项目源码android豆瓣手机客户端源码
- 目标检测数据集标注工具.zip
- postgis-1.5.6.tar.gz
- postgis-1.5.7.tar.gz
- 三菱电梯LEHY-Pro电梯地址码
- postgis-1.5.8.tar.gz
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈