FDTD偏振转换效率脚本问题
f=getdata("T","f");
x=getdata("T","x");
y=getdata("T","y");
Ex = getdata("T","Ex");
Ey = getdata("T","Ey");
Hx = getdata("T","Hx");
Hy = getdata("T","Hy");
# calcuate right/left circular polarization components
# with a point of view from the receiver (monitor)
E_r = (Ex - 1i*Ey)/sqrt(2);
E_l = (Ex + 1i*Ey)/sqrt(2);
H_r = (-1i*Hx +Hy)/sqrt(2);
H_l = (1i*Hx + Hy)/sqrt(2);
#phase_L = pinch(angle(E_l(31,31,1,:))) ;
#phase_R = pinch(angle(E_r(31,31,1,:))) ;
#plot(c/f*1e6,unwrap(phase_L)) ;
# Calculate the z component of the Poynting vector
Pz_r = E_r*conj(H_l); #复共轭
Pz_l = E_l*conj(H_r);
# Fraction of transmitted power which is RCP and LCP
# 光波导基础P5公式/加了负号
Tr_r=-integrate(real(Pz_r)/2,1:2,x,y)/sourcepower(f); # 在x,y面积分
Tr_l=-integrate(real(Pz_l)/2,1:2,x,y)/sourcepower(f);
plot(c/f*1e9,Tr_r*100,Tr_l*100,"Wavelength (nm)", "Efficiency(%)");
legend("T_RCP","T_LCP");
#setplot("y min",0);
#setplot("y max",100);
#setplot("x max",c/min(f)*1e9);
#setplot("x min",c/max(f)*1e9);
你好,请问问题解决了吗,这个脚本是正确的吗
不知道你这个问题是否已经解决, 如果还没有解决的话: