I want to optimize the design of a stacked lens that it's going to be 3D printed. Each layer (Rectangular Volume objects) has a constant refractive index, but by stacking them we create a GRIN lens effect. This will focus the light only in one direction. As a first step, I want for some specific input and focal length (I implement the specific focal length by defining the detector to be at a specific distance from the lens) to change the length and layer thickness.
When I ran an optimization, the length became negative, so I applied a constraint with NPGT for the thickness, here the Z Length of the rectangular object. But it still gets negative. Is there a way to apply contstraints in my input correctly? The layer thicknesses, namely the Y half width of the rectangular object, I also need them to be constraint between 0.1 and 0.3 mm, but I haven't implemented this yet, since not even the Z length constraint works for me.
Since this design focuses the light in y direction, my merit function operand for tight focus is NSDD for y distance from the centroid, I selected it to be approximately equal to the x distance of the input, but 0 is also fine. Even without optimization we can see that light focuses, but there are some outliers. I presume that the y distance value for the NSDD operand takes those into account. How can I disregard them, and say ok if 80% of the flux is within a specific y, the optimization works?
I attached my model.
Thank you.