当前位置: 首页 > backend >正文

FDTD_mie散射_仿真学习(2)

代码分析:

Model模式

# parameter definitions

#

# mesh size: the mesh size (dx = dy = dz) of the mesh override网格覆盖的网格大小(dx = dy = dz)

# simulation_span: the span of the simulation region仿真区间

# particle_x(_y,_z)_span:the span of the nanoparticle(s) in the x (y, z) direction

#粒子x、y、z区间范围

# particle_x(_y,_z)_center: the center of the nanoparticle(s) in the x, y, z directions

#粒子x、y、z中心坐标

# set the simulation spans选中FDTD,修改其坐标

select("FDTD");

set("x span",simulation_span);

set("y span",simulation_span);

set("z span",simulation_span);

# set the mesh override mesh的范围大小

select("mesh");

set("x span",particle_x_span+12*mesh_size);

set("y span",particle_y_span+12*mesh_size);

set("z span",particle_z_span+12*mesh_size);

set("dx",mesh_size);

set("dy",mesh_size);

set("dz",mesh_size);

# set the monitors监视器的大小

select("time_corner");#时间

set("x",simulation_span/2);

set("y",simulation_span/2);

set("z",simulation_span/2);

#x_normal_profile这名字需要与设定的监视器名字相同

setnamed("x_normal_profile","y span",particle_y_span+12*mesh_size);

setnamed("x_normal_profile","z span",particle_z_span+12*mesh_size);

setnamed("y_normal_profile","x span",particle_x_span+12*mesh_size);

setnamed("y_normal_profile","z span",particle_z_span+12*mesh_size);

setnamed("z_normal_profile","x span",particle_x_span+12*mesh_size);

setnamed("z_normal_profile","y span",particle_y_span+12*mesh_size);

setnamed("movie","x span",simulation_span);

setnamed("movie","y span",simulation_span);

# set the analysis groups and the TFSF source分析组和TFSF光源

select("abs");

set("x span",particle_x_span+4*mesh_size);

set("y span",particle_y_span+4*mesh_size);

set("z span",particle_z_span+4*mesh_size);

select("mie_source");

set("x span",particle_x_span+8*mesh_size);

set("y span",particle_y_span+8*mesh_size);

set("z span",particle_z_span+8*mesh_size);

selectpartial("scat");

set("x span",particle_x_span+12*mesh_size);

set("y span",particle_y_span+12*mesh_size);

set("z span",particle_z_span+12*mesh_size);

# align the center of FDTD, mesh override, source, monitors and analysis groups to the center of the particle(s)

#将FDTD、网格覆盖、源、监视器和分析组的中心对齐到粒子的中心

select("FDTD");

shiftselect("mesh");

shiftselect("mie_source");

shiftselectpartial("_profile");

shiftselect("time_corner");

shiftselect("movie");

shiftselect("abs");

shiftselectpartial("scat");

set("x",particle_x_center);

set("y",particle_x_center);

set("z",particle_x_center);

Abs分析组

结构

deleteall;

####################################################

# This script sets up the field monitors

# for calculating the cross sections

#

# Input properties

# x,y,z span: object span

#

# Tags: cross section scattering absorption extinction

#

# Copyright 2012 Lumerical Solutions Inc

#####################################################

# simplify variable names by removing spaces

x_span = %x span%;

y_span = %y span%;

z_span = %z span%;

# add X monitors

addpower;

set("name","x1");

set("monitor type","2D X-normal");

set("x",-x_span/2);

set("y",0);

set("y span",y_span);

set("z",0);

set("z span",z_span);

#复制了一个x监视器

copy(x_span,0,0);#x_span,0,0这三个平移坐标。向x的正方向平移

set("name","x2");

# add Y monitors

addpower;

set("name","y1");

set("monitor type","2D Y-normal");

set("x",0);

set("x span",x_span);

set("y",-y_span/2);

set("z",0);

set("z span",z_span);

copy(0,y_span,0);

set("name","y2");

# add Z monitors

addpower;

set("name","z1");

set("monitor type","2D Z-normal");

set("simulation type","3D"); # only include in 3D simulations

set("x",0);

set("x span",x_span);

set("y",0);

set("y span",y_span);

set("z",-z_span/2);

copy(0,0,z_span);

set("name","z2");

# only record net power transmission, not field components

selectall;

set("output power",1);

set("output Ex",0);

set("output Ey",0);

set("output Ez",0);

set("output Hx",0);

set("output Hy",0);

set("output Hz",0);

set("output Px",0);

set("output Py",0);

set("output Pz",0);

分析:输出sigma

Sigma是什么参数呢

####################################################

#

# This object can be used to calculate nano-particle

# cross sections.

#

# Output properties

# sigma: cross section as a function of frequency/wavelength

#横截面作为频率/波长的函数

# Tags: cross section scattering absorption extinction

#横截面散射吸收消光

# Copyright 2012 Lumerical Solutions Inc

################################################################

f=getdata("x2","f"); # get freqency data

dim = getdata("x2","dimension"); # dimension of simulation x监视器的维度,此时为2维

#T数据,也就是输出的power

Px2 = transmission("x2");

if(havedata("x1")){ Px1 = -transmission("x1"); } else { Px1=Px2; }

Py2 = transmission("y2");

if(havedata("y1")){ Py1 = -transmission("y1"); } else { Py1=Py2; }

# include z monitors if 3D simulation包括z监视器,如果3D模拟

if (dim==3) {

Pz2 = transmission("z2");

if(havedata("z1")){ Pz1 = -transmission("z1"); } else { Pz1=Pz2; }

} else {

Pz2 = 0; Pz1 = 0;

}

# Total power flowing outwards. Units = W总能量向外流动。单位= W

Pscat = (Px1 + Px2 + Py1 + Py2 + Pz1 + Pz2)*sourcepower(f);

# Calculate cross-section计算截面/sourceintensity(f)不同频率下光的能量

cross_section = Pscat/sourceintensity(f);

# Create dataset result

sigma = matrixdataset("sigma");

sigma.addparameter("lambda",c/f,"f",f);

sigma.addattribute("sigma",cross_section);

http://www.xdnf.cn/news/19049.html

相关文章:

  • 【机器人概念设计软件操作手册】 建模技巧与最佳实践
  • 自适应RAG架构:智能检索增强生成的演进与实现
  • 前端如何使用canvas实现截图
  • Python OpenCV图像处理与深度学习:Python OpenCV入门-图像处理基础
  • Linux之Docker虚拟化技术(二)
  • Mysql系列--11、使用c/c++访问mysql服务
  • 软件安装教程(二):Pycharm安装与配置(Windows)
  • DeepSeek大模型风靡云平台,百度智能云、阿里云、腾讯云等多个平台宣布上线DeepSeek模型
  • java_web 日志配置
  • 瑞芯微RK3576开发板Android14三屏异显开发教程
  • 【项目思维】通过编写一个贪吃蛇小程序,并移植到嵌入式设备上,解析编程思维的本质
  • SAP-ABAP:SAP 数值显示格式控制:负号前置方法与最佳实践总结
  • 一般纳税人
  • JavaScript 数组核心操作实战:最值获取与排序实现(从基础到优化)
  • CSS text-decoration-thickness:精细控制文本装饰线粗细的新属性
  • 光学设计中干涉现象难预测?OAS 软件多结构干涉来解决
  • Word文档怎么打印?Word打印技巧?【图文详解】单面/双面/指定页面/逆序等Word打印选项
  • Linux学习——sqlite3
  • 【系列01】端侧AI:构建与部署高效的本地化AI模型
  • 【Linux】Make/Makefile (自动化构建):从“是什么”到“会用它”
  • 软考-系统架构设计师 专家系统(ES)详细讲解
  • Azure、RDP、NTLM 均现高危漏洞,微软发布2025年8月安全更新
  • PlotJuggler如何安装和使用
  • AI 自动化编程 trae 体验3 开发小程序
  • (Nginx)基于Nginx+PHP 驱动 Web 应用(上):配置文件与虚拟主机篇
  • 网络编程(2)—多客户端交互
  • Uniapp + UView + FastAdmin 性格测试小程序方案
  • Qt类-扩充_xiaozuo
  • 龙巍:探究青铜器在木雕中的运用
  • 学习:uniapp全栈微信小程序vue3后台(6)