How can I set the variation to check cavity properties using Stack Solver script?

EunJooEunJoo Member Posts: 4
edited September 7 in Photonics


I check the Purcell factor and Purcell density in cavity structure (A bottom mirror is PEC, a top mirror is Ag - CRC material, and spacers are Air) using Stack Solver. From that simulation, a dipole source exists between 2 and 3 layers.

I want to know the Purcell Factors varying with a thickness of layer number 2 (10 - 50 nm).

For simulating, I modified the script from - stackpurcell-Script command

An original script set thicknesses of layers matrix (8-13 lines) so that I can't handle the thickness of the second layer as a variation. Is there another way to set multilayer geometry as a variable?

Looking forward to your reply and help! 


  • gsungsun Posts: 953Ansys Employee
    edited September 8

    You can sweep the specific thickness, eg d(2) in a loop. For example, in line 18, you can write







    You will need to revise your script, move all constants outside the loops, and define the matrix, such as density, purcell etc with dimension of frequency and thickness. Please try.

Sign In or Register to comment.