12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- function [V_eff] = fmmnc_efficiency(no, V_inc, V_dif, kx0, ky0, kg, eps1, eps2)
- [kz1, kz2] = fmm_kxz(no, kx0, ky0, kg, eps1, eps2);
- kz1 = transpose(kz1);
- kz2 = transpose(kz2);
-
- ib1 = 1:no;
- ib2 = no+1:2*no;
- V_eff = zeros(2*no,2);
- P_inc = sum( abs(V_inc(ib1,1).^2).*real(kz1) + abs(V_inc(ib1,2).^2).*real(kz2) ) ...
- + sum( abs(V_inc(ib2,1).^2).*real(kz1/eps1) + abs(V_inc(ib2,2).^2).*real(kz2/eps2) );
- V_eff(ib1,1) = abs(V_dif(ib1,1).^2).*real(kz1);
- V_eff(ib1,2) = abs(V_dif(ib1,2).^2).*real(kz2);
- V_eff(ib2,1) = abs(V_dif(ib2,1).^2).*real(kz1/eps1);
- V_eff(ib2,2) = abs(V_dif(ib2,2).^2).*real(kz2/eps2);
- if abs(P_inc) > 1e-15
- V_eff = V_eff/P_inc;
- else
- V_eff = 0.5*V_eff;
- end
- end
|