fixed observed far-field component

This commit is contained in:
2026-05-13 10:43:51 +02:00
parent 3cdb9e5f68
commit 32503e330c
2 changed files with 7 additions and 6 deletions
+4 -3
View File
@@ -197,7 +197,7 @@
"]\n",
"#mpa.Near2FarFields return a numpy array with shape (num_of_points,nfreq,6) where the \n",
"#third axis are the field components Ex,Ey,Ez,Hx,Hy,Hz\n",
"FarFields = mpa.Near2FarFields(sim,NearRegions,far_z)\n",
"FarFields = mpa.Near2FarFields(sim, NearRegions, far_z)\n",
"ob_list = [FarFields]\n",
"\n",
"#this the objective to function\n",
@@ -205,7 +205,7 @@
"def J1(FF):\n",
" #in this case we want to maximize field intensity\n",
" # at the position of the focal spot \n",
" obj_to_return = npa.mean(npa.abs(FF[0,:,1]) ** 2)\n",
" obj_to_return = npa.mean(npa.abs(FF[0,:,0]) ** 2)\n",
" return obj_to_return\n",
"#returns the first point of all frequencies of the Ey component"
]
@@ -258,7 +258,8 @@
")\n",
"\n",
"######CHECK PLOT######\n",
"figure = opt.plot2D(True, output_plane=output_plane)\n"
"figure = opt.plot2D(True, output_plane=output_plane)\n",
"plt.savefig(\"results/simulation_setup.pdf\")"
]
},
{