zlatko-minev / pyEPR

Powerful, automated analysis and design of quantum microwave chips & devices [Energy-Participation Ratio and more]
https://pyepr-docs.readthedocs.io
Other
168 stars 232 forks source link

Added ansys calculator functions #76

Closed bguttel closed 3 years ago

bguttel commented 3 years ago

Two functions that return vectors tangent and normal to a surface. I used it to calculate surface participation ratios:

#SA participation ratio
vecE_normal = vecE.normal2surface('chip_holder1').__div__(epsilon_r) #Complex Vector
vecE_tangent = vecE.tangent2surface('chip_holder1').__mul__(epsilon_r) #Complex Vector
vec_E_total = vecE_normal.__add__(vecE_tangent)
E_squared = vec_E_total.dot(vecE).__abs__().real().__pow__(2)
E_surface = E_squared.integrate_surf(name='chip_holder1').evaluate()
E_surface -= E_surface_metal

p_SA = t* (E_surface / UE)