-
-
December 2, 2025 at 9:29 pm
firdoust
SubscriberHi,Â
Â
I am simulating the Invese taper design Inverse design of y-branch – Ansys Optics:Â
Â
How to replace the silicon material in the code "y_branch_opt_2D.py":
eps_in = Material(name = 'Si: non-dispersive', mesh_order = 2)
Â
With a material of defined index? I am trying something like this but simulation doesn't work and gives me the error that index is not defined.Â
eps_in = Material(name = 'Object defined dielectric', index=2.21)
Â
Thanks,
Â
-
December 2, 2025 at 9:35 pm
-
December 3, 2025 at 12:08 pm
daanish.peerkhan
Ansys EmployeeHi Firdoust,
The error occurs because the Material class in the lumopt library does not have an index argument. It requires permittivity (base_epsilon) instead.To define a specific refractive index directly on the object, you should pass the square of the index (n^2) to base_epsilon and omit the name (it will default to automatically).Here is the corrected line of code:
eps_in = Material(base_epsilon=2.21**2, mesh_order=2)
The solver expects permittivity (epsilon), and the relationship is epsilon = n^2. By passing 2.21**2, you are providing the correct permittivity for your desired index. You do not need to explicitly set name='' as this is the default behavior when base_epsilon is provided.
Hope this helps!
Thanks,
Daanish
-
- You must be logged in to reply to this topic.
-
5849
-
1906
-
1420
-
1305
-
1021
© 2026 Copyright ANSYS, Inc. All rights reserved.

