You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Plane wave illumination with theta = 0 and phi = 0 degrees angle incidence angle results in singular matrix error. The work arround is to enter for theta a very small angle.
The text was updated successfully, but these errors were encountered:
I am also trying to use theta = 0 and phi = 0 degree for 1D grating diffraction, but the results are weird. (larger than 1)
Maybe my task is a little bit different to yours, but could you help me to find the root cause or give me some suggestion?
Here is my code which I modified from the example in the repository.
I am thinking about the large imaginary part of n and small N_harmonics.
from rcwa.shorthand import complexArray
import numpy as np
def solve_system():
wavelength = 0.365
deg = np.pi / 180
theta = 0 * deg
phi = 0 * deg
pTEM = 1/np.sqrt(1)*complexArray([0,1j])
source = Source(wavelength=wavelength, theta=theta, phi=phi, pTEM=pTEM)
N_harmonics = 5
grating_layer = RectangularGrating(period=2, thickness=1.6, er = 10.85241249, ur = 1, n=1.52+3.2943j,
n_void=1, groove_width=0.5, nx=512)
layer_stack = LayerStack(grating_layer)
solver_1d = Solver(layer_stack, source, N_harmonics)
results = solver_1d.solve()
return results
if __name__ == '__main__':
results = solve_system()
# Get the amplitude reflection and transmission coefficients
(rxCalculated, ryCalculated, rzCalculated) = (results['rx'], results['ry'], results['rz'])
(txCalculated, tyCalculated, tzCalculated) = (results['tx'], results['ty'], results['tz'])
# Get the diffraction efficiencies R and T and overall reflection and transmission coefficients R and T
(R, T, RTot, TTot) = (results['R'], results['T'], results['RTot'], results['TTot'])
print(RTot, TTot, RTot+TTot)
Plane wave illumination with theta = 0 and phi = 0 degrees angle incidence angle results in singular matrix error. The work arround is to enter for theta a very small angle.
The text was updated successfully, but these errors were encountered: