Devika Padmakumar Nair
Ansys Employee


You can try using parameter sweep ( Parameter sweeps, Optimization and Monte Carlo analysis overview – Ansys Optics ).

Training material available here : Running a Simulation Using Ansys Lumerical Scripting — Lesson 1 - ANSYS Innovation Courses.

In this case can set "the size and position" as parameters to optimize and find the optimum value.