Ansys Learning Forum Forums Discuss Simulation Photonics The two modes overlap the integral Reply To: The two modes overlap the integral

anna.wirth-singh
Ansys Employee

Hello, I apologize for missing your earlier comment. Thank you for bringing this to my attention and for providing the details of your calculation. I see your issue and am able to reproduce your issue, so I will look into it further and get back to you. 

In the meantime, I can offer some alternative solutions. You can try to use the process shown in this article FDE: Importing your own field profile to the deck (d-card) – Ansys Optics to export and import individual fields as .fld (not .ldf). You can also try zbf format as shown here: ZBF Import\Export – Ansys Optics.

Your ultimate goal is to calculate the overlap, correct? Another possibility is to manually calculate the overlap from script variables (thereby avoiding the use of d-cards). Please see this article for an explanation of the overlap calculation: overlap - Script command – Ansys Optics. If you can obtain the fields (Ex, Ey, Ez, Hx, Hy, Hz) from your monitor (here called 'Exm', 'Hxm', etc) and from your saved data (here called 'Exs', 'Hxs', etc), then you can manually calculate the overlap with this script. Please give it a try and let me know if it works for you.

Pm=pinch(Exm*conj(Hym)-Eym*conj(Hxm)); #

Pmi=integrate(Pm,1:2,x,y);



Ps=pinch(Exs*conj(Hys)-Eys*conj(Hxs)); #

Psi=integrate(Ps,1:2,x,y);




nx=length(x);

ny=length(y);

Pms=zeros(nx,ny);

Psm=Pms;




Pms(1:nx,1:ny) = pinch(Exm(:,:))*conj(pinch(Hys(:,:)))-pinch(Eym(:,:))*conj(pinch(Hxs(:,:))); #

Psm(1:nx,1:ny) = pinch(Exs(:,:))*conj(pinch(Hym(:,:)))-pinch(Eys(:,:))*conj(pinch(Hxm(:,:))); #



Pmsi=integrate(Pms,1:2,x,y);

Psmi=integrate(Psm,1:2,x,y);

out=abs(real(Pmsi*Psmi/Pmi)/(real(Psi))); # Calculated overlap