1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| couche = np.array([[1.8, e],[1.4, e],[1.8, e],[1.4, e]])
s = couche.shape # on regarde la taille de la matrice
nc = s[0] # on prend le nombre de ligne
def monocouche(lambda_0,n0,theti,pola,n1,e):
thetai2=np.arcsin(n0/n1*np.sin(theti))
h = n1*e*np.cos(thetai2)
if pola == 1 : # pola S
Y1 = n1*np.cos(thetai2)
else : # polar P
Y1 = np.cos(thetai2)/n1
phi = k0*h
M = np.array([[ np.cos(phi) , (np.sin(phi)*1j)/Y1 ], [ (Y1*np.sin(phi))*1j , np.cos(phi) ]])
return M
def multicouche(lambda_0,n0,theti,pola,couche):
Id = np.eye(2) # on crée la matrice identité
for k in range(0,nc): # k va varier de 0 à nc-1
M = np.dot(Id,monocouche(lambda_0,n0,theti,pola,couche[k,0],couche[k,1])) # M1*M2*M3... k fois
return M |
Partager