Skip to content

Commit

Permalink
updated tmm.py
Browse files Browse the repository at this point in the history
  • Loading branch information
FoleyLab authored Mar 17, 2020
1 parent 3a2048e commit 7c9d3a1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions wptherml/tmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ def BuildP(phil):

### this function will compute the derivative of the P matrix for a given
### layer l with respect to the thickness of layer l
def Build_dP_ds(kzl, dl):
P = np.zeros((2,2),dtype=complex)
ci = 0+1j
a = -1*ci*kzl*dl
b = ci*kzl*dl
P[0][1] = 0+0j
P[1][0] = 0+0j
P[0][0] = -ci*kzl*np.exp(a)
P[1][1] = ci*kzl*np.exp(b)
return P

def BuildD(nl, ctheta,pol):
D = np.zeros((2,2),dtype=complex)
Expand Down Expand Up @@ -168,11 +178,6 @@ def tmm(k0, theta0, pol, nA, tA):
return M



### This function will take a thickness array
### and a scalar thickness and will return
### the index of the layer in which you are in
### at that thickness
### analytically differentiates the transfer matrix
### with respect to the thickness of a layer li to be specified by
### the user!
Expand Down

0 comments on commit 7c9d3a1

Please sign in to comment.