【DDSCAT——离散偶极近似仿真程序07】模型设计Matlab代码:圆环套多个圆柱

       文献中的最后一种模型。

 

一、设计圆环套多个圆柱模型

       1)Matlab代码

%%All cylinders are oriented such that the incident light
%%is along the x axis and strikes the circular face of the cylinder
R = [35, 5, 5, 5, 5, 5, 5, 5, 5]; %ring outer radius
Ri = 25; %ring inner radius
r = [5, 5, 5]; %inner cylinder radius
H = [20, 20, 20, 20, 20, 20, 20, 20, 20]; %ring height
cylinders = 9; %number of cylinders (including ring)
offX = zeros(1,cylinders);
offY = zeros(1,cylinders);
offZ = zeros(1,cylinders);
% offX = [0,-40,40];
offY = [0,19,-19,0,0,13,13,-13,-13];
offZ = [0,0,0,19,-19,13,-13,13,-13];
%% calculation parameters used for output documentation file
X = H;
Y = R;
Z = R;
Xd = X; %diameter
Yd = Y*2;
Zd = Z*2;
ri = r; %inner cylinder radius
Xs = ri*2;
Ys = ri*2;
Zs = ri*2;
Out = [0 0 0 0 0 0 0];
d = 1; %dipole #
di = 1; %inner dipole #
off = 1;
for i = (-Z(1,off)+offZ(1,off)):(Z(1,off)+offZ(1,off))
    for j = (-Y(1,off)+offY(1,off)):(Y(1,off)+offY(1,off))
        for k = (0+offX(1,off)):(X(1,off)+offX(1,off))
            L = ((i-offZ(1,off))^2 + (j-offY(1,off))^2)^.5;
            if L <= R(1,off) && L >= Ri
                Out = [Out; d k j i 2 2 2];
                d = d + 1;
            end
        end
    end
end

for off = 2:cylinders
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值