-
-
January 19, 2023 at 4:41 pm
Mike Neville
SubscriberHi all, I am trying to use the farfield3dintegrate function as part of a figure of merit for the FDTD optimasation feature, but am getting a message saying this is not a valid function despite it working fine in the script environment. The code i am using is below.
E = farfield.E2;
E=pinch(E);
ux = farfield.ux;
ux=pinch(ux);
uy = farfield.uy;
uy=pinch(uy);
NA=0.3;
acceptangle = asin(NA) *360/(2*pi);
out =1;# farfield3dintegrate(E, ux, uy, acceptangle);
out1 = farfield3dintegrate(E, ux, uy, 90);
powernorm= abs(power);
fom = powernorm * (out/out1);
Farfield is defined as a result in the optimization fom environment. Can anyone suggest why this function may not be working?
-
January 20, 2023 at 4:54 pm
Guilin Sun
Ansys EmployeeDid you use those script inside Optimization ? it only holds certain script to work there. The best way to do this is in the "model". Then you choose its output as the FOM during the optimization. Please try.
-
- You must be logged in to reply to this topic.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- “Import optical generation” or “delta generation rate”?
- Why am I getting “process exited without calling finalize”, and how do I fix it?
- Error on Lumerical device
- Using a license file on a new license server
- Error: addfdtd is not a valid function or a variable name
- Ansys Insight: Diverging Simulations
- Ansys Insight: Transmission results greater than one
- Ansys Insight: About override mesh in FDTD: its use and settings
- Ansys Insight: Convergence issues in CHARGE
- Is there a Lumerical script command to output the Simulation and Memory requirements?
-
2630
-
2104
-
1329
-
1110
-
461
© 2023 Copyright ANSYS, Inc. All rights reserved.