Ansys Learning Forum Forums Discuss Simulation Photonics Try to calculate power and impedance integration with python Reply To: Try to calculate power and impedance integration with python

Taylor Robertson
Ansys Employee

Hello,

Some of the features in the of the FDE GUI cannot be trivially replicated through simple script commands. The basic overlap calculations can be accomplished via script commands Overlap script function; however, if you wanted to recenter or something you would need to shift coordinates. Same thing is true for the power and impedance calculations in Modal Analysis tab. To get the power in specified area you would want to integrate the poynting vector(P) over the desired shape and divide that by the integral over the entire window. To do this set the limits of integration appropriately or apply a filter to the region you want to integrate. This filter would be binary array with 1 inside the surface you want to calculate the power, and 0 outside, then the contributions outside the region will be zero.

As you are aware I am sure all python methods are the same as lumerical script commands. The following would be helpful.

integrate - Script command

?getresult;

Good Luck,