-
-
October 19, 2023 at 4:38 pmSAURAV GAUTAMSubscriber
Hi, I want to get feasible results of transmittance spectra(all parameter within 10% of transmittance) from different constraint sweeps like angle, thickness, material. Is there any sample script for this?
I found particle swarm optimization but that's for single minima and just one constraint.
thank you
-
October 19, 2023 at 5:58 pmAmrita PatiAnsys Employee
Hi Saurav,
With Lumerical’s in-built Optimization tool (which uses PSO), you can have different constraints. For ex. screenshot of a multi-constraint optimization that I was working on a while ago is shown:
But the PSO can maximize/minimize a single objective function. In terms of the objective function there can be two variations:
- First one is that if you have a single objective function but you are looking at it’s multiple values. For ex., the transmission spectrum that you mentioned here. In those cases what is typically done is you have to come up with a different figure of merit that manages to quantify a series of Ts over wavelength into a single value. For this, what you have to do is add “T” to the Figure of Merit. But at the same time, you have to enable the “Use figure of merit script” in the Advanced Tab and then you have to decide what this FOM can be (in the section for code) for transmission across a range of wavelengths. For ex. something like fom = integrate(T^2,1,f); What this does is takes the multiple values of T in a range of frequecies, integrates them over the frequency, which converts it into a single value that can be minimized or maximized. So, this takes into consideration not just a single value of T, but the values of T over the entire spectrum.
- The second consideration is a multi-objective optimization. Which is when you are looking at different objective functions. For ex. along with T if you are looking at some other result. In those cases there can be two approaches. The first is, you either have to find a way to combine multiple objective functions into a single function. There are many papers on that. One approach is that, you simply add all the objective functions, and assign each term a weight to decide the priority of each objective. In that case, you can use the inbuilt PSO and add the FOM like I mentioned before. But in general I have seen that PSO is not very effective at multi-objective optimization.
The second approach is to use a different algorithm altogether which can be done from the user defined algorithm section as shown below:
Please let me know if you have any questions.
Reagrds,
Amrita - First one is that if you have a single objective function but you are looking at it’s multiple values. For ex., the transmission spectrum that you mentioned here. In those cases what is typically done is you have to come up with a different figure of merit that manages to quantify a series of Ts over wavelength into a single value. For this, what you have to do is add “T” to the Figure of Merit. But at the same time, you have to enable the “Use figure of merit script” in the Advanced Tab and then you have to decide what this FOM can be (in the section for code) for transmission across a range of wavelengths. For ex. something like fom = integrate(T^2,1,f); What this does is takes the multiple values of T in a range of frequecies, integrates them over the frequency, which converts it into a single value that can be minimized or maximized. So, this takes into consideration not just a single value of T, but the values of T over the entire spectrum.
-
October 20, 2023 at 12:30 pmSAURAV GAUTAMSubscriber
thanks a lot amrita,
i want to find the angles, depths for transmisiion more 10%, so i am considering using nested sweep with for loop and if else condition to get the values.
-
October 20, 2023 at 1:55 pmSAURAV GAUTAMSubscriber
https://optics.ansys.com/hc/en-us/articles/360034922913
i found this example,
how to write code for set or range of angle , depth that will give reflection higher than sepoint at given wavelength?
-
October 20, 2023 at 7:57 pmAmrita PatiAnsys Employee
Hi Saurav,
You are welcome! I had a quick look at the example you mentioned. I would just like to point out that it calculates the mean of R and T in the sweep and optimizes the thickness of the structure for the maximum mean (single value) of R over a set of angles (rather than maximizing the value of R at each angle).
For setting up sweeps using code, please refer to the following link:Creating parameter sweeps using a script
For setting up optimization task using code, please refer to the following:Creating optimization tasks using a scriptI did a quick search and didn't find any published code for nested sweeps, here is a simple example code, but you can combine it with the resources above.
addsweep(0);
setsweep("sweep","name","A");
insertsweep("A");
setsweep("sweep","name","B");This creates a nested loop as shown:
Regards,
Amrita -
October 24, 2023 at 8:56 amSAURAV GAUTAMSubscriber
thank you for the help and support
-
- The topic ‘optimization with feasible region’ is closed to new replies.
- Difference between answers in version 2024 and 2017 lumerical mode solution
- Errors Running Ring Modulator Example on Cluster
- INTERCONNECT – No results unless rerun simulation until it gives any
- Import material .txt file with script
- Help for qINTERCONNECT
- Trapezoidal ring
- Issues with getting result from interconnent analysis script
- How to measure transmission coefficients on a given plane .
- Topology Optimization Error
- Absorption cross-section of AuNR excited by prism-based TIR
-
1301
-
591
-
544
-
524
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.