


{"id":235764,"date":"2022-09-20T08:25:07","date_gmt":"2022-09-20T08:25:07","guid":{"rendered":"\/forum\/?post_type=topic&#038;p=235764"},"modified":"2022-09-20T08:25:07","modified_gmt":"2022-09-20T08:25:07","slug":"qingwenheqiujiaolumerical-fdtd-zhongruheshezhirusheguangdeguangziguidaojiaodongliangoamdewenti","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/qingwenheqiujiaolumerical-fdtd-zhongruheshezhirusheguangdeguangziguidaojiaodongliangoamdewenti\/","title":{"rendered":"\u8bf7\u95ee\u548c\u6c42\u6559Lumerical FDTD \u4e2d\u5982\u4f55\u8bbe\u7f6e\u5165\u5c04\u5149\u7684\u5149\u5b50\u8f68\u9053\u89d2\u52a8\u91cfOAM\u7684\u95ee\u9898"},"content":{"rendered":"<p>\u8bf7\u95ee\u8001\u5e08\uff0c\u5982\u4f55\u5728FDTD\u4e2d\u8bbe\u7f6e\u5165\u5c04\u5149\u7684\u5149\u5b50\u8f68\u9053\u89d2\u52a8\u91cfOAM? \u76ee\u524d\uff0c\u6211\u9700\u8981\u6a21\u62df\u8ba1\u7b97\u4e0d\u540cOAM \u6a21\u5f0f\u7684\u5149\u5165\u5c04\u5230\u6211\u7684\u8d85\u6750\u6599\u8868\u9762\uff0c\u6240\u4ea7\u751f\u7684\u7684\u5149\u5b66\u6548\u679c\u3002\u5149\u7684\u504f\u632f\u6001\u53ef\u4ee5\u5728\u5149\u6e90\u7684\u8bbe\u7f6e\u4e2d\u8fdb\u884c\u8bbe\u7f6e\uff0c\u4f46\u662f\u5149\u5b50\u7684\u8f68\u9053\u89d2\u52a8\u91cf\u4e00\u76f4\u627e\u4e0d\u5230\u53ef\u4ee5\u8bbe\u7f6e\u7684\u5730\u65b9\u3002<\/p>\n<p>\u6211\u5728\u8bba\u575b\u91cc\u627e\u5230\u4e00\u7bc7\u7c7b\u4f3c\u7684\u6587\u7ae0\uff0c\u662f\u7528\u7f16\u7a0b\u8bed\u8a00\u5bf9\u5165\u5c04\u5149\u6e90\u7684\u4e00\u4e9b\u53c2\u6570\u8fdb\u884c\u8bbe\u7f6e\uff0c\u5982\u4e0b\u6240\u793a\u3002\u7531\u4e8e\u6211\u5bf9\u7f16\u7a0b\u8bed\u8a00\u4e0d\u662f\u5f88\u719f\u6089\uff0c\u4e0d\u77e5\u9053\u5b59\u8001\u5e08\u80fd\u5426\u4fee\u6539\/\u7f16\u5199\u811a\u672c\u7a0b\u5e8f\uff0c\u6765\u8bbe\u7f6e\u5177\u6709\u4e0d\u540cOAM\u6a21\u5f0f\u7684\u5165\u5c04\u5149\u5462\uff1f\u8c22\u8c22<\/p>\n<p>&nbsp;<\/p>\n<p># scriptfile:usr_custom_source.lsf<\/p>\n<p># define position vectors<\/p>\n<p>x=linspace(-10e-6,10e-6,401);<br \/>y=linspace(-10e-6,10e-6,401);<br \/>z=0; #this is z z-normal source<\/p>\n<p>X=meshgridx(x,y);<br \/>Y=meshgridx(x,y);<\/p>\n<p>lambda0=0.5e-6;<br \/>f=c\/lambda0;<br \/>w=2*pi*f;<br \/>k=2*pi\/lambda0;<\/p>\n<p>#calculate k-space field profiles<br \/>NA=0.2;<\/p>\n<p>kx=linspace(-k,k,200);<br \/>ky=linspace(-k,k,200);<br \/>Kx=meshgridx(kx,ky);<br \/>Ky=meshgridy(kx,ky);<br \/>phi=atan2(Ky,Kx);<br \/>theta=real(acos(sqrt(1-Kx^2\/k^2-Ky^2\/k^2)));<br \/>envelope=exp(-0.5*(Kx^2+Ky^2)\/(NA*k)^2);<\/p>\n<p>Exk=cos(phi)*cos(theta)*envelope;<\/p>\n<p>Eyk=sin(phi)*cos(theta)*envelope;<\/p>\n<p>Ezk=sin(theta)*envelope;<\/p>\n<p>Ex=-1i*czt(Exk,kx,ky,x,y);<\/p>\n<p>Ey=-1i*czt(Eyk,kx,ky,x,y);<\/p>\n<p>Ez=-1i*czt(Ezk,kx,ky,x,y);<\/p>\n<p>Hxk=-sqrt(eps0\/mu0)*sin(phi)*envelope;<br \/>Hyk=sqrt(eps0\/mu0)*cos(phi)*envelope;<br \/>Hx=-1i*czt(Hxk,kx,ky,x,y);<br \/>Hy=-1i*czt(Hyk,kx,ky,x,y);<br \/>Hz=0*Ex;<\/p>\n<p># sacle fild so E^2=1<\/p>\n<p>E2=abs(Ex)^2+abs(Ey)^2+abs(Ez)^2;<br \/>scaleFactor=sqrt(max(E2));<br \/>Ex=Ex\/scaleFactor;<br \/>Ey=Ey\/scaleFactor;<br \/>Ez=Ez\/scaleFactor;<br \/>Hx=Hx\/scaleFactor;<br \/>Hy=Hy\/scaleFactor;<br \/>Hz=Hz\/scaleFactor;<\/p>\n<p># package field data into the EM fields dataset<\/p>\n<p>EM=rectilineardataset(&#8220;EM fields&#8221;,x,y,z);<br \/>EM.addparameter(&#8220;lambda&#8221;,c\/f,&#8221;f&#8221;,f);<br \/>EM.addattribute(&#8220;E&#8221;,Ex,Ey,Ez);<br \/>EM.addattribute(&#8220;H&#8221;,Hx,Hy,Hz);<\/p>\n<p># save dataset to .mat file<br \/>matlabsave(&#8220;import_data.mat&#8221;,EM);<\/p>\n","protected":false},"template":"","class_list":["post-235764","topic","type-topic","status-closed","hentry","topic-tag-LumericalFDTD-1"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_author_ip":["23.220.96.180"],"_bbp_subscription":["263442","2592"],"_btv_view_count":["1489"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["235764"],"_bbp_forum_id":["27835"],"_bbp_engagement":["2592","263442"],"_bbp_voice_count":["2"],"_bbp_reply_count":["6"],"_bbp_last_reply_id":["236313"],"_bbp_last_active_id":["236313"],"_bbp_last_active_time":["2022-09-26 15:59:59"]},"test":"jingyangpeng2022163-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/235764","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/235764\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=235764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}