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

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.dtcms.com/a/356302.html

相关文章:

  • AWS集成开发最佳实践:构建高效可靠的云管理平台
  • 海运业务怎么管?解析海运货代系统的核心功能模块
  • Blender建模软件基本操作--学习笔记1
  • CSS text-decoration-thickness:精细控制文本装饰线粗细的新属性
  • Git 9 ,.git/index.lock 文件冲突问题( .git/index.lock‘: File exists. )
  • 亚马逊巴西战略升级:物流网络重构背后的生态革新与技术赋能之路
  • 基于SpringBoot的足球青训俱乐部管理系统
  • 【数组特殊排序最小最大次小次大依次类推规律放置】2022-10-27
  • 香港电讯为知名投资公司搭建高效、安全IT管理服务体系
  • Java学习day_13之API(常用API对象克隆)
  • 高效接入:Suno API 与主流编程语言的结合
  • 从“安全诉讼”说起:奖励模型(Reward Model)是LLM对齐的总阀门(全视角分析)
  • 龙迅#LT7641GX适用于四路HDMI2.1/DP/TPYE-C转HDMI2.1混切应用,分辨率高达8K60HZ!
  • 【谷歌浏览器】浏览器实用自用版——谷歌浏览器(Google Chrome)离线纯净版安装 官方版无任何捆绑及广告 【离线安装谷歌浏览器】
  • 智能体开发:学习与实验 ReAct
  • AI Agent实战:提升大模型应用能力——提示链、响应净化与结构化输出技术详解
  • C# WinForms 使用 CyUSB.dll 访问 USB 设备
  • 当不想安装telnet或nc时,可使用 Linux 系统默认自带的bash原生网络功能或ping(辅助判断)测试连通性
  • Pytest 插件:pytest_runtest_protocol
  • Dify 1.8.0 全网首发,预告发布
  • ZArchiver解压器:强大的安卓解压缩工具
  • 外缺圆圆心检测
  • 【Linux】Make/Makefile (自动化构建):从“是什么”到“会用它”
  • [Ai Agent] 本地知识库检索运用
  • 控制系统仿真之PID校正-PID校正(八)
  • 从2M到G时代:WiFi如何重塑我们的生活?
  • 人工智能之数学基础:透过频率直方图理解概率密度函数
  • 计算机网络:数据库(sqlite3)
  • 【机器学习入门】3.2 ALS算法——从评分矩阵到精准推荐的核心技术
  • OpenAI Sora深度解析:AI视频生成技术如何重塑广告电商行业?影业合作已落地