Skip to content

Commit 7c9d3a1

Browse files
authored
updated tmm.py
1 parent 3a2048e commit 7c9d3a1

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

wptherml/tmm.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ def BuildP(phil):
2727

2828
### this function will compute the derivative of the P matrix for a given
2929
### layer l with respect to the thickness of layer l
30+
def Build_dP_ds(kzl, dl):
31+
P = np.zeros((2,2),dtype=complex)
32+
ci = 0+1j
33+
a = -1*ci*kzl*dl
34+
b = ci*kzl*dl
35+
P[0][1] = 0+0j
36+
P[1][0] = 0+0j
37+
P[0][0] = -ci*kzl*np.exp(a)
38+
P[1][1] = ci*kzl*np.exp(b)
39+
return P
3040

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

170180

171-
172-
### This function will take a thickness array
173-
### and a scalar thickness and will return
174-
### the index of the layer in which you are in
175-
### at that thickness
176181
### analytically differentiates the transfer matrix
177182
### with respect to the thickness of a layer li to be specified by
178183
### the user!

0 commit comments

Comments
 (0)