


{"id":372589,"date":"2024-07-18T14:02:38","date_gmt":"2024-07-18T14:02:38","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/some-problems-in-the-case-basediffuse-scattering-film-for-automotive-display\/"},"modified":"2024-07-18T14:02:38","modified_gmt":"2024-07-18T14:02:38","slug":"some-problems-in-the-case-basediffuse-scattering-film-for-automotive-display","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/some-problems-in-the-case-basediffuse-scattering-film-for-automotive-display\/","title":{"rendered":"Some problems in the case base(&#8220;Diffuse Scattering Film for Automotive Display&#8221;)"},"content":{"rendered":"<p>When simulating the case (&#8220;Diffuse Scattering Film for Automotive Display&#8221;) in the case base, I found that some of the script commands as as follows. What is the meaning of &#8221; norm_calc = exp( -(Theta\/beam_width)^2 ); &#8220;<\/p>\n<p>norm_calc = exp( -(Theta\/beam_width)^2 ); # Where Theta_out is the matrix of reflection angles,and Theta =&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; meshgridx(theta_out,phi_out); beam_width=2<\/p>\n<p>beam_norm = integrate(norm_calc*sin(Theta*pi\/180),1:2,theta_out*pi\/180,phi_out*pi\/180);<\/p>\n<p>beam_norm = 1\/beam_norm;<\/p>\n<p>BTDF(fc,1,1,:,:) = pinch(BTDF(fc,1,1,:,:)) + beam_norm*Ttotal(fc)*order_T(n,m,fc)*exp( -(ThetaDiff\/beam_width)^2 );<\/p>\n<p>The complete code is as follows:<\/p>\n<p>theta_out = linspace(0, 90, n_theta_out);<\/p>\n<p>phi_out = linspace(0, 360, n_phi_out);<\/p>\n<p>&nbsp;<\/p>\n<p>monitor_nameT = &#8220;T&#8221;;<\/p>\n<p>monitor_nameR = &#8220;R&#8221;;<\/p>\n<p>&nbsp;<\/p>\n<p>f = getdata(monitor_nameT,&#8221;f&#8221;);<\/p>\n<p>lambda = c\/f;<\/p>\n<p>&nbsp;<\/p>\n<p># Get refractive indices<\/p>\n<p>dim = getdata(&#8220;R&#8221;, &#8220;dimension&#8221;);<\/p>\n<p>if ( (dim==2) &amp; (%polarization angle% == 90) ) {<\/p>\n<p>index_R = real(getdata(&#8220;index_R&#8221;, &#8220;index_z&#8221;));<\/p>\n<p>index_T = real(getdata(&#8220;index_T&#8221;, &#8220;index_z&#8221;));<\/p>\n<p>} else {<\/p>\n<p>index_R = real(getdata(&#8220;index_R&#8221;, &#8220;index_x&#8221;));<\/p>\n<p>index_T = real(getdata(&#8220;index_T&#8221;, &#8220;index_x&#8221;));<\/p>\n<p>}<\/p>\n<p># calculate Theta and Phi grids<\/p>\n<p>Theta = meshgridx(theta_out,phi_out);<\/p>\n<p>Phi = meshgridy(theta_out,phi_out);<\/p>\n<p>Ux = sin(Theta*pi\/180)*cos(Phi*pi\/180);<\/p>\n<p>Uy = sin(Theta*pi\/180)*sin(Phi*pi\/180);<\/p>\n<p>Uz = cos(Theta*pi\/180);<\/p>\n<p>norm_calc = exp( -(Theta\/beam_width)^2 );<\/p>\n<p>beam_norm = integrate(norm_calc*sin(Theta*pi\/180),1:2,theta_out*pi\/180,phi_out*pi\/180);<\/p>\n<p>beam_norm = 1\/beam_norm;<\/p>\n<p>&nbsp;<\/p>\n<p>Ttotal = abs(transmission(monitor_nameT));<\/p>\n<p>if (dist&gt;0) {<\/p>\n<p>Rtotal = 1 &#8211; abs(transmission(monitor_nameR));<\/p>\n<p>} else {<\/p>\n<p>Rtotal = abs(transmission(monitor_nameR));<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<p># T<\/p>\n<p>BTDF = matrix(length(lambda),1,1,length(theta_out),length(phi_out));<\/p>\n<p>Ttest = matrix(length(lambda));<\/p>\n<p>order_T = grating(monitor_nameT, 1:length(f), index_T, direction);<\/p>\n<p>order_T_ux = gratingu1(monitor_nameT, 1:length(f), index_T, direction);<\/p>\n<p>order_T_uy = gratingu2(monitor_nameT, 1:length(f), index_T, direction);<\/p>\n<p>for(fc = 1:length(f)) {<\/p>\n<p>for(n=1:length(order_T_ux(:,fc))) {<\/p>\n<p>for(m=1:length(order_T_uy(:,fc))) {<\/p>\n<p>order_uz = sqrt( 1 &#8211; order_T_ux(n,fc)^2 &#8211; order_T_uy(m,fc)^2 );<\/p>\n<p>if( (order_T(n,m,fc)!= 0) &amp; (imag(order_uz) == 0.) ) {<\/p>\n<p>Tux = cos(-phi_in*pi\/180)*order_T_ux(n, fc) &#8211; sin(-phi_in*pi\/180)*order_T_uy(m, fc);<\/p>\n<p>Tuy = sin(-phi_in*pi\/180)*order_T_ux(n, fc) + cos(-phi_in*pi\/180)*order_T_uy(m, fc);<\/p>\n<p>ThetaDiff = real(acos( Ux*Tux + Uy*Tuy + Uz*order_uz ) * 180\/pi);<\/p>\n<p>BTDF(fc,1,1,:,:) = pinch(BTDF(fc,1,1,:,:)) + beam_norm*Ttotal(fc)*order_T(n,m,fc)*exp( -(ThetaDiff\/beam_width)^2 );<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>Ttest = real(integrate(pinch(BTDF)*sin(Theta*pi\/180),1:2, theta_out*pi\/180, phi_out*pi\/180));<\/p>\n","protected":false},"template":"","class_list":["post-372589","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["127482","707"],"_bbp_author_ip":["219.230.65.92"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["60"],"_bbp_topic_status":["unanswered"],"_bbp_topic_id":["372589"],"_bbp_forum_id":["27833"],"_bbp_engagement":["707","127482"],"_bbp_voice_count":["2"],"_bbp_reply_count":["1"],"_bbp_last_reply_id":["373076"],"_bbp_last_active_id":["373076"],"_bbp_last_active_time":["2024-07-22 16:55:28"]},"test":"1240093399qq-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/372589","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\/372589\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=372589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}