


{"id":363312,"date":"2024-04-20T14:01:08","date_gmt":"2024-04-20T14:01:08","guid":{"rendered":"\/forum\/forums\/topic\/how-to-calculate-scattering-power\/"},"modified":"2024-04-20T14:01:08","modified_gmt":"2024-04-20T14:01:08","slug":"how-to-calculate-scattering-power","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/how-to-calculate-scattering-power\/","title":{"rendered":"How to calculate scattering power?"},"content":{"rendered":"<p>Why does <strong>Lumerical example(defect scattering<\/strong>) use the difference of two cone volume integrals to obtain the scattered power in the PSL.lsf script?<\/p>\n<p>the model:<\/p>\n<p><img decoding=\"async\" src=\"\/forum\/wp-content\/uploads\/sites\/2\/2024\/04\/20-04-2024-1713621655-1713621634187.png\" alt=\"\"><\/p>\n<p>&nbsp;<\/p>\n<p>Here is the script:&nbsp;<\/p>\n<p>############################################<\/p>\n<p># file: psl_analysis<\/p>\n<p># Description: This file is used to calculate<\/p>\n<p># the scattering from PSL spheres. It runs<\/p>\n<p># a reference simulation as well as the defect<\/p>\n<p># simulations.<\/p>\n<p># After the simulations are complete, the far<\/p>\n<p># fields are calculated. The reference far field<\/p>\n<p># is subtracted from the defect far field,<\/p>\n<p># giving the scattered far field.<\/p>\n<p>#<\/p>\n<p># Copyright 2010 Lumerical Solutions Inc<\/p>\n<p>############################################<\/p>\n<p>&nbsp;<\/p>\n<p>polarization = &#8220;P&#8221;; #sets which polarization to run: &#8220;P&#8221;, &#8220;S&#8221;, &#8220;C&#8221; (circular)<\/p>\n<p>&nbsp;<\/p>\n<p>run_simulations = 1; # set to 0 to analyze previously run simulations<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>if (run_simulations) {<\/p>\n<p>switchtolayout;<\/p>\n<p>&nbsp;<\/p>\n<p>if (polarization==&#8221;P&#8221;) {<\/p>\n<p>setnamed(&#8220;FDTD&#8221;,&#8221;x&#8221;,1e-6);<\/p>\n<p>setnamed(&#8220;source1&#8243;,&#8221;polarization angle&#8221;,0);<\/p>\n<p>setnamed(&#8220;source1&#8243;,&#8221;angle theta&#8221;,70);<\/p>\n<p>setnamed(&#8220;FDTD&#8221;,&#8221;y min bc&#8221;,&#8221;Symmetric&#8221;);<\/p>\n<p>select(&#8220;source2&#8221;);<\/p>\n<p>delete;<\/p>\n<p>}<\/p>\n<p>if (polarization==&#8221;S&#8221;) {<\/p>\n<p>setnamed(&#8220;FDTD&#8221;,&#8221;x&#8221;,1e-6);<\/p>\n<p>setnamed(&#8220;source1&#8243;,&#8221;polarization angle&#8221;,90);<\/p>\n<p>setnamed(&#8220;source1&#8243;,&#8221;angle theta&#8221;,70);<\/p>\n<p>setnamed(&#8220;FDTD&#8221;,&#8221;y min bc&#8221;,&#8221;Anti-Symmetric&#8221;);<\/p>\n<p>select(&#8220;source2&#8221;);<\/p>\n<p>delete;<\/p>\n<p>}<\/p>\n<p>if (polarization==&#8221;C&#8221;) {<\/p>\n<p>setnamed(&#8220;FDTD&#8221;,&#8221;x&#8221;,1e-6);<\/p>\n<p>select(&#8220;source2&#8221;);<\/p>\n<p>delete;<\/p>\n<p>setnamed(&#8220;source1&#8243;,&#8221;polarization angle&#8221;,0);<\/p>\n<p>setnamed(&#8220;source1&#8243;,&#8221;angle theta&#8221;,0);<\/p>\n<p>setnamed(&#8220;FDTD&#8221;,&#8221;x&#8221;,0);<\/p>\n<p>select(&#8220;source1&#8221;);<\/p>\n<p>copy;<\/p>\n<p>set(&#8220;name&#8221;,&#8221;source2&#8243;);<\/p>\n<p>set(&#8220;polarization angle&#8221;,90);<\/p>\n<p>set(&#8220;phase&#8221;,90);<\/p>\n<p>setnamed(&#8220;FDTD&#8221;,&#8221;y min bc&#8221;,&#8221;PML&#8221;);<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<p>runsweep;<\/p>\n<p>save;<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<p>swp=&#8221;sweep_rad&#8221;;<\/p>\n<p>farfieldfilter(0.5);<\/p>\n<p>&nbsp;<\/p>\n<p># get the data from the sweep<\/p>\n<p>E2_far=getsweepresult(swp,&#8221;E2_far&#8221;);<\/p>\n<p>T=getsweepresult(swp,&#8221;T&#8221;);<\/p>\n<p>SP=getsweepresult(swp,&#8221;SP&#8221;);<\/p>\n<p>rad = E2_far.rad;<\/p>\n<p>res = length(E2_far.ux);<\/p>\n<p>E2=E2_far.E2_far;<\/p>\n<p>#plot(rad*1e9,log10(T.T*SP.SP),&#8221;radius (nm)&#8221;,&#8221;scattered power (log10, Watts)&#8221;<\/p>\n<p>scat_power=matrix(length(rad)); #\u521b\u5efa\u77e9\u9635\u5b58\u50a8\u4e0d\u540c\u534a\u5f84\u7684scat_power<\/p>\n<p>&nbsp;<\/p>\n<p>for (i=1:length(rad)) {<\/p>\n<p>&nbsp;<\/p>\n<p>P_far_scat = sqrt(eps0\/mu0) * pinch(E2(1:res,1:res,i));<\/p>\n<p>scat_power(i) = 0.5*(farfield3dintegrate(P_far_scat,E2_far.ux,E2_far.uy,72,0,0)-farfield3dintegrate(P_far_scat,E2_far.ux,E2_far.uy,25,0,0));<\/p>\n<p>image(E2_far.ux,E2_far.uy,pinch(P_far_scat)\/pinch(max(P_far_scat)),&#8221;ux&#8221;,&#8221;uy&#8221;,&#8221;far field&#8221;,&#8221;plot polar&#8221;);<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<p>savedata(&#8220;psl_&#8221;+polarization,scat_power); # save data to an ldf file<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p># plot results from P,S,C polarization on same plot (if results exist)<\/p>\n<p>if (fileexists(&#8220;psl_p.ldf&#8221;)) { loaddata(&#8220;psl_P&#8221;); spP = scat_power; } else { spP = 0; }<\/p>\n<p>if (fileexists(&#8220;psl_s.ldf&#8221;)) { loaddata(&#8220;psl_S&#8221;); spS = scat_power; } else { spS = 0; }<\/p>\n<p>if (fileexists(&#8220;psl_c.ldf&#8221;)) { loaddata(&#8220;psl_C&#8221;); spC = scat_power; } else { spC = 0; }<\/p>\n<p>&nbsp;<\/p>\n<p>if (spP==0 ) {spP=0*rad; }<\/p>\n<p>if (spS==0 ) {spS=0*rad; }<\/p>\n<p>if (spC==0 ) {spC=0*rad; }<\/p>\n<p>&nbsp;<\/p>\n<p>plot(2*rad(1:length(rad))*1e9,log10(spP),log10(spS),log10(spC),&#8221;Diameter (nm)&#8221;,&#8221;log10(scattered power)&#8221;);<\/p>\n<p>legend(&#8220;P&#8221;,&#8221;S&#8221;,&#8221;Circular&#8221;);<\/p>\n<p><strong>My problem:&nbsp;<\/strong><\/p>\n<p>scat_power(i) = 0.5*(farfield3dintegrate(P_far_scat,E2_far.ux,E2_far.uy,72,0,0)-farfield3dintegrate(P_far_scat,E2_far.ux,E2_far.uy,25,0,0));<\/p>\n<p>Why does it use the power with a half-angle of 72 degrees minus the power with a half-angle of 25 degrees? How are the values of 72 and 25 determined?<\/p>\n","protected":false},"template":"","class_list":["post-363312","topic","type-topic","status-closed","hentry","topic-tag-2dmaterialsandmetals-1","topic-tag-TFSF-1","topic-tag-3DFDTD-1","topic-tag-metal","topic-tag-scattered-field-1","topic-tag-scattering"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["288211","33648"],"_bbp_author_ip":["23.206.193.154"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["253"],"_bbp_topic_status":["unanswered"],"_bbp_topic_id":["363312"],"_bbp_forum_id":["27833"],"_bbp_engagement":["33648","288211"],"_bbp_voice_count":["2"],"_bbp_reply_count":["1"],"_bbp_last_reply_id":["363602"],"_bbp_last_active_id":["363602"],"_bbp_last_active_time":["2024-04-22 17:53:46"]},"test":"10172100207stu-ecnu-edu-cn"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/363312","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\/363312\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=363312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}