


{"id":363805,"date":"2024-04-23T17:51:40","date_gmt":"2024-04-23T17:51:40","guid":{"rendered":"\/forum\/forums\/reply\/363805\/"},"modified":"2024-04-23T17:51:40","modified_gmt":"2024-04-23T17:51:40","slug":"363805","status":"publish","type":"reply","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/363805\/","title":{"rendered":"Reply To: Regarding box of monitors and far field simulations"},"content":{"rendered":"<p>&lt;p&gt;Hello Amrita,&lt;\/p&gt;&lt;p&gt;Thank you for the reply and a detailed explanation of farfield analysis group and the corrected script.&lt;\/p&gt;&lt;p&gt;I run the simulation with the script suggested here. But, It is generating an error:&lt;\/p&gt;&lt;p&gt;&lt;in ::model::scat_ff: analysis script start&gt;&lt;\/p&gt;&lt;p&gt;Target wavelength = 1.54e-06&lt;\/p&gt;&lt;p&gt;Wavelength used = 1.54e-06&lt;\/p&gt;&lt;p&gt;Angular distribution i=1, 1.54um&lt;\/p&gt;&lt;p&gt;Projecting in x-y plane&lt;\/p&gt;&lt;p&gt;Projecting in y-z plane&lt;\/p&gt;&lt;p&gt;Projecting in x-z plane&lt;\/p&gt;&lt;p&gt;Error: Result XY_halfspace: variable not found.&lt;\/p&gt;&lt;p&gt;&lt;in ::model::scat_ff: analysis script complete&gt;&lt;\/p&gt;&lt;p&gt;And, I am not able to visualize the farfied data in the xy_half space and its showing&#8221;failed to calculate results&#8221;&lt;\/p&gt;&lt;p&gt;Please find the attached script that you have suggested here and I have used the same script for the simulations:&lt;\/p&gt;&lt;p&gt;##############################################&lt;\/p&gt;&lt;p&gt;# Far field from closed box&lt;\/p&gt;&lt;p&gt;# This script calculates scattering cross-section and far field projection in half space&lt;\/p&gt;&lt;p&gt;#&lt;\/p&gt;&lt;p&gt;# Note: The far field projection calculation assumes that all of the monitors&lt;\/p&gt;&lt;p&gt;# are in a single homogeneous material (i.e. there is no substrate)&lt;\/p&gt;&lt;p&gt;# If a substrate is present, results from this object will be invalid.&lt;\/p&gt;&lt;p&gt;# If multiple frequency points are collected, the projection can be slow!! One could reduce the halfspace resolution for faster analysis.&lt;\/p&gt;&lt;p&gt;# For more information, see http:\/\/docs.lumerical.com\/en\/layout_analysis_projections_from_monitor.html&lt;\/p&gt;&lt;p&gt;#&lt;\/p&gt;&lt;p&gt;# symm x,y,z: symmetry boundary conditions&lt;\/p&gt;&lt;p&gt;# 0 for no symmetry, 1 for symmetric, -1 for antisymmetric&lt;\/p&gt;&lt;p&gt;# Autodetection is managed by examining fields at the symmetry boundary&lt;\/p&gt;&lt;p&gt;# For more information, see http:\/\/docs.lumerical.com\/en\/index.html?ref_sim_obj_symmetric_anti-symmetric.html&lt;\/p&gt;&lt;p&gt;#&lt;\/p&gt;&lt;p&gt;# do halfspace: Calculate the far field in the full half space for all frequencies. This takes longer than the 1D radar line cross sections. 1 for yes, 0 for no&lt;\/p&gt;&lt;p&gt;# do polar plot: Calculate the far field scattering angular distribution for a specified target wavelength. 1 for yes, 0 for no&lt;\/p&gt;&lt;p&gt;# target wavelength: Desired wavelength for polar plot. The closest wavelength recorded by the monitors will be found and used for the plot.&lt;\/p&gt;&lt;p&gt;# halfspace res: Define the resolution of the half space projection. This will significantly affect the time to run the analysis.&lt;\/p&gt;&lt;p&gt;# polar plot res: Define the resolution of the polat plots.&lt;\/p&gt;&lt;p&gt;#&lt;\/p&gt;&lt;p&gt;# Output properties&lt;\/p&gt;&lt;p&gt;# XY, YZ, XZ: E, |E|^2, |H|^2 far field profile of scattered field in plane, as a function of frequency&lt;\/p&gt;&lt;p&gt;# XY_halfspace: E, |E|^2, |H|^2 in full upper\/lower half space,, as a function of frequency. Similar to standard projection from a single monitor&lt;\/p&gt;&lt;p&gt;#&lt;\/p&gt;&lt;p&gt;# Tags: far field projection closed box&lt;\/p&gt;&lt;p&gt;#&lt;\/p&gt;&lt;p&gt;# Copyright 2015 Lumerical Solutions Inc&lt;\/p&gt;&lt;p&gt;##############################################&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;##############################################&lt;\/p&gt;&lt;p&gt;# automatically unfold field data if symmetry BC is applied&lt;\/p&gt;&lt;p&gt;if (havedata(&#8220;x1&#8221;, &#8220;f&#8221;)) {&lt;\/p&gt;&lt;p&gt;symm_x = 0;&lt;\/p&gt;&lt;p&gt;} else {&lt;\/p&gt;&lt;p&gt;xtemp = getdata(&#8220;y2&#8221;, &#8220;x&#8221;);&lt;\/p&gt;&lt;p&gt;ztemp = getdata(&#8220;y2&#8221;, &#8220;z&#8221;);&lt;\/p&gt;&lt;p&gt;Eztemp = pinch(getdata(&#8220;y2&#8221;, &#8220;Ez&#8221;));&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;Ez2mid = sum(Eztemp(round(length(xtemp)\/2), 1:length(ztemp))^2);&lt;\/p&gt;&lt;p&gt;if (Ez2mid != 0) {&lt;\/p&gt;&lt;p&gt;symm_x = 1;&lt;\/p&gt;&lt;p&gt;} else {&lt;\/p&gt;&lt;p&gt;symm_x = -1;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;if (havedata(&#8220;y1&#8221;, &#8220;f&#8221;)) {&lt;\/p&gt;&lt;p&gt;symm_y = 0;&lt;\/p&gt;&lt;p&gt;} else {&lt;\/p&gt;&lt;p&gt;ytemp = getdata(&#8220;x2&#8221;, &#8220;y&#8221;);&lt;\/p&gt;&lt;p&gt;ztemp = getdata(&#8220;x2&#8221;, &#8220;z&#8221;);&lt;\/p&gt;&lt;p&gt;Eztemp = pinch(getdata(&#8220;x2&#8221;, &#8220;Ez&#8221;));&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;Ez2mid = sum(Eztemp(round(length(ytemp)\/2), 1:length(ztemp))^2);&lt;\/p&gt;&lt;p&gt;if (Ez2mid != 0) {&lt;\/p&gt;&lt;p&gt;symm_y = 1;&lt;\/p&gt;&lt;p&gt;} else {&lt;\/p&gt;&lt;p&gt;symm_y = -1;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;if(include_sub){&lt;\/p&gt;&lt;p&gt;if (havedata(&#8220;z1&#8221;, &#8220;f&#8221;)) {&lt;\/p&gt;&lt;p&gt;symm_z = 0;&lt;\/p&gt;&lt;p&gt;} else {&lt;\/p&gt;&lt;p&gt;xtemp = getdata(&#8220;y2&#8221;, &#8220;x&#8221;);&lt;\/p&gt;&lt;p&gt;ztemp = getdata(&#8220;y2&#8221;, &#8220;z&#8221;);&lt;\/p&gt;&lt;p&gt;Eytemp = pinch(getdata(&#8220;y2&#8221;, &#8220;Ey&#8221;));&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;Ey2mid = sum(Eytemp(1:length(xtemp), round(length(ztemp)\/2))^2);&lt;\/p&gt;&lt;p&gt;if (Ey2mid != 0) {&lt;\/p&gt;&lt;p&gt;symm_z = 1;&lt;\/p&gt;&lt;p&gt;} else {&lt;\/p&gt;&lt;p&gt;symm_z = -1;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;f = getdata(&#8220;x2&#8243;,&#8221;f&#8221;); # get freqency data&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;if (havedata(&#8220;index&#8221;,&#8221;index_x&#8221;)) { # get refractive index. Required to calcualte H2 from E2&lt;\/p&gt;&lt;p&gt;n_index = getdata(&#8220;index&#8221;,&#8221;index_x&#8221;);&lt;\/p&gt;&lt;p&gt;} else {&lt;\/p&gt;&lt;p&gt;n_index = getdata(&#8220;index&#8221;,&#8221;index_z&#8221;);&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;##############################################&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;# define the angular resolution&lt;\/p&gt;&lt;p&gt;phi = linspace(0,360,%polar plot res%); # user-modifiable in the Variables tab&lt;\/p&gt;&lt;p&gt;npts = length(phi);&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;# define the field data matrices for angular distribution&lt;\/p&gt;&lt;p&gt;E_xy = matrix(npts, 3, length(f)); # 3 for x, y, z component&lt;\/p&gt;&lt;p&gt;E_yz = matrix(npts, 3, length(f)); # 3 for x, y, z component&lt;\/p&gt;&lt;p&gt;E_xz = matrix(npts, 3, length(f)); # 3 for x, y, z component&lt;\/p&gt;&lt;p&gt;E2_xy = matrix(npts,length(f));&lt;\/p&gt;&lt;p&gt;E2_yz = matrix(npts,length(f));&lt;\/p&gt;&lt;p&gt;E2_xz = matrix(npts,length(f));&lt;\/p&gt;&lt;p&gt;H2_xy = matrix(npts,length(f));&lt;\/p&gt;&lt;p&gt;H2_yz = matrix(npts,length(f));&lt;\/p&gt;&lt;p&gt;H2_xz = matrix(npts,length(f));&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;# Identify the closest wavelength to target:&lt;\/p&gt;&lt;p&gt;target_wavelength = %target wavelength%;&lt;\/p&gt;&lt;p&gt;i_target = find(f,c\/target_wavelength);&lt;\/p&gt;&lt;p&gt;?&#8221;Target wavelength = &#8221; + num2str(target_wavelength);&lt;\/p&gt;&lt;p&gt;?&#8221;Wavelength used = &#8221; + num2str(c\/f(i_target));&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;if (havedata(&#8220;z2&#8243;,&#8221;Ex&#8221;)) { # have z data, 3D simulation&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;##############################################&lt;\/p&gt;&lt;p&gt;# Angular distribution calculation for a 3D simulation begins&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;for (i = 1:length(f)){ # loop for all frequencies&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;# print the frequency point number running in the loop&lt;\/p&gt;&lt;p&gt;?&#8221;Angular distribution i=&#8221;+num2str(i)+&#8221;, &#8220;+num2str(c\/f(i)*1e6)+&#8221;um&#8221;;&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;n = n_index(i); # select the frequency point for the index&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;######## x-y plane (phi=0 corresponds to the direction (1,0,0))&lt;\/p&gt;&lt;p&gt;?&#8221; Projecting in x-y plane&#8221;;&lt;\/p&gt;&lt;p&gt;x = cos(phi*pi\/180); y = sin(phi*pi\/180); z = 0;&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;# Calculate far field by summing contribution from each monitor&lt;\/p&gt;&lt;p&gt;temp = farfieldexact(&#8220;x2&#8221;,x,y,z,i) + farfieldexact(&#8220;y2&#8221;,x,y,z,i) + farfieldexact(&#8220;z2&#8221;,x,y,z,i);&lt;\/p&gt;&lt;p&gt;if(havedata(&#8220;x1&#8221;)){&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; farfieldexact(&#8220;x1&#8221;,x,y,z,i);&lt;\/p&gt;&lt;p&gt;}else{&lt;\/p&gt;&lt;p&gt;temp2 = farfieldexact(&#8220;x2&#8221;,-x,y,z,i);&lt;\/p&gt;&lt;p&gt;s = symm_x*[1,-1,-1];&lt;\/p&gt;&lt;p&gt;temp2(1:npts,1) = s(1)*temp2(1:npts,1);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,2) = s(2)*temp2(1:npts,2);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,3) = s(3)*temp2(1:npts,3);&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; temp2;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;if(havedata(&#8220;y1&#8221;)){&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; farfieldexact(&#8220;y1&#8221;,x,y,z,i);&lt;\/p&gt;&lt;p&gt;}else{&lt;\/p&gt;&lt;p&gt;temp2 = farfieldexact(&#8220;y2&#8221;,x,-y,z,i);&lt;\/p&gt;&lt;p&gt;s = symm_y*[-1,1,-1];&lt;\/p&gt;&lt;p&gt;temp2(1:npts,1) = s(1)*temp2(1:npts,1);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,2) = s(2)*temp2(1:npts,2);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,3) = s(3)*temp2(1:npts,3);&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; temp2;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;if(include_sub){&lt;\/p&gt;&lt;p&gt;if(havedata(&#8220;z1&#8221;)){&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; farfieldexact(&#8220;z1&#8221;,x,y,z,i);&lt;\/p&gt;&lt;p&gt;}else{&lt;\/p&gt;&lt;p&gt;temp2 = farfieldexact(&#8220;z2&#8243;,x,y,-z,i);&lt;\/p&gt;&lt;p&gt;s = symm_z*[-1,-1,1];&lt;\/p&gt;&lt;p&gt;temp2(1:npts,1) = s(1)*temp2(1:npts,1);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,2) = s(2)*temp2(1:npts,2);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,3) = s(3)*temp2(1:npts,3);&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; temp2;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;E_xy (1:length(phi), 1:3, i) = temp;&lt;\/p&gt;&lt;p&gt;E2_xy (1:length(phi), i) = sum(abs(temp)^2,2); # E2 = |Ex|^2 + |Ey|^2 + |Ez|^2&lt;\/p&gt;&lt;p&gt;H2_xy (1:length(phi), i) = E2_xy (1:length(phi), i) * n^2 * eps0\/mu0; # for a plane wave, E^2 and H^2 only differ by a factor of n^2*eps0\/mu0&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;######## y-z plane (phi=0 corresponds to the direction (0,1,0))&lt;\/p&gt;&lt;p&gt;?&#8221; Projecting in y-z plane&#8221;;&lt;\/p&gt;&lt;p&gt;x = 0; y = cos(phi*pi\/180); z = sin(phi*pi\/180);&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;# Calculate far field by summing contribution from each monitor&lt;\/p&gt;&lt;p&gt;temp = farfieldexact(&#8220;x2&#8221;,x,y,z,i) + farfieldexact(&#8220;y2&#8221;,x,y,z,i) + farfieldexact(&#8220;z2&#8221;,x,y,z,i);&lt;\/p&gt;&lt;p&gt;if(havedata(&#8220;x1&#8221;)){&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; farfieldexact(&#8220;x1&#8221;,x,y,z,i);&lt;\/p&gt;&lt;p&gt;}else{&lt;\/p&gt;&lt;p&gt;temp2 = farfieldexact(&#8220;x2&#8221;,-x,y,z,i);&lt;\/p&gt;&lt;p&gt;s = symm_x*[1,-1,-1];&lt;\/p&gt;&lt;p&gt;temp2(1:npts,1) = s(1)*temp2(1:npts,1);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,2) = s(2)*temp2(1:npts,2);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,3) = s(3)*temp2(1:npts,3);&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; temp2;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;if(havedata(&#8220;y1&#8221;)){&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; farfieldexact(&#8220;y1&#8221;,x,y,z,i);&lt;\/p&gt;&lt;p&gt;}else{&lt;\/p&gt;&lt;p&gt;temp2 = farfieldexact(&#8220;y2&#8221;,x,-y,z,i);&lt;\/p&gt;&lt;p&gt;s = symm_y*[-1,1,-1];&lt;\/p&gt;&lt;p&gt;temp2(1:npts,1) = s(1)*temp2(1:npts,1);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,2) = s(2)*temp2(1:npts,2);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,3) = s(3)*temp2(1:npts,3);&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; temp2;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;if(include_sub){&lt;\/p&gt;&lt;p&gt;if(havedata(&#8220;z1&#8221;)){&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; farfieldexact(&#8220;z1&#8221;,x,y,z,i);&lt;\/p&gt;&lt;p&gt;}else{&lt;\/p&gt;&lt;p&gt;temp2 = farfieldexact(&#8220;z2&#8243;,x,y,-z,i);&lt;\/p&gt;&lt;p&gt;s = symm_z*[-1,-1,1];&lt;\/p&gt;&lt;p&gt;temp2(1:npts,1) = s(1)*temp2(1:npts,1);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,2) = s(2)*temp2(1:npts,2);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,3) = s(3)*temp2(1:npts,3);&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; temp2;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;E_yz (1:length(phi), 1:3, i) = temp;&lt;\/p&gt;&lt;p&gt;E2_yz (1:length(phi), i) = sum(abs(temp)^2,2); # E2 = |Ex|^2 + |Ey|^2 + |Ez|^2&lt;\/p&gt;&lt;p&gt;H2_yz (1:length(phi), i) = E2_yz (1:length(phi), i) * n^2 * eps0\/mu0; # for a plane wave, E^2 and H^2 only differ by a factor of n^2*eps0\/mu0&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;######### x-z plane (phi=0 corresponds to the direction (1,0,0))&lt;\/p&gt;&lt;p&gt;?&#8221; Projecting in x-z plane&#8221;;&lt;\/p&gt;&lt;p&gt;x = cos(phi*pi\/180); y = 0; z = sin(phi*pi\/180);&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;# Calculate far field by summing contribution from each monitor&lt;\/p&gt;&lt;p&gt;temp = farfieldexact(&#8220;x2&#8221;,x,y,z,i) + farfieldexact(&#8220;y2&#8221;,x,y,z,i) + farfieldexact(&#8220;z2&#8221;,x,y,z,i);&lt;\/p&gt;&lt;p&gt;if(havedata(&#8220;x1&#8221;)){&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; farfieldexact(&#8220;x1&#8221;,x,y,z,i);&lt;\/p&gt;&lt;p&gt;}else{&lt;\/p&gt;&lt;p&gt;temp2 = farfieldexact(&#8220;x2&#8221;,-x,y,z,i);&lt;\/p&gt;&lt;p&gt;s = symm_x*[1,-1,-1];&lt;\/p&gt;&lt;p&gt;temp2(1:npts,1) = s(1)*temp2(1:npts,1);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,2) = s(2)*temp2(1:npts,2);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,3) = s(3)*temp2(1:npts,3);&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; temp2;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;if(havedata(&#8220;y1&#8221;)){&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; farfieldexact(&#8220;y1&#8221;,x,y,z,i);&lt;\/p&gt;&lt;p&gt;}else{&lt;\/p&gt;&lt;p&gt;temp2 = farfieldexact(&#8220;y2&#8221;,x,-y,z,i);&lt;\/p&gt;&lt;p&gt;s = symm_y*[-1,1,-1];&lt;\/p&gt;&lt;p&gt;temp2(1:npts,1) = s(1)*temp2(1:npts,1);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,2) = s(2)*temp2(1:npts,2);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,3) = s(3)*temp2(1:npts,3);&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; temp2;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;if(include_sub){&lt;\/p&gt;&lt;p&gt;if(havedata(&#8220;z1&#8221;)){&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; farfieldexact(&#8220;z1&#8221;,x,y,z,i);&lt;\/p&gt;&lt;p&gt;}else{&lt;\/p&gt;&lt;p&gt;temp2 = farfieldexact(&#8220;z2&#8243;,x,y,-z,i);&lt;\/p&gt;&lt;p&gt;s = symm_z*[-1,-1,1];&lt;\/p&gt;&lt;p&gt;temp2(1:npts,1) = s(1)*temp2(1:npts,1);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,2) = s(2)*temp2(1:npts,2);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,3) = s(3)*temp2(1:npts,3);&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; temp2;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;E_xz (1:length(phi), 1:3, i) = temp;&lt;\/p&gt;&lt;p&gt;E2_xz (1:length(phi), i) = sum(abs(temp)^2,2); # E2 = |Ex|^2 + |Ey|^2 + |Ez|^2&lt;\/p&gt;&lt;p&gt;H2_xz (1:length(phi), i) = E2_xz (1:length(phi), i) * n^2 * eps0\/mu0; # for a plane wave, E^2 and H^2 only differ by a factor of n^2*eps0\/mu0&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;} # end of the angular distribution for loop&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;if (%do polar plot%) { # polar plot for target wavelength&lt;\/p&gt;&lt;p&gt;polar(phi*pi\/180, E2_xy(1:length(phi), i_target), E2_yz(1:length(phi), i_target), E2_xz(1:length(phi), i_target),&lt;\/p&gt;&lt;p&gt;&#8221;angle (degrees)&#8221;, &#8220;|E|^2&#8221;, &#8220;|E|^2 vs angle @ &#8220;+num2str(c\/f(i_target)*1e6)+&#8221;um&#8221;);&lt;\/p&gt;&lt;p&gt;legend(&#8220;xy plane&#8221;,&#8221;yz plane&#8221;,&#8221;xz plane&#8221;);&lt;\/p&gt;&lt;p&gt;} # end of if polar plot&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;# create datasets for XY, YZ, XZ for angular distribution&lt;\/p&gt;&lt;p&gt;XY = matrixdataset(&#8220;XY&#8221;);&lt;\/p&gt;&lt;p&gt;XY.addparameter(&#8220;phi&#8221;,phi*pi\/180.); #phi angle in radians&lt;\/p&gt;&lt;p&gt;XY.addparameter(&#8220;lambda&#8221;,c\/f,&#8221;f&#8221;,f);&lt;\/p&gt;&lt;p&gt;XY.addattribute(&#8220;E&#8221;,pinch(E_xy,2,1),pinch(E_xy,2,2),pinch(E_xy,2,3)); # Ex, Ey, Ez&lt;\/p&gt;&lt;p&gt;XY.addattribute(&#8220;E2&#8221;,E2_xy);&lt;\/p&gt;&lt;p&gt;XY.addattribute(&#8220;H2&#8221;,H2_xy);&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;YZ = matrixdataset(&#8220;YZ&#8221;);&lt;\/p&gt;&lt;p&gt;YZ.addparameter(&#8220;phi&#8221;,phi*pi\/180.); #phi angle in radians&lt;\/p&gt;&lt;p&gt;YZ.addparameter(&#8220;lambda&#8221;,c\/f,&#8221;f&#8221;,f);&lt;\/p&gt;&lt;p&gt;YZ.addattribute(&#8220;E&#8221;,pinch(E_yz,2,1),pinch(E_yz,2,2),pinch(E_yz,2,3)); # Ex, Ey, Ez&lt;\/p&gt;&lt;p&gt;YZ.addattribute(&#8220;E2&#8221;,E2_yz);&lt;\/p&gt;&lt;p&gt;YZ.addattribute(&#8220;H2&#8221;,H2_yz);&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;XZ = matrixdataset(&#8220;XZ&#8221;);&lt;\/p&gt;&lt;p&gt;XZ.addparameter(&#8220;phi&#8221;,phi*pi\/180.); #phi angle in radians&lt;\/p&gt;&lt;p&gt;XZ.addparameter(&#8220;lambda&#8221;,c\/f,&#8221;f&#8221;,f);&lt;\/p&gt;&lt;p&gt;XZ.addattribute(&#8220;E&#8221;,pinch(E_xz,2,1),pinch(E_xz,2,2),pinch(E_xz,2,3)); # Ex, Ey, Ez&lt;\/p&gt;&lt;p&gt;XZ.addattribute(&#8220;E2&#8221;,E2_xz);&lt;\/p&gt;&lt;p&gt;XZ.addattribute(&#8220;H2&#8243;,H2_xz);&lt;\/p&gt;&lt;p&gt;# end of the angular distribution for a 3D simulation&lt;\/p&gt;&lt;p&gt;##############################################&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;##############################################&lt;\/p&gt;&lt;p&gt;# Halfspace calculation for a 3D simulation begins&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;# calculate the far field in XY upper\/lower half space&lt;\/p&gt;&lt;p&gt;if (%do halfspace%) {&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;res = %halfspace res%; # projection resolution, user-modifiable in the Variables tab&lt;\/p&gt;&lt;p&gt;u1 = linspace(-1,1,res);&lt;\/p&gt;&lt;p&gt;u2 = u1;&lt;\/p&gt;&lt;p&gt;X = meshgridx(u1,u2); # These three lines define the orientation of the hemisphere (ie. XY based halfspace)&lt;\/p&gt;&lt;p&gt;Y = meshgridy(u1,u2);&lt;\/p&gt;&lt;p&gt;Z = sqrt(1-X^2-Y^2);&lt;\/p&gt;&lt;p&gt;filter = abs(imag(Z))&lt;=0; # filter out any values outside of hemisphere&lt;\/p&gt;&lt;p&gt;filter2=matrix(res,res,length(f)); # same as filter, just for all frequencies&lt;\/p&gt;&lt;p&gt;filter3=matrix(res,res,3,length(f)); # same as filter2, just for all frequencies, Ex, Ey, Ez&lt;\/p&gt;&lt;p&gt;for (j=1:length(f)){ # just for filter2 and fitler3 for all frequencies&lt;\/p&gt;&lt;p&gt;filter2(1:res,1:res,j)=filter;&lt;\/p&gt;&lt;p&gt;filter3(1:res,1:res,1,j)=filter; filter3(1:res,1:res,2,j)=filter; filter3(1:res,1:res,3,j)=filter;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;x = reshape(X,[res^2,1]); # reshape coordinate matrix into a vector. This is the required form for farfieldexact.&lt;\/p&gt;&lt;p&gt;y = reshape(Y,[res^2,1]);&lt;\/p&gt;&lt;p&gt;z = reshape(Z,[res^2,1]);&lt;\/p&gt;&lt;p&gt;x = [x,x]; # Concatenate a 2nd copy of the vector, for the lower half space&lt;\/p&gt;&lt;p&gt;y = [y,y];&lt;\/p&gt;&lt;p&gt;z = [z,-z];&lt;\/p&gt;&lt;p&gt;npts = length(z); # size of position vector&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;# define halfspace dataset&lt;\/p&gt;&lt;p&gt;E_XY_halfspace = matrix (2*res^2,3,length(f));&lt;\/p&gt;&lt;p&gt;E2_XY_halfspace = matrix (2*res^2,length(f));&lt;\/p&gt;&lt;p&gt;H2_XY_halfspace = matrix (2*res^2,length(f));&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;for (i = 1 : length(f)) { # loop for all frequency points&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;?&#8221;Projecting in XY upper half space, i=&#8221; + num2str(i)+&#8221;, &#8220;+num2str(c\/f(i)*1e6)+&#8221;um&#8221;;&lt;\/p&gt;&lt;p&gt;# Calculate far field by summing contribution from each monitor&lt;\/p&gt;&lt;p&gt;temp = farfieldexact(&#8220;x2&#8221;,x,y,z,i) + farfieldexact(&#8220;y2&#8221;,x,y,z,i) + farfieldexact(&#8220;z2&#8221;,x,y,z,i);&lt;\/p&gt;&lt;p&gt;if(havedata(&#8220;x1&#8221;)){&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; farfieldexact(&#8220;x1&#8221;,x,y,z,i);&lt;\/p&gt;&lt;p&gt;}else{&lt;\/p&gt;&lt;p&gt;temp2 = farfieldexact(&#8220;x2&#8221;,-x,y,z,i);&lt;\/p&gt;&lt;p&gt;s = symm_x*[1,-1,-1];&lt;\/p&gt;&lt;p&gt;temp2(1:npts,1) = s(1)*temp2(1:npts,1);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,2) = s(2)*temp2(1:npts,2);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,3) = s(3)*temp2(1:npts,3);&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; temp2;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;if(havedata(&#8220;y1&#8221;)){&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; farfieldexact(&#8220;y1&#8221;,x,y,z,i);&lt;\/p&gt;&lt;p&gt;}else{&lt;\/p&gt;&lt;p&gt;temp2 = farfieldexact(&#8220;y2&#8221;,x,-y,z,i);&lt;\/p&gt;&lt;p&gt;s = symm_y*[-1,1,-1];&lt;\/p&gt;&lt;p&gt;temp2(1:npts,1) = s(1)*temp2(1:npts,1);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,2) = s(2)*temp2(1:npts,2);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,3) = s(3)*temp2(1:npts,3);&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; temp2;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;if(include_sub){&lt;\/p&gt;&lt;p&gt;if(havedata(&#8220;z1&#8221;)){&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; farfieldexact(&#8220;z1&#8221;,x,y,z,i);&lt;\/p&gt;&lt;p&gt;}else{&lt;\/p&gt;&lt;p&gt;temp2 = farfieldexact(&#8220;z2&#8221;,x,y,-z,i);&lt;\/p&gt;&lt;p&gt;s = symm_z*[-1,-1,1];&lt;\/p&gt;&lt;p&gt;temp2(1:npts,1) = s(1)*temp2(1:npts,1);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,2) = s(2)*temp2(1:npts,2);&lt;\/p&gt;&lt;p&gt;temp2(1:npts,3) = s(3)*temp2(1:npts,3);&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; temp2;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;E_XY_halfspace (1:2*res^2,1:3,i) = temp;&lt;\/p&gt;&lt;p&gt;E2_XY_halfspace (1:2*res^2,i)= sum(abs(temp)^2,2); # E2 = |Ex|^2 + |Ey|^2 + |Ez|^2&lt;\/p&gt;&lt;p&gt;} # end of halfspace for loop&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;E_XY_upper_halfspace = E_XY_halfspace(1:res^2,1:3,1:length(f)); # separate the upper\/lower data&lt;\/p&gt;&lt;p&gt;E_XY_lower_halfspace = E_XY_halfspace((res^2+1):(2*res^2),1:3,1:length(f));&lt;\/p&gt;&lt;p&gt;E_XY_upper_halfspace = reshape(E_XY_upper_halfspace,[res,res,3,length(f)]); # reshape the data back into a 2D matrix&lt;\/p&gt;&lt;p&gt;E_XY_lower_halfspace = reshape(E_XY_lower_halfspace,[res,res,3,length(f)]);&lt;\/p&gt;&lt;p&gt;E_XY_upper_halfspace = E_XY_upper_halfspace*filter3; # set all values outside of hemisphere (ie. the corners of the matrices) to zero&lt;\/p&gt;&lt;p&gt;E_XY_lower_halfspace = E_XY_lower_halfspace*filter3;&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;E2_XY_upper_halfspace = E2_XY_halfspace(1:res^2,1:length(f)); # separate the upper\/lower data&lt;\/p&gt;&lt;p&gt;E2_XY_lower_halfspace = E2_XY_halfspace((res^2+1):(2*res^2),1:length(f));&lt;\/p&gt;&lt;p&gt;E2_XY_upper_halfspace = reshape(E2_XY_upper_halfspace,[res,res,length(f)]); # reshape the data back into a 2D matrix&lt;\/p&gt;&lt;p&gt;E2_XY_lower_halfspace = reshape(E2_XY_lower_halfspace,[res,res,length(f)]);&lt;\/p&gt;&lt;p&gt;E2_XY_upper_halfspace = E2_XY_upper_halfspace*filter2; # set all values outside of hemisphere (ie. the corners of the matrices) to zero&lt;\/p&gt;&lt;p&gt;E2_XY_lower_halfspace = E2_XY_lower_halfspace*filter2;&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;# create halfspace dataset&lt;\/p&gt;&lt;p&gt;XY_halfspace = matrixdataset(&#8220;XY_halfspace&#8221;);&lt;\/p&gt;&lt;p&gt;XY_halfspace.addparameter(&#8220;ux&#8221;,u1);&lt;\/p&gt;&lt;p&gt;XY_halfspace.addparameter(&#8220;uy&#8221;,u2);&lt;\/p&gt;&lt;p&gt;XY_halfspace.addparameter(&#8220;lambda&#8221;,c\/f,&#8221;f&#8221;,f);&lt;\/p&gt;&lt;p&gt;XY_halfspace.addattribute(&#8220;E_upper&#8221;,pinch(E_XY_upper_halfspace,3,1),pinch(E_XY_upper_halfspace,3,2),pinch(E_XY_upper_halfspace,3,3));&lt;\/p&gt;&lt;p&gt;XY_halfspace.addattribute(&#8220;E_lower&#8221;,pinch(E_XY_lower_halfspace,3,1),pinch(E_XY_lower_halfspace,3,2),pinch(E_XY_lower_halfspace,3,3));&lt;\/p&gt;&lt;p&gt;XY_halfspace.addattribute(&#8220;E2_upper&#8221;,E2_XY_upper_halfspace);&lt;\/p&gt;&lt;p&gt;XY_halfspace.addattribute(&#8220;E2_lower&#8221;,E2_XY_lower_halfspace);&lt;\/p&gt;&lt;p&gt;XY_halfspace.addattribute(&#8220;H2_upper&#8221;,E2_XY_upper_halfspace * n^2*eps0\/mu0);&lt;\/p&gt;&lt;p&gt;XY_halfspace.addattribute(&#8220;H2_lower&#8221;,E2_XY_lower_halfspace * n^2*eps0\/mu0);&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;# end of the halfspace calculation for a 3D simulation&lt;\/p&gt;&lt;p&gt;##############################################&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;# end of 3D&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;} else {&lt;\/p&gt;&lt;p&gt;##############################################&lt;\/p&gt;&lt;p&gt;# Angular distribution for a 2D simulation, only for the XY plane&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;for (i = 1 : length(f)) { # for all frequency points&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;n = n_index(i); # select the frequency point for the index&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;# x-y plane (phi=0 corresponds to the direction (0,1,0))&lt;\/p&gt;&lt;p&gt;?&#8221; Projecting in x-y plane. 2D simulation.&#8221;;&lt;\/p&gt;&lt;p&gt;x = -sin(phi*pi\/180);&lt;\/p&gt;&lt;p&gt;y = cos(phi*pi\/180);&lt;\/p&gt;&lt;p&gt;z = 0;&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;temp = farfieldexact(&#8220;x2&#8221;,x,y,i) + farfieldexact(&#8220;y2&#8221;,x,y,i);&lt;\/p&gt;&lt;p&gt;if(havedata(&#8220;x1&#8221;)){&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; farfieldexact(&#8220;x1&#8221;,x,y,i);&lt;\/p&gt;&lt;p&gt;}else{&lt;\/p&gt;&lt;p&gt;temp2 = farfieldexact(&#8220;x2&#8221;,-x,y,i);&lt;\/p&gt;&lt;p&gt;s = symm_x*[1,-1,-1];&lt;\/p&gt;&lt;p&gt;temp2(1:length(phi),1) = s(1)*temp2(1:length(phi),1);&lt;\/p&gt;&lt;p&gt;temp2(1:length(phi),2) = s(2)*temp2(1:length(phi),2);&lt;\/p&gt;&lt;p&gt;temp2(1:length(phi),3) = s(3)*temp2(1:length(phi),3);&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; temp2;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;if(havedata(&#8220;y1&#8221;)){&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; farfieldexact(&#8220;y1&#8221;,x,y,i);&lt;\/p&gt;&lt;p&gt;}else{&lt;\/p&gt;&lt;p&gt;temp2 = farfieldexact(&#8220;y2&#8221;,x,-y,i);&lt;\/p&gt;&lt;p&gt;s = symm_y*[-1,1,-1];&lt;\/p&gt;&lt;p&gt;temp2(1:length(phi),1) = s(1)*temp2(1:length(phi),1);&lt;\/p&gt;&lt;p&gt;temp2(1:length(phi),2) = s(2)*temp2(1:length(phi),2);&lt;\/p&gt;&lt;p&gt;temp2(1:length(phi),3) = s(3)*temp2(1:length(phi),3);&lt;\/p&gt;&lt;p&gt;temp = temp &#8211; temp2;&lt;\/p&gt;&lt;p&gt;}&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;E_xy (1:length(phi), 1:3, i) = temp;&lt;\/p&gt;&lt;p&gt;E2_xy (1:length(phi), i) = sum(abs(temp)^2,2); # E2 = |Ex|^2 + |Ey|^2 + |Ez|^2&lt;\/p&gt;&lt;p&gt;H2_xy (1:length(phi), i) = E2_xy (1:length(phi), i) * n^2 * eps0\/mu0; # for a plane wave, E^2 and H^2 only differ by a factor of n^2*eps0\/mu0&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;} # end of for loop 2D&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;if (%do polar plot%) { # polar plot for target wavelength&lt;\/p&gt;&lt;p&gt;polar(phi*pi\/180, E2_xy(1:length(phi), i_target), &#8220;angle (degrees)&#8221;, &#8220;|E|^2&#8221;, &#8220;|E|^2 vs angle @ &#8220;+num2str(c\/f(i_target)*1e6)+&#8221;um&#8221;);&lt;\/p&gt;&lt;p&gt;legend(&#8220;xy plane&#8221;);&lt;\/p&gt;&lt;p&gt;} # end of if polar plot&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;# create dataset for XY&lt;\/p&gt;&lt;p&gt;XY = matrixdataset(&#8220;XY&#8221;);&lt;\/p&gt;&lt;p&gt;XY.addparameter(&#8220;phi&#8221;,phi*pi\/180.); #phi angle in radians&lt;\/p&gt;&lt;p&gt;XY.addparameter(&#8220;lambda&#8221;,c\/f,&#8221;f&#8221;,f);&lt;\/p&gt;&lt;p&gt;XY.addattribute(&#8220;E&#8221;,pinch(E_xy,2,1),pinch(E_xy,2,2),pinch(E_xy,2,3)); # Ex, Ey, Ez&lt;\/p&gt;&lt;p&gt;XY.addattribute(&#8220;E2&#8221;,E2_xy);&lt;\/p&gt;&lt;p&gt;XY.addattribute(&#8220;H2&#8221;,H2_xy);&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;} # end of angular distribution for 2D simulation&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;<\/p>\n","protected":false},"template":"","class_list":["post-363805","reply","type-reply","status-publish","hentry"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Hello Amrita,Thank you for the reply and a detailed explanation of farfield analysis group and the corrected script.I run the simulation with the script suggested here. But, It is generating an error:Target wavelength = 1.54e-06Wavelength used = 1.54e-06Angular distribution i=1, 1.54umProjecting in x-y planeProjecting in y-z planeProjecting in x-z planeError: Result\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/363805\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Ansys Learning Forum | Ansys Innovation Space\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Reply To: Regarding box of monitors and far field simulations | Ansys Learning Forum\" \/>\n\t\t<meta property=\"og:description\" content=\"Hello Amrita,Thank you for the reply and a detailed explanation of farfield analysis group and the corrected script.I run the simulation with the script suggested here. But, It is generating an error:Target wavelength = 1.54e-06Wavelength used = 1.54e-06Angular distribution i=1, 1.54umProjecting in x-y planeProjecting in y-z planeProjecting in x-z planeError: Result\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/363805\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2024-04-23T17:51:40+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-04-23T17:51:40+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Reply To: Regarding box of monitors and far field simulations | Ansys Learning Forum\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Hello Amrita,Thank you for the reply and a detailed explanation of farfield analysis group and the corrected script.I run the simulation with the script suggested here. But, It is generating an error:Target wavelength = 1.54e-06Wavelength used = 1.54e-06Angular distribution i=1, 1.54umProjecting in x-y planeProjecting in y-z planeProjecting in x-z planeError: Result\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/reply\\\/363805\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/reply\\\/363805\\\/#listItem\",\"name\":\"Reply To: Regarding box of monitors and far field simulations\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/reply\\\/363805\\\/#listItem\",\"position\":2,\"name\":\"Reply To: Regarding box of monitors and far field simulations\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"name\":\"Home\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/reply\\\/363805\\\/#webpage\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/reply\\\/363805\\\/\",\"name\":\"Reply To: Regarding box of monitors and far field simulations | Ansys Learning Forum\",\"description\":\"Hello Amrita,Thank you for the reply and a detailed explanation of farfield analysis group and the corrected script.I run the simulation with the script suggested here. But, It is generating an error:Target wavelength = 1.54e-06Wavelength used = 1.54e-06Angular distribution i=1, 1.54umProjecting in x-y planeProjecting in y-z planeProjecting in x-z planeError: Result\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/reply\\\/363805\\\/#breadcrumblist\"},\"datePublished\":\"2024-04-23T17:51:40+00:00\",\"dateModified\":\"2024-04-23T17:51:40+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Reply To: Regarding box of monitors and far field simulations | Ansys Learning Forum","description":"Hello Amrita,Thank you for the reply and a detailed explanation of farfield analysis group and the corrected script.I run the simulation with the script suggested here. But, It is generating an error:Target wavelength = 1.54e-06Wavelength used = 1.54e-06Angular distribution i=1, 1.54umProjecting in x-y planeProjecting in y-z planeProjecting in x-z planeError: Result","canonical_url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/363805\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/363805\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","position":1,"name":"Home","item":"https:\/\/innovationspace.ansys.com\/forum","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/363805\/#listItem","name":"Reply To: Regarding box of monitors and far field simulations"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/363805\/#listItem","position":2,"name":"Reply To: Regarding box of monitors and far field simulations","previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","name":"Home"}}]},{"@type":"Organization","@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization","name":"Ansys Learning Forum","description":"Ansys Innovation Space","url":"https:\/\/innovationspace.ansys.com\/forum\/"},{"@type":"WebPage","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/363805\/#webpage","url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/363805\/","name":"Reply To: Regarding box of monitors and far field simulations | Ansys Learning Forum","description":"Hello Amrita,Thank you for the reply and a detailed explanation of farfield analysis group and the corrected script.I run the simulation with the script suggested here. But, It is generating an error:Target wavelength = 1.54e-06Wavelength used = 1.54e-06Angular distribution i=1, 1.54umProjecting in x-y planeProjecting in y-z planeProjecting in x-z planeError: Result","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#website"},"breadcrumb":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/363805\/#breadcrumblist"},"datePublished":"2024-04-23T17:51:40+00:00","dateModified":"2024-04-23T17:51:40+00:00"},{"@type":"WebSite","@id":"https:\/\/innovationspace.ansys.com\/forum\/#website","url":"https:\/\/innovationspace.ansys.com\/forum\/","name":"Ansys Learning Forum","description":"Ansys Innovation Space","inLanguage":"en-US","publisher":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization"}}]},"og:locale":"en_US","og:site_name":"Ansys Learning Forum | Ansys Innovation Space","og:type":"article","og:title":"Reply To: Regarding box of monitors and far field simulations | Ansys Learning Forum","og:description":"Hello Amrita,Thank you for the reply and a detailed explanation of farfield analysis group and the corrected script.I run the simulation with the script suggested here. But, It is generating an error:Target wavelength = 1.54e-06Wavelength used = 1.54e-06Angular distribution i=1, 1.54umProjecting in x-y planeProjecting in y-z planeProjecting in x-z planeError: Result","og:url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/363805\/","article:published_time":"2024-04-23T17:51:40+00:00","article:modified_time":"2024-04-23T17:51:40+00:00","twitter:card":"summary_large_image","twitter:title":"Reply To: Regarding box of monitors and far field simulations | Ansys Learning Forum","twitter:description":"Hello Amrita,Thank you for the reply and a detailed explanation of farfield analysis group and the corrected script.I run the simulation with the script suggested here. But, It is generating an error:Target wavelength = 1.54e-06Wavelength used = 1.54e-06Angular distribution i=1, 1.54umProjecting in x-y planeProjecting in y-z planeProjecting in x-z planeError: Result"},"aioseo_meta_data":{"post_id":"363805","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"content","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":true,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2024-10-28 16:45:39","updated":"2024-10-28 16:45:39","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tReply To: Regarding box of monitors and far field simulations\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/innovationspace.ansys.com\/forum"},{"label":"Reply To: Regarding box of monitors and far field simulations","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/363805\/"}],"acf":[],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies\/363805","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/reply"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies\/363805\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=363805"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}