```python
import tensorflow as tf
import numpy as np
import scipy.io
import timeit
import sys
import matplotlib.pyplot as plt
from scipy.interpolate import griddata
import random
import seaborn as sns
import pandas as pd
import mpmath
```

The analytical solution (Srivastava and Yeh, 1991) is based on the following constituitive relationships:
\begin{equation}
K_* = K_s e^{\alpha \psi},
\end{equation}

\begin{equation}
\theta = \theta_r + (\theta_s - \theta_r) e^{\alpha \psi},
\end{equation}
where $K_s$ is the saturated hydraulic conductivity, $\theta_r$ is the residual water content, $\theta_s$ is the saturated water content, $\alpha$ is a pore-size distribution parameter. Using the constituitive relationships, the RRE is linearlized.

Dimensionless parameters are introduced:
\begin{equation}
z = \alpha_1 z_* \text{   for   } -L_{*1} \leq z_* \leq 0,
\end{equation}

\begin{equation}
z = \alpha_2 z_* \text{   for   } 0 \leq z_* \leq L_{*2},
\end{equation}

\begin{equation}
K_1 = K_{*1}/K_{s1},  q_{A1} = q_{A*}/K_{s1},  q_{B} = q_{B*}/K_{s1},
\end{equation}

\begin{equation}
K_2 = K_{*2}/K_{s2},  q_{A2} = q_{A*}/K_{s2},  q_{B} = q_{B*}/K_{s2},
\end{equation}

\begin{equation}
t = \frac{\alpha_1 K_{s1}t_*}{\theta_{s1} - \theta_{r1}}.
\end{equation}

The governing equations are:
\begin{equation}
\frac{\partial^2 K_1}{\partial z^2} + \frac{\partial K_1}{\partial z} = \frac{\partial K_1}{\partial t},
\end{equation}

\begin{equation}
\frac{\partial^2 K_2}{\partial z^2} + \frac{\partial K_2}{\partial z} = \beta\frac{\partial K_2}{\partial t},
\end{equation}
where
\begin{equation}
\beta = \frac{\alpha_1 K_{s1}(\theta_{s2} - \theta_{r2})}{\alpha_2 K_{s2}(\theta_{s1} - \theta_{r1})}.
\end{equation}

```python
# define computational domain
dom_coords_1 = np.array([[0.0, 0.0],   # t = 0 hour to t = 100 hours
                       [100.0, -100.0]])  # domain 1 is the lower layer

dom_coords_2 = np.array([[0.0, 100.0],   # t = 0 hour to t = 100 hours
                       [100.0, 0.0]])   # domain 2 is the upper layer
```

```python
t_star = np.linspace(dom_coords_1[0, 0], dom_coords_1[1, 0], 101)[:, None]
z1_star = np.linspace(dom_coords_1[0, 1], dom_coords_1[1, 1], 101)[:, None]
z2_star = np.linspace(dom_coords_2[0, 1], dom_coords_2[1, 1], 101)[:, None]
```

```python
# parameter values
alpha1 = 0.1 # /cm
alpha2 = 0.1 # /cm
K_s1 = 10.0 # cm/hour
K_s2 = 1.0 # cm/hour
theta_s1 = 0.40
theta_s2 = 0.40
theta_r1 = 0.06
theta_r2 = 0.06
L1_star = 100.0 # cm
L2_star = 100.0 # cm
```

```python
# transformation
L1 = L1_star * alpha1
L2 = L2_star * alpha2
z1 = z1_star * alpha1
z2 = z2_star * alpha2

t = alpha1 * K_s1 * t_star/(theta_s1 - theta_r1)
```

```python
# suface water flux condition (positive downward) [cm/hour]
q_A1_star = 0.1
q_A2_star = 0.1
q_B1_star = 0.9
q_B2_star = 0.9

# pressure at the lower boundary (water table)
psi_0 = 0.0

q_A1 = q_A1_star / K_s1
q_A2 = q_A2_star / K_s2
q_B1 = q_B1_star / K_s1
q_B2 = q_B2_star / K_s2

# initial condition for the lower layer
K_1_ini = q_A1 - (q_A1 - np.exp(alpha1 * psi_0)) * np.exp(-(L1 + z1))
psi_1_ini = np.log(K_1_ini) /alpha1
```

```python
t1_mesh, z1_mesh = np.meshgrid(t, z1)
t2_mesh, z2_mesh = np.meshgrid(t, z2)
```

```python
# initial condition for the upper layer
K_2_ini = q_A2 - (q_A2 - (q_A1 - (q_A1 - np.exp(alpha1 * psi_0)) \
       *np.exp(-L1))**(alpha2/alpha1))* np.exp(-z2)
psi_2_ini = np.log(K_2_ini) /alpha2
```

```python
# initial condition
plt.plot(psi_1_ini, z1_star, label = "layer 1")
plt.plot(psi_2_ini, z2_star, label = "layer 2")
plt.legend()
plt.xlabel("$\psi$ cm")
plt.ylabel("$z$ cm")
```

```python
# beta = 10.0 for this example, which means Case A and Case B are used for the analytical solution
beta = (alpha1 * K_s1 * (theta_s2 - theta_r2))/ (alpha2 * K_s2 * (theta_s1 - theta_r1))
print("beta is", beta)
```

    beta is 10.0

Computing $RA_1$.
The values of $\lambda$ are obtained as the positive roots of the characteristic equation (21a).
we obtain $\lambda$ < 100 for higher accuracies for $t = 0.1$.

```python
lam_test = np.arange(0.0, 100, 0.001)
```

```python
def residue_RA(lam):
    mu = (beta * lam**2 + (beta - 1.0)/4.0)**(1/2)
    A = np.sin(lam*L1) + 2*lam*np.cos(lam*L1)
    B = np.sin(mu*L2) + 2*mu*np.cos(mu*L2)
    C = (1 + 4*mu**2)*(K_s2/K_s1)*np.sin(lam*L1)*np.sin(mu*L2)
    return A * B - C
```

```python
# two sign changes: one is due to discontinuity, and the other one is the root
pd.set_option('display.max_rows', None)
data = {"lam": lam_test.flatten()[0:-1],
        "sign": np.sign(residue_RA(lam_test)).flatten()[0:-1],
        "change": np.sign(residue_RA(lam_test)).flatten()[0:-1] - np.sign(residue_RA(lam_test)).flatten()[1:]}
df = pd.DataFrame(data)
```

```python
# the roots can be found near where the sign changes
a_set = df.loc[np.abs(df["change"]) == 2]["lam"].values
```

```python
# program to find roots using Newton method (solver = 'newton')

def residue_RA(lam):
    mu = (beta * lam**2 + (beta - 1.0)/4.0)**(1/2)
    A = mpmath.sin(lam*L1) + 2*lam*mpmath.cos(lam*L1)
    B = mpmath.sin(mu*L2) + 2*mu*mpmath.cos(mu*L2)
    C = (1 + 4*mu**2)*(K_s2/K_s1)*mpmath.sin(lam*L1)*mpmath.sin(mu*L2)
    return A * B - C

roots = []

for a in a_set[0:]:  # change the argument to find roots if you encounter errors
    a = int(a/0.001)
    for i in range(a, a + 5):
        print(i)
        initial_value = 0.001 * (i + 1)
        root = mpmath.findroot(residue_RA, initial_value, solver = 'newton')
        root_value = np.array(root, np.float).tolist()
        roots.append(root_value)
```

    240
    241
    242
    243
    244
    296
    297
    298
    299
    300
    434
    435
    436
    437
    438
    532
    533
    534
    535
    536
    591
    592
    593
    594
    595
    697
    698
    699
    700
    701
    796
    797
    798
    799
    800
    854
    855
    856
    857
    858
    935
    936
    937
    938
    939
    1034
    1035
    1036
    1037
    1038
    1117
    1118
    1119
    1120
    1121
    1172
    1173
    1174
    1175
    1176
    1258
    1259
    1260
    1261
    1262
    1353
    1354
    1355
    1356
    1357
    1430
    1431
    1432
    1433
    1434
    1485
    1486
    1487
    1488
    1489
    1572
    1573
    1574
    1575
    1576
    1665
    1666
    1667
    1668
    1669
    1739
    1740
    1741
    1742
    1743
    1795
    1796
    1797
    1798
    1799
    1881
    1882
    1883
    1884
    1885
    1973
    1974
    1975
    1976
    1977
    2048
    2049
    2050
    2051
    2052
    2103
    2104
    2105
    2106
    2107
    2187
    2188
    2189
    2190
    2191
    2279
    2280
    2281
    2282
    2283
    2356
    2357
    2358
    2359
    2360
    2410
    2411
    2412
    2413
    2414
    2492
    2493
    2494
    2495
    2496
    2583
    2584
    2585
    2586
    2587
    2662
    2663
    2664
    2665
    2666
    2716
    2717
    2718
    2719
    2720
    2796
    2797
    2798
    2799
    2800
    2887
    2888
    2889
    2890
    2891
    2968
    2969
    2970
    2971
    2972
    3023
    3024
    3025
    3026
    3027
    3099
    3100
    3101
    3102
    3103
    3190
    3191
    3192
    3193
    3194
    3273
    3274
    3275
    3276
    3277
    3329
    3330
    3331
    3332
    3333
    3402
    3403
    3404
    3405
    3406
    3492
    3493
    3494
    3495
    3496
    3577
    3578
    3579
    3580
    3581
    3635
    3636
    3637
    3638
    3639
    3704
    3705
    3706
    3707
    3708
    3794
    3795
    3796
    3797
    3798
    3881
    3882
    3883
    3884
    3885
    3942
    3943
    3944
    3945
    3946
    4006
    4007
    4008
    4009
    4010
    4094
    4095
    4096
    4097
    4098
    4183
    4184
    4185
    4186
    4187
    4249
    4250
    4251
    4252
    4253
    4309
    4310
    4311
    4312
    4313
    4396
    4397
    4398
    4399
    4400
    4485
    4486
    4487
    4488
    4489
    4555
    4556
    4557
    4558
    4559
    4612
    4613
    4614
    4615
    4616
    4697
    4698
    4699
    4700
    4701
    4787
    4788
    4789
    4790
    4791
    4861
    4862
    4863
    4864
    4865
    4916
    4917
    4918
    4919
    4920
    4998
    4999
    5000
    5001
    5002
    5088
    5089
    5090
    5091
    5092
    5166
    5167
    5168
    5169
    5170
    5220
    5221
    5222
    5223
    5224
    5299
    5300
    5301
    5302
    5303
    5389
    5390
    5391
    5392
    5393
    5471
    5472
    5473
    5474
    5475
    5525
    5526
    5527
    5528
    5529
    5600
    5601
    5602
    5603
    5604
    5689
    5690
    5691
    5692
    5693
    5774
    5775
    5776
    5777
    5778
    5831
    5832
    5833
    5834
    5835
    5901
    5902
    5903
    5904
    5905
    5990
    5991
    5992
    5993
    5994
    6076
    6077
    6078
    6079
    6080
    6137
    6138
    6139
    6140
    6141
    6202
    6203
    6204
    6205
    6206
    6290
    6291
    6292
    6293
    6294
    6378
    6379
    6380
    6381
    6382
    6444
    6445
    6446
    6447
    6448
    6504
    6505
    6506
    6507
    6508
    6590
    6591
    6592
    6593
    6594
    6679
    6680
    6681
    6682
    6683
    6750
    6751
    6752
    6753
    6754
    6806
    6807
    6808
    6809
    6810
    6891
    6892
    6893
    6894
    6895
    6980
    6981
    6982
    6983
    6984
    7055
    7056
    7057
    7058
    7059
    7110
    7111
    7112
    7113
    7114
    7191
    7192
    7193
    7194
    7195
    7281
    7282
    7283
    7284
    7285
    7360
    7361
    7362
    7363
    7364
    7414
    7415
    7416
    7417
    7418
    7491
    7492
    7493
    7494
    7495
    7581
    7582
    7583
    7584
    7585
    7664
    7665
    7666
    7667
    7668
    7719
    7720
    7721
    7722
    7723
    7792
    7793
    7794
    7795
    7796
    7881
    7882
    7883
    7884
    7885
    7966
    7967
    7968
    7969
    7970
    8025
    8026
    8027
    8028
    8029
    8092
    8093
    8094
    8095
    8096
    8181
    8182
    8183
    8184
    8185
    8268
    8269
    8270
    8271
    8272
    8331
    8332
    8333
    8334
    8335
    8394
    8395
    8396
    8397
    8398
    8481
    8482
    8483
    8484
    8485
    8570
    8571
    8572
    8573
    8574
    8637
    8638
    8639
    8640
    8641
    8696
    8697
    8698
    8699
    8700
    8781
    8782
    8783
    8784
    8785
    8870
    8871
    8872
    8873
    8874
    8943
    8944
    8945
    8946
    8947
    8998
    8999
    9000
    9001
    9002
    9081
    9082
    9083
    9084
    9085
    9171
    9172
    9173
    9174
    9175
    9248
    9249
    9250
    9251
    9252
    9302
    9303
    9304
    9305
    9306
    9381
    9382
    9383
    9384
    9385
    9471
    9472
    9473
    9474
    9475
    9552
    9553
    9554
    9555
    9556
    9606
    9607
    9608
    9609
    9610
    9681
    9682
    9683
    9684
    9685
    9771
    9772
    9773
    9774
    9775
    9855
    9856
    9857
    9858
    9859
    9912
    9913
    9914
    9915
    9916
    9982
    9983
    9984
    9985
    9986
    10071
    10072
    10073
    10074
    10075
    10157
    10158
    10159
    10160
    10161
    10218
    10219
    10220
    10221
    10222
    10283
    10284
    10285
    10286
    10287
    10370
    10371
    10372
    10373
    10374
    10458
    10459
    10460
    10461
    10462
    10524
    10525
    10526
    10527
    10528
    10584
    10585
    10586
    10587
    10588
    10670
    10671
    10672
    10673
    10674
    10759
    10760
    10761
    10762
    10763
    10830
    10831
    10832
    10833
    10834
    10886
    10887
    10888
    10889
    10890
    10970
    10971
    10972
    10973
    10974
    11060
    11061
    11062
    11063
    11064
    11135
    11136
    11137
    11138
    11139
    11189
    11190
    11191
    11192
    11193
    11270
    11271
    11272
    11273
    11274
    11360
    11361
    11362
    11363
    11364
    11440
    11441
    11442
    11443
    11444
    11494
    11495
    11496
    11497
    11498
    11570
    11571
    11572
    11573
    11574
    11660
    11661
    11662
    11663
    11664
    11743
    11744
    11745
    11746
    11747
    11799
    11800
    11801
    11802
    11803
    11870
    11871
    11872
    11873
    11874
    11959
    11960
    11961
    11962
    11963
    12045
    12046
    12047
    12048
    12049
    12105
    12106
    12107
    12108
    12109
    12171
    12172
    12173
    12174
    12175
    12259
    12260
    12261
    12262
    12263
    12347
    12348
    12349
    12350
    12351
    12411
    12412
    12413
    12414
    12415
    12472
    12473
    12474
    12475
    12476
    12559
    12560
    12561
    12562
    12563
    12648
    12649
    12650
    12651
    12652
    12717
    12718
    12719
    12720
    12721
    12774
    12775
    12776
    12777
    12778
    12859
    12860
    12861
    12862
    12863
    12948
    12949
    12950
    12951
    12952
    13022
    13023
    13024
    13025
    13026
    13077
    13078
    13079
    13080
    13081
    13158
    13159
    13160
    13161
    13162
    13248
    13249
    13250
    13251
    13252
    13327
    13328
    13329
    13330
    13331
    13381
    13382
    13383
    13384
    13385
    13458
    13459
    13460
    13461
    13462
    13548
    13549
    13550
    13551
    13552
    13630
    13631
    13632
    13633
    13634
    13686
    13687
    13688
    13689
    13690
    13759
    13760
    13761
    13762
    13763
    13848
    13849
    13850
    13851
    13852
    13933
    13934
    13935
    13936
    13937
    13991
    13992
    13993
    13994
    13995
    14059
    14060
    14061
    14062
    14063
    14148
    14149
    14150
    14151
    14152
    14235
    14236
    14237
    14238
    14239
    14297
    14298
    14299
    14300
    14301
    14360
    14361
    14362
    14363
    14364
    14447
    14448
    14449
    14450
    14451
    14536
    14537
    14538
    14539
    14540
    14603
    14604
    14605
    14606
    14607
    14662
    14663
    14664
    14665
    14666
    14747
    14748
    14749
    14750
    14751
    14836
    14837
    14838
    14839
    14840
    14909
    14910
    14911
    14912
    14913
    14964
    14965
    14966
    14967
    14968
    15047
    15048
    15049
    15050
    15051
    15136
    15137
    15138
    15139
    15140
    15214
    15215
    15216
    15217
    15218
    15268
    15269
    15270
    15271
    15272
    15347
    15348
    15349
    15350
    15351
    15436
    15437
    15438
    15439
    15440
    15518
    15519
    15520
    15521
    15522
    15572
    15573
    15574
    15575
    15576
    15647
    15648
    15649
    15650
    15651
    15736
    15737
    15738
    15739
    15740
    15821
    15822
    15823
    15824
    15825
    15878
    15879
    15880
    15881
    15882
    15947
    15948
    15949
    15950
    15951
    16036
    16037
    16038
    16039
    16040
    16122
    16123
    16124
    16125
    16126
    16184
    16185
    16186
    16187
    16188
    16248
    16249
    16250
    16251
    16252
    16335
    16336
    16337
    16338
    16339
    16424
    16425
    16426
    16427
    16428
    16490
    16491
    16492
    16493
    16494
    16549
    16550
    16551
    16552
    16553
    16635
    16636
    16637
    16638
    16639
    16724
    16725
    16726
    16727
    16728
    16796
    16797
    16798
    16799
    16800
    16852
    16853
    16854
    16855
    16856
    16935
    16936
    16937
    16938
    16939
    17024
    17025
    17026
    17027
    17028
    17101
    17102
    17103
    17104
    17105
    17155
    17156
    17157
    17158
    17159
    17234
    17235
    17236
    17237
    17238
    17324
    17325
    17326
    17327
    17328
    17405
    17406
    17407
    17408
    17409
    17459
    17460
    17461
    17462
    17463
    17534
    17535
    17536
    17537
    17538
    17624
    17625
    17626
    17627
    17628
    17708
    17709
    17710
    17711
    17712
    17764
    17765
    17766
    17767
    17768
    17835
    17836
    17837
    17838
    17839
    17924
    17925
    17926
    17927
    17928
    18010
    18011
    18012
    18013
    18014
    18070
    18071
    18072
    18073
    18074
    18135
    18136
    18137
    18138
    18139
    18223
    18224
    18225
    18226
    18227
    18311
    18312
    18313
    18314
    18315
    18376
    18377
    18378
    18379
    18380
    18437
    18438
    18439
    18440
    18441
    18523
    18524
    18525
    18526
    18527
    18612
    18613
    18614
    18615
    18616
    18682
    18683
    18684
    18685
    18686
    18739
    18740
    18741
    18742
    18743
    18823
    18824
    18825
    18826
    18827
    18912
    18913
    18914
    18915
    18916
    18988
    18989
    18990
    18991
    18992
    19042
    19043
    19044
    19045
    19046
    19122
    19123
    19124
    19125
    19126
    19212
    19213
    19214
    19215
    19216
    19292
    19293
    19294
    19295
    19296
    19346
    19347
    19348
    19349
    19350
    19422
    19423
    19424
    19425
    19426
    19512
    19513
    19514
    19515
    19516
    19595
    19596
    19597
    19598
    19599
    19651
    19652
    19653
    19654
    19655
    19722
    19723
    19724
    19725
    19726
    19812
    19813
    19814
    19815
    19816
    19897
    19898
    19899
    19900
    19901
    19957
    19958
    19959
    19960
    19961
    20023
    20024
    20025
    20026
    20027
    20111
    20112
    20113
    20114
    20115
    20199
    20200
    20201
    20202
    20203
    20263
    20264
    20265
    20266
    20267
    20324
    20325
    20326
    20327
    20328
    20411
    20412
    20413
    20414
    20415
    20499
    20500
    20501
    20502
    20503
    20569
    20570
    20571
    20572
    20573
    20626
    20627
    20628
    20629
    20630
    20710
    20711
    20712
    20713
    20714
    20800
    20801
    20802
    20803
    20804
    20874
    20875
    20876
    20877
    20878
    20929
    20930
    20931
    20932
    20933
    21010
    21011
    21012
    21013
    21014
    21100
    21101
    21102
    21103
    21104
    21179
    21180
    21181
    21182
    21183
    21233
    21234
    21235
    21236
    21237
    21310
    21311
    21312
    21313
    21314
    21400
    21401
    21402
    21403
    21404
    21482
    21483
    21484
    21485
    21486
    21538
    21539
    21540
    21541
    21542
    21610
    21611
    21612
    21613
    21614
    21699
    21700
    21701
    21702
    21703
    21785
    21786
    21787
    21788
    21789
    21843
    21844
    21845
    21846
    21847
    21911
    21912
    21913
    21914
    21915
    21999
    22000
    22001
    22002
    22003
    22086
    22087
    22088
    22089
    22090
    22149
    22150
    22151
    22152
    22153
    22212
    22213
    22214
    22215
    22216
    22298
    22299
    22300
    22301
    22302
    22387
    22388
    22389
    22390
    22391
    22455
    22456
    22457
    22458
    22459
    22513
    22514
    22515
    22516
    22517
    22598
    22599
    22600
    22601
    22602
    22687
    22688
    22689
    22690
    22691
    22761
    22762
    22763
    22764
    22765
    22816
    22817
    22818
    22819
    22820
    22898
    22899
    22900
    22901
    22902
    22987
    22988
    22989
    22990
    22991
    23066
    23067
    23068
    23069
    23070
    23119
    23120
    23121
    23122
    23123
    23198
    23199
    23200
    23201
    23202
    23287
    23288
    23289
    23290
    23291
    23369
    23370
    23371
    23372
    23373
    23424
    23425
    23426
    23427
    23428
    23498
    23499
    23500
    23501
    23502
    23587
    23588
    23589
    23590
    23591
    23672
    23673
    23674
    23675
    23676
    23730
    23731
    23732
    23733
    23734
    23798
    23799
    23800
    23801
    23802
    23887
    23888
    23889
    23890
    23891
    23973
    23974
    23975
    23976
    23977
    24036
    24037
    24038
    24039
    24040
    24099
    24100
    24101
    24102
    24103
    24186
    24187
    24188
    24189
    24190
    24274
    24275
    24276
    24277
    24278
    24342
    24343
    24344
    24345
    24346
    24400
    24401
    24402
    24403
    24404
    24486
    24487
    24488
    24489
    24490
    24575
    24576
    24577
    24578
    24579
    24647
    24648
    24649
    24650
    24651
    24703
    24704
    24705
    24706
    24707
    24785
    24786
    24787
    24788
    24789
    24875
    24876
    24877
    24878
    24879
    24952
    24953
    24954
    24955
    24956
    25006
    25007
    25008
    25009
    25010
    25085
    25086
    25087
    25088
    25089
    25175
    25176
    25177
    25178
    25179
    25256
    25257
    25258
    25259
    25260
    25311
    25312
    25313
    25314
    25315
    25385
    25386
    25387
    25388
    25389
    25475
    25476
    25477
    25478
    25479
    25559
    25560
    25561
    25562
    25563
    25616
    25617
    25618
    25619
    25620
    25685
    25686
    25687
    25688
    25689
    25774
    25775
    25776
    25777
    25778
    25861
    25862
    25863
    25864
    25865
    25922
    25923
    25924
    25925
    25926
    25986
    25987
    25988
    25989
    25990
    26074
    26075
    26076
    26077
    26078
    26162
    26163
    26164
    26165
    26166
    26228
    26229
    26230
    26231
    26232
    26288
    26289
    26290
    26291
    26292
    26373
    26374
    26375
    26376
    26377
    26462
    26463
    26464
    26465
    26466
    26534
    26535
    26536
    26537
    26538
    26590
    26591
    26592
    26593
    26594
    26673
    26674
    26675
    26676
    26677
    26763
    26764
    26765
    26766
    26767
    26839
    26840
    26841
    26842
    26843
    26893
    26894
    26895
    26896
    26897
    26973
    26974
    26975
    26976
    26977
    27062
    27063
    27064
    27065
    27066
    27143
    27144
    27145
    27146
    27147
    27197
    27198
    27199
    27200
    27201
    27273
    27274
    27275
    27276
    27277
    27362
    27363
    27364
    27365
    27366
    27446
    27447
    27448
    27449
    27450
    27502
    27503
    27504
    27505
    27506
    27573
    27574
    27575
    27576
    27577
    27662
    27663
    27664
    27665
    27666
    27748
    27749
    27750
    27751
    27752
    27808
    27809
    27810
    27811
    27812
    27874
    27875
    27876
    27877
    27878
    27961
    27962
    27963
    27964
    27965
    28049
    28050
    28051
    28052
    28053
    28114
    28115
    28116
    28117
    28118
    28175
    28176
    28177
    28178
    28179
    28261
    28262
    28263
    28264
    28265
    28350
    28351
    28352
    28353
    28354
    28420
    28421
    28422
    28423
    28424
    28477
    28478
    28479
    28480
    28481
    28561
    28562
    28563
    28564
    28565
    28650
    28651
    28652
    28653
    28654
    28726
    28727
    28728
    28729
    28730
    28780
    28781
    28782
    28783
    28784
    28860
    28861
    28862
    28863
    28864
    28950
    28951
    28952
    28953
    28954
    29030
    29031
    29032
    29033
    29034
    29084
    29085
    29086
    29087
    29088
    29160
    29161
    29162
    29163
    29164
    29250
    29251
    29252
    29253
    29254
    29333
    29334
    29335
    29336
    29337
    29389
    29390
    29391
    29392
    29393
    29460
    29461
    29462
    29463
    29464
    29549
    29550
    29551
    29552
    29553
    29635
    29636
    29637
    29638
    29639
    29695
    29696
    29697
    29698
    29699
    29761
    29762
    29763
    29764
    29765
    29849
    29850
    29851
    29852
    29853
    29936
    29937
    29938
    29939
    29940
    30001
    30002
    30003
    30004
    30005
    30062
    30063
    30064
    30065
    30066
    30148
    30149
    30150
    30151
    30152
    30237
    30238
    30239
    30240
    30241
    30307
    30308
    30309
    30310
    30311
    30364
    30365
    30366
    30367
    30368
    30448
    30449
    30450
    30451
    30452
    30538
    30539
    30540
    30541
    30542
    30612
    30613
    30614
    30615
    30616
    30667
    30668
    30669
    30670
    30671
    30748
    30749
    30750
    30751
    30752
    30837
    30838
    30839
    30840
    30841
    30917
    30918
    30919
    30920
    30921
    30970
    30971
    30972
    30973
    30974
    31048
    31049
    31050
    31051
    31052
    31137
    31138
    31139
    31140
    31141
    31220
    31221
    31222
    31223
    31224
    31275
    31276
    31277
    31278
    31279
    31348
    31349
    31350
    31351
    31352
    31437
    31438
    31439
    31440
    31441
    31522
    31523
    31524
    31525
    31526
    31581
    31582
    31583
    31584
    31585
    31648
    31649
    31650
    31651
    31652
    31736
    31737
    31738
    31739
    31740
    31824
    31825
    31826
    31827
    31828
    31887
    31888
    31889
    31890
    31891
    31949
    31950
    31951
    31952
    31953
    32036
    32037
    32038
    32039
    32040
    32125
    32126
    32127
    32128
    32129
    32192
    32193
    32194
    32195
    32196
    32250
    32251
    32252
    32253
    32254
    32335
    32336
    32337
    32338
    32339
    32424
    32425
    32426
    32427
    32428
    32499
    32500
    32501
    32502
    32503
    32552
    32553
    32554
    32555
    32556
    32634
    32635
    32636
    32637
    32638
    32725
    32726
    32727
    32728
    32729
    32803
    32804
    32805
    32806
    32807
    32857
    32858
    32859
    32860
    32861
    32935
    32936
    32937
    32938
    32939
    33025
    33026
    33027
    33028
    33029
    33107
    33108
    33109
    33110
    33111
    33162
    33163
    33164
    33165
    33166
    33235
    33236
    33237
    33238
    33239
    33324
    33325
    33326
    33327
    33328
    33409
    33410
    33411
    33412
    33413
    33467
    33468
    33469
    33470
    33471
    33535
    33536
    33537
    33538
    33539
    33624
    33625
    33626
    33627
    33628
    33711
    33712
    33713
    33714
    33715
    33773
    33774
    33775
    33776
    33777
    33836
    33837
    33838
    33839
    33840
    33923
    33924
    33925
    33926
    33927
    34012
    34013
    34014
    34015
    34016
    34079
    34080
    34081
    34082
    34083
    34138
    34139
    34140
    34141
    34142
    34223
    34224
    34225
    34226
    34227
    34312
    34313
    34314
    34315
    34316
    34385
    34386
    34387
    34388
    34389
    34440
    34441
    34442
    34443
    34444
    34523
    34524
    34525
    34526
    34527
    34612
    34613
    34614
    34615
    34616
    34690
    34691
    34692
    34693
    34694
    34744
    34745
    34746
    34747
    34748
    34822
    34823
    34824
    34825
    34826
    34912
    34913
    34914
    34915
    34916
    34994
    34995
    34996
    34997
    34998
    35048
    35049
    35050
    35051
    35052
    35122
    35123
    35124
    35125
    35126
    35212
    35213
    35214
    35215
    35216
    35296
    35297
    35298
    35299
    35300
    35354
    35355
    35356
    35357
    35358
    35423
    35424
    35425
    35426
    35427
    35511
    35512
    35513
    35514
    35515
    35598
    35599
    35600
    35601
    35602
    35660
    35661
    35662
    35663
    35664
    35724
    35725
    35726
    35727
    35728
    35811
    35812
    35813
    35814
    35815
    35899
    35900
    35901
    35902
    35903
    35966
    35967
    35968
    35969
    35970
    36025
    36026
    36027
    36028
    36029
    36111
    36112
    36113
    36114
    36115
    36200
    36201
    36202
    36203
    36204
    36272
    36273
    36274
    36275
    36276
    36327
    36328
    36329
    36330
    36331
    36410
    36411
    36412
    36413
    36414
    36500
    36501
    36502
    36503
    36504
    36576
    36577
    36578
    36579
    36580
    36631
    36632
    36633
    36634
    36635
    36710
    36711
    36712
    36713
    36714
    36800
    36801
    36802
    36803
    36804
    36880
    36881
    36882
    36883
    36884
    36935
    36936
    36937
    36938
    36939
    37010
    37011
    37012
    37013
    37014
    37099
    37100
    37101
    37102
    37103
    37183
    37184
    37185
    37186
    37187
    37240
    37241
    37242
    37243
    37244
    37310
    37311
    37312
    37313
    37314
    37399
    37400
    37401
    37402
    37403
    37485
    37486
    37487
    37488
    37489
    37546
    37547
    37548
    37549
    37550
    37611
    37612
    37613
    37614
    37615
    37698
    37699
    37700
    37701
    37702
    37786
    37787
    37788
    37789
    37790
    37852
    37853
    37854
    37855
    37856
    37912
    37913
    37914
    37915
    37916
    37998
    37999
    38000
    38001
    38002
    38087
    38088
    38089
    38090
    38091
    38158
    38159
    38160
    38161
    38162
    38214
    38215
    38216
    38217
    38218
    38298
    38299
    38300
    38301
    38302
    38387
    38388
    38389
    38390
    38391
    38463
    38464
    38465
    38466
    38467
    38517
    38518
    38519
    38520
    38521
    38597
    38598
    38599
    38600
    38601
    38687
    38688
    38689
    38690
    38691
    38767
    38768
    38769
    38770
    38771
    38821
    38822
    38823
    38824
    38825
    38897
    38898
    38899
    38900
    38901
    38987
    38988
    38989
    38990
    38991
    39070
    39071
    39072
    39073
    39074
    39127
    39128
    39129
    39130
    39131
    39197
    39198
    39199
    39200
    39201
    39286
    39287
    39288
    39289
    39290
    39372
    39373
    39374
    39375
    39376
    39432
    39433
    39434
    39435
    39436
    39498
    39499
    39500
    39501
    39502
    39586
    39587
    39588
    39589
    39590
    39674
    39675
    39676
    39677
    39678
    39738
    39739
    39740
    39741
    39742
    39799
    39800
    39801
    39802
    39803
    39885
    39886
    39887
    39888
    39889
    39974
    39975
    39976
    39977
    39978
    40044
    40045
    40046
    40047
    40048
    40101
    40102
    40103
    40104
    40105
    40185
    40186
    40187
    40188
    40189
    40275
    40276
    40277
    40278
    40279
    40350
    40351
    40352
    40353
    40354
    40404
    40405
    40406
    40407
    40408
    40485
    40486
    40487
    40488
    40489
    40574
    40575
    40576
    40577
    40578
    40654
    40655
    40656
    40657
    40658
    40708
    40709
    40710
    40711
    40712
    40785
    40786
    40787
    40788
    40789
    40874
    40875
    40876
    40877
    40878
    40957
    40958
    40959
    40960
    40961
    41013
    41014
    41015
    41016
    41017
    41085
    41086
    41087
    41088
    41089
    41174
    41175
    41176
    41177
    41178
    41259
    41260
    41261
    41262
    41263
    41319
    41320
    41321
    41322
    41323
    41385
    41386
    41387
    41388
    41389
    41473
    41474
    41475
    41476
    41477
    41561
    41562
    41563
    41564
    41565
    41625
    41626
    41627
    41628
    41629
    41686
    41687
    41688
    41689
    41690
    41773
    41774
    41775
    41776
    41777
    41862
    41863
    41864
    41865
    41866
    41931
    41932
    41933
    41934
    41935
    41988
    41989
    41990
    41991
    41992
    42072
    42073
    42074
    42075
    42076
    42162
    42163
    42164
    42165
    42166
    42236
    42237
    42238
    42239
    42240
    42291
    42292
    42293
    42294
    42295
    42372
    42373
    42374
    42375
    42376
    42462
    42463
    42464
    42465
    42466
    42541
    42542
    42543
    42544
    42545
    42595
    42596
    42597
    42598
    42599
    42672
    42673
    42674
    42675
    42676
    42762
    42763
    42764
    42765
    42766
    42844
    42845
    42846
    42847
    42848
    42899
    42900
    42901
    42902
    42903
    42972
    42973
    42974
    42975
    42976
    43061
    43062
    43063
    43064
    43065
    43146
    43147
    43148
    43149
    43150
    43205
    43206
    43207
    43208
    43209
    43272
    43273
    43274
    43275
    43276
    43361
    43362
    43363
    43364
    43365
    43448
    43449
    43450
    43451
    43452
    43511
    43512
    43513
    43514
    43515
    43573
    43574
    43575
    43576
    43577
    43660
    43661
    43662
    43663
    43664
    43749
    43750
    43751
    43752
    43753
    43817
    43818
    43819
    43820
    43821
    43875
    43876
    43877
    43878
    43879
    43960
    43961
    43962
    43963
    43964
    44049
    44050
    44051
    44052
    44053
    44123
    44124
    44125
    44126
    44127
    44178
    44179
    44180
    44181
    44182
    44259
    44260
    44261
    44262
    44263
    44349
    44350
    44351
    44352
    44353
    44427
    44428
    44429
    44430
    44431
    44481
    44482
    44483
    44484
    44485
    44559
    44560
    44561
    44562
    44563
    44649
    44650
    44651
    44652
    44653
    44731
    44732
    44733
    44734
    44735
    44786
    44787
    44788
    44789
    44790
    44859
    44860
    44861
    44862
    44863
    44949
    44950
    44951
    44952
    44953
    45033
    45034
    45035
    45036
    45037
    45091
    45092
    45093
    45094
    45095
    45160
    45161
    45162
    45163
    45164
    45248
    45249
    45250
    45251
    45252
    45335
    45336
    45337
    45338
    45339
    45397
    45398
    45399
    45400
    45401
    45460
    45461
    45462
    45463
    45464
    45548
    45549
    45550
    45551
    45552
    45636
    45637
    45638
    45639
    45640
    45703
    45704
    45705
    45706
    45707
    45762
    45763
    45764
    45765
    45766
    45847
    45848
    45849
    45850
    45851
    45937
    45938
    45939
    45940
    45941
    46009
    46010
    46011
    46012
    46013
    46064
    46065
    46066
    46067
    46068
    46147
    46148
    46149
    46150
    46151
    46237
    46238
    46239
    46240
    46241
    46314
    46315
    46316
    46317
    46318
    46368
    46369
    46370
    46371
    46372
    46447
    46448
    46449
    46450
    46451
    46536
    46537
    46538
    46539
    46540
    46618
    46619
    46620
    46621
    46622
    46672
    46673
    46674
    46675
    46676
    46747
    46748
    46749
    46750
    46751
    46836
    46837
    46838
    46839
    46840
    46920
    46921
    46922
    46923
    46924
    46978
    46979
    46980
    46981
    46982
    47047
    47048
    47049
    47050
    47051
    47136
    47137
    47138
    47139
    47140
    47222
    47223
    47224
    47225
    47226
    47284
    47285
    47286
    47287
    47288
    47348
    47349
    47350
    47351
    47352
    47435
    47436
    47437
    47438
    47439
    47523
    47524
    47525
    47526
    47527
    47590
    47591
    47592
    47593
    47594
    47649
    47650
    47651
    47652
    47653
    47735
    47736
    47737
    47738
    47739
    47824
    47825
    47826
    47827
    47828
    47895
    47896
    47897
    47898
    47899
    47951
    47952
    47953
    47954
    47955
    48034
    48035
    48036
    48037
    48038
    48124
    48125
    48126
    48127
    48128
    48200
    48201
    48202
    48203
    48204
    48254
    48255
    48256
    48257
    48258
    48334
    48335
    48336
    48337
    48338
    48424
    48425
    48426
    48427
    48428
    48504
    48505
    48506
    48507
    48508
    48559
    48560
    48561
    48562
    48563
    48634
    48635
    48636
    48637
    48638
    48723
    48724
    48725
    48726
    48727
    48807
    48808
    48809
    48810
    48811
    48864
    48865
    48866
    48867
    48868
    48934
    48935
    48936
    48937
    48938
    49023
    49024
    49025
    49026
    49027
    49109
    49110
    49111
    49112
    49113
    49170
    49171
    49172
    49173
    49174
    49235
    49236
    49237
    49238
    49239
    49323
    49324
    49325
    49326
    49327
    49410
    49411
    49412
    49413
    49414
    49476
    49477
    49478
    49479
    49480
    49536
    49537
    49538
    49539
    49540
    49622
    49623
    49624
    49625
    49626
    49711
    49712
    49713
    49714
    49715
    49782
    49783
    49784
    49785
    49786
    49838
    49839
    49840
    49841
    49842
    49922
    49923
    49924
    49925
    49926
    50011
    50012
    50013
    50014
    50015
    50087
    50088
    50089
    50090
    50091
    50141
    50142
    50143
    50144
    50145
    50221
    50222
    50223
    50224
    50225
    50311
    50312
    50313
    50314
    50315
    50391
    50392
    50393
    50394
    50395
    50445
    50446
    50447
    50448
    50449
    50521
    50522
    50523
    50524
    50525
    50611
    50612
    50613
    50614
    50615
    50694
    50695
    50696
    50697
    50698
    50750
    50751
    50752
    50753
    50754
    50821
    50822
    50823
    50824
    50825
    50910
    50911
    50912
    50913
    50914
    50996
    50997
    50998
    50999
    51000
    51056
    51057
    51058
    51059
    51060
    51122
    51123
    51124
    51125
    51126
    51210
    51211
    51212
    51213
    51214
    51298
    51299
    51300
    51301
    51302
    51362
    51363
    51364
    51365
    51366
    51423
    51424
    51425
    51426
    51427
    51509
    51510
    51511
    51512
    51513
    51598
    51599
    51600
    51601
    51602
    51668
    51669
    51670
    51671
    51672
    51725
    51726
    51727
    51728
    51729
    51809
    51810
    51811
    51812
    51813
    51899
    51900
    51901
    51902
    51903
    51973
    51974
    51975
    51976
    51977
    52028
    52029
    52030
    52031
    52032
    52109
    52110
    52111
    52112
    52113
    52198
    52199
    52200
    52201
    52202
    52278
    52279
    52280
    52281
    52282
    52332
    52333
    52334
    52335
    52336
    52409
    52410
    52411
    52412
    52413
    52498
    52499
    52500
    52501
    52502
    52581
    52582
    52583
    52584
    52585
    52637
    52638
    52639
    52640
    52641
    52709
    52710
    52711
    52712
    52713
    52798
    52799
    52800
    52801
    52802
    52883
    52884
    52885
    52886
    52887
    52943
    52944
    52945
    52946
    52947
    53009
    53010
    53011
    53012
    53013
    53097
    53098
    53099
    53100
    53101
    53185
    53186
    53187
    53188
    53189
    53249
    53250
    53251
    53252
    53253
    53310
    53311
    53312
    53313
    53314
    53397
    53398
    53399
    53400
    53401
    53486
    53487
    53488
    53489
    53490
    53555
    53556
    53557
    53558
    53559
    53612
    53613
    53614
    53615
    53616
    53696
    53697
    53698
    53699
    53700
    53786
    53787
    53788
    53789
    53790
    53860
    53861
    53862
    53863
    53864
    53915
    53916
    53917
    53918
    53919
    53996
    53997
    53998
    53999
    54000
    54086
    54087
    54088
    54089
    54090
    54164
    54165
    54166
    54167
    54168
    54218
    54219
    54220
    54221
    54222
    54296
    54297
    54298
    54299
    54300
    54386
    54387
    54388
    54389
    54390
    54468
    54469
    54470
    54471
    54472
    54523
    54524
    54525
    54526
    54527
    54596
    54597
    54598
    54599
    54600
    54685
    54686
    54687
    54688
    54689
    54770
    54771
    54772
    54773
    54774
    54829
    54830
    54831
    54832
    54833
    54896
    54897
    54898
    54899
    54900
    54985
    54986
    54987
    54988
    54989
    55072
    55073
    55074
    55075
    55076
    55135
    55136
    55137
    55138
    55139
    55197
    55198
    55199
    55200
    55201
    55284
    55285
    55286
    55287
    55288
    55373
    55374
    55375
    55376
    55377
    55441
    55442
    55443
    55444
    55445
    55499
    55500
    55501
    55502
    55503
    55584
    55585
    55586
    55587
    55588
    55673
    55674
    55675
    55676
    55677
    55746
    55747
    55748
    55749
    55750
    55801
    55802
    55803
    55804
    55805
    55883
    55884
    55885
    55886
    55887
    55973
    55974
    55975
    55976
    55977
    56051
    56052
    56053
    56054
    56055
    56105
    56106
    56107
    56108
    56109
    56183
    56184
    56185
    56186
    56187
    56273
    56274
    56275
    56276
    56277
    56355
    56356
    56357
    56358
    56359
    56410
    56411
    56412
    56413
    56414
    56483
    56484
    56485
    56486
    56487
    56573
    56574
    56575
    56576
    56577
    56657
    56658
    56659
    56660
    56661
    56715
    56716
    56717
    56718
    56719
    56784
    56785
    56786
    56787
    56788
    56872
    56873
    56874
    56875
    56876
    56959
    56960
    56961
    56962
    56963
    57021
    57022
    57023
    57024
    57025
    57084
    57085
    57086
    57087
    57088
    57172
    57173
    57174
    57175
    57176
    57260
    57261
    57262
    57263
    57264
    57327
    57328
    57329
    57330
    57331
    57386
    57387
    57388
    57389
    57390
    57471
    57472
    57473
    57474
    57475
    57560
    57561
    57562
    57563
    57564
    57633
    57634
    57635
    57636
    57637
    57688
    57689
    57690
    57691
    57692
    57771
    57772
    57773
    57774
    57775
    57860
    57861
    57862
    57863
    57864
    57938
    57939
    57940
    57941
    57942
    57992
    57993
    57994
    57995
    57996
    58071
    58072
    58073
    58074
    58075
    58160
    58161
    58162
    58163
    58164
    58242
    58243
    58244
    58245
    58246
    58296
    58297
    58298
    58299
    58300
    58371
    58372
    58373
    58374
    58375
    58460
    58461
    58462
    58463
    58464
    58544
    58545
    58546
    58547
    58548
    58602
    58603
    58604
    58605
    58606
    58671
    58672
    58673
    58674
    58675
    58760
    58761
    58762
    58763
    58764
    58846
    58847
    58848
    58849
    58850
    58907
    58908
    58909
    58910
    58911
    58972
    58973
    58974
    58975
    58976
    59059
    59060
    59061
    59062
    59063
    59147
    59148
    59149
    59150
    59151
    59214
    59215
    59216
    59217
    59218
    59273
    59274
    59275
    59276
    59277
    59359
    59360
    59361
    59362
    59363
    59448
    59449
    59450
    59451
    59452
    59519
    59520
    59521
    59522
    59523
    59575
    59576
    59577
    59578
    59579
    59658
    59659
    59660
    59661
    59662
    59748
    59749
    59750
    59751
    59752
    59824
    59825
    59826
    59827
    59828
    59878
    59879
    59880
    59881
    59882
    59958
    59959
    59960
    59961
    59962
    60048
    60049
    60050
    60051
    60052
    60128
    60129
    60130
    60131
    60132
    60183
    60184
    60185
    60186
    60187
    60258
    60259
    60260
    60261
    60262
    60347
    60348
    60349
    60350
    60351
    60431
    60432
    60433
    60434
    60435
    60488
    60489
    60490
    60491
    60492
    60558
    60559
    60560
    60561
    60562
    60647
    60648
    60649
    60650
    60651
    60733
    60734
    60735
    60736
    60737
    60794
    60795
    60796
    60797
    60798
    60859
    60860
    60861
    60862
    60863
    60946
    60947
    60948
    60949
    60950
    61034
    61035
    61036
    61037
    61038
    61100
    61101
    61102
    61103
    61104
    61160
    61161
    61162
    61163
    61164
    61246
    61247
    61248
    61249
    61250
    61335
    61336
    61337
    61338
    61339
    61406
    61407
    61408
    61409
    61410
    61462
    61463
    61464
    61465
    61466
    61546
    61547
    61548
    61549
    61550
    61635
    61636
    61637
    61638
    61639
    61711
    61712
    61713
    61714
    61715
    61765
    61766
    61767
    61768
    61769
    61845
    61846
    61847
    61848
    61849
    61935
    61936
    61937
    61938
    61939
    62015
    62016
    62017
    62018
    62019
    62069
    62070
    62071
    62072
    62073
    62145
    62146
    62147
    62148
    62149
    62235
    62236
    62237
    62238
    62239
    62318
    62319
    62320
    62321
    62322
    62374
    62375
    62376
    62377
    62378
    62445
    62446
    62447
    62448
    62449
    62534
    62535
    62536
    62537
    62538
    62620
    62621
    62622
    62623
    62624
    62680
    62681
    62682
    62683
    62684
    62746
    62747
    62748
    62749
    62750
    62834
    62835
    62836
    62837
    62838
    62921
    62922
    62923
    62924
    62925
    62986
    62987
    62988
    62989
    62990
    63047
    63048
    63049
    63050
    63051
    63133
    63134
    63135
    63136
    63137
    63222
    63223
    63224
    63225
    63226
    63292
    63293
    63294
    63295
    63296
    63349
    63350
    63351
    63352
    63353
    63433
    63434
    63435
    63436
    63437
    63522
    63523
    63524
    63525
    63526
    63597
    63598
    63599
    63600
    63601
    63652
    63653
    63654
    63655
    63656
    63733
    63734
    63735
    63736
    63737
    63822
    63823
    63824
    63825
    63826
    63902
    63903
    63904
    63905
    63906
    63956
    63957
    63958
    63959
    63960
    64031
    64032
    64033
    64034
    64035
    64122
    64123
    64124
    64125
    64126
    64205
    64206
    64207
    64208
    64209
    64260
    64261
    64262
    64263
    64264
    64333
    64334
    64335
    64336
    64337
    64421
    64422
    64423
    64424
    64425
    64507
    64508
    64509
    64510
    64511
    64566
    64567
    64568
    64569
    64570
    64632
    64633
    64634
    64635
    64636
    64721
    64722
    64723
    64724
    64725
    64808
    64809
    64810
    64811
    64812
    64872
    64873
    64874
    64875
    64876
    64933
    64934
    64935
    64936
    64937
    65021
    65022
    65023
    65024
    65025
    65108
    65109
    65110
    65111
    65112
    65177
    65178
    65179
    65180
    65181
    65236
    65237
    65238
    65239
    65240
    65320
    65321
    65322
    65323
    65324
    65409
    65410
    65411
    65412
    65413
    65483
    65484
    65485
    65486
    65487
    65538
    65539
    65540
    65541
    65542
    65620
    65621
    65622
    65623
    65624
    65710
    65711
    65712
    65713
    65714
    65788
    65789
    65790
    65791
    65792
    65842
    65843
    65844
    65845
    65846
    65920
    65921
    65922
    65923
    65924
    66009
    66010
    66011
    66012
    66013
    66092
    66093
    66094
    66095
    66096
    66147
    66148
    66149
    66150
    66151
    66220
    66221
    66222
    66223
    66224
    66309
    66310
    66311
    66312
    66313
    66394
    66395
    66396
    66397
    66398
    66453
    66454
    66455
    66456
    66457
    66520
    66521
    66522
    66523
    66524
    66609
    66610
    66611
    66612
    66613
    66696
    66697
    66698
    66699
    66700
    66759
    66760
    66761
    66762
    66763
    66821
    66822
    66823
    66824
    66825
    66908
    66909
    66910
    66911
    66912
    66997
    66998
    66999
    67000
    67001
    67065
    67066
    67067
    67068
    67069
    67123
    67124
    67125
    67126
    67127
    67208
    67209
    67210
    67211
    67212
    67297
    67298
    67299
    67300
    67301
    67370
    67371
    67372
    67373
    67374
    67425
    67426
    67427
    67428
    67429
    67507
    67508
    67509
    67510
    67511
    67597
    67598
    67599
    67600
    67601
    67675
    67676
    67677
    67678
    67679
    67729
    67730
    67731
    67732
    67733
    67807
    67808
    67809
    67810
    67811
    67897
    67898
    67899
    67900
    67901
    67979
    67980
    67981
    67982
    67983
    68033
    68034
    68035
    68036
    68037
    68107
    68108
    68109
    68110
    68111
    68196
    68197
    68198
    68199
    68200
    68281
    68282
    68283
    68284
    68285
    68339
    68340
    68341
    68342
    68343
    68407
    68408
    68409
    68410
    68411
    68496
    68497
    68498
    68499
    68500
    68583
    68584
    68585
    68586
    68587
    68645
    68646
    68647
    68648
    68649
    68708
    68709
    68710
    68711
    68712
    68795
    68796
    68797
    68798
    68799
    68884
    68885
    68886
    68887
    68888
    68951
    68952
    68953
    68954
    68955
    69010
    69011
    69012
    69013
    69014
    69095
    69096
    69097
    69098
    69099
    69184
    69185
    69186
    69187
    69188
    69257
    69258
    69259
    69260
    69261
    69312
    69313
    69314
    69315
    69316
    69395
    69396
    69397
    69398
    69399
    69484
    69485
    69486
    69487
    69488
    69561
    69562
    69563
    69564
    69565
    69615
    69616
    69617
    69618
    69619
    69694
    69695
    69696
    69697
    69698
    69784
    69785
    69786
    69787
    69788
    69865
    69866
    69867
    69868
    69869
    69920
    69921
    69922
    69923
    69924
    69994
    69995
    69996
    69997
    69998
    70084
    70085
    70086
    70087
    70088
    70168
    70169
    70170
    70171
    70172
    70225
    70226
    70227
    70228
    70229
    70295
    70296
    70297
    70298
    70299
    70383
    70384
    70385
    70386
    70387
    70470
    70471
    70472
    70473
    70474
    70531
    70532
    70533
    70534
    70535
    70595
    70596
    70597
    70598
    70599
    70683
    70684
    70685
    70686
    70687
    70771
    70772
    70773
    70774
    70775
    70837
    70838
    70839
    70840
    70841
    70897
    70898
    70899
    70900
    70901
    70982
    70983
    70984
    70985
    70986
    71071
    71072
    71073
    71074
    71075
    71143
    71144
    71145
    71146
    71147
    71199
    71200
    71201
    71202
    71203
    71282
    71283
    71284
    71285
    71286
    71372
    71373
    71374
    71375
    71376
    71448
    71449
    71450
    71451
    71452
    71502
    71503
    71504
    71505
    71506
    71582
    71583
    71584
    71585
    71586
    71671
    71672
    71673
    71674
    71675
    71752
    71753
    71754
    71755
    71756
    71806
    71807
    71808
    71809
    71810
    71882
    71883
    71884
    71885
    71886
    71971
    71972
    71973
    71974
    71975
    72055
    72056
    72057
    72058
    72059
    72112
    72113
    72114
    72115
    72116
    72182
    72183
    72184
    72185
    72186
    72271
    72272
    72273
    72274
    72275
    72357
    72358
    72359
    72360
    72361
    72418
    72419
    72420
    72421
    72422
    72482
    72483
    72484
    72485
    72486
    72570
    72571
    72572
    72573
    72574
    72658
    72659
    72660
    72661
    72662
    72724
    72725
    72726
    72727
    72728
    72784
    72785
    72786
    72787
    72788
    72870
    72871
    72872
    72873
    72874
    72959
    72960
    72961
    72962
    72963
    73029
    73030
    73031
    73032
    73033
    73086
    73087
    73088
    73089
    73090
    73169
    73170
    73171
    73172
    73173
    73259
    73260
    73261
    73262
    73263
    73335
    73336
    73337
    73338
    73339
    73389
    73390
    73391
    73392
    73393
    73469
    73470
    73471
    73472
    73473
    73559
    73560
    73561
    73562
    73563
    73639
    73640
    73641
    73642
    73643
    73693
    73694
    73695
    73696
    73697
    73769
    73770
    73771
    73772
    73773
    73858
    73859
    73860
    73861
    73862
    73942
    73943
    73944
    73945
    73946
    73998
    73999
    74000
    74001
    74002
    74069
    74070
    74071
    74072
    74073
    74158
    74159
    74160
    74161
    74162
    74244
    74245
    74246
    74247
    74248
    74304
    74305
    74306
    74307
    74308
    74370
    74371
    74372
    74373
    74374
    74458
    74459
    74460
    74461
    74462
    74545
    74546
    74547
    74548
    74549
    74610
    74611
    74612
    74613
    74614
    74671
    74672
    74673
    74674
    74675
    74757
    74758
    74759
    74760
    74761
    74846
    74847
    74848
    74849
    74850
    74916
    74917
    74918
    74919
    74920
    74973
    74974
    74975
    74976
    74977
    75057
    75058
    75059
    75060
    75061
    75146
    75147
    75148
    75149
    75150
    75221
    75222
    75223
    75224
    75225
    75275
    75276
    75277
    75278
    75279
    75356
    75357
    75358
    75359
    75360
    75446
    75447
    75448
    75449
    75450
    75525
    75526
    75527
    75528
    75529
    75579
    75580
    75581
    75582
    75583
    75656
    75657
    75658
    75659
    75660
    75746
    75747
    75748
    75749
    75750
    75829
    75830
    75831
    75832
    75833
    75884
    75885
    75886
    75887
    75888
    75956
    75957
    75958
    75959
    75960
    76045
    76046
    76047
    76048
    76049
    76131
    76132
    76133
    76134
    76135
    76190
    76191
    76192
    76193
    76194
    76257
    76258
    76259
    76260
    76261
    76345
    76346
    76347
    76348
    76349
    76432
    76433
    76434
    76435
    76436
    76496
    76497
    76498
    76499
    76500
    76558
    76559
    76560
    76561
    76562
    76644
    76645
    76646
    76647
    76648
    76733
    76734
    76735
    76736
    76737
    76802
    76803
    76804
    76805
    76806
    76860
    76861
    76862
    76863
    76864
    76944
    76945
    76946
    76947
    76948
    77033
    77034
    77035
    77036
    77037
    77108
    77109
    77110
    77111
    77112
    77162
    77163
    77164
    77165
    77166
    77244
    77245
    77246
    77247
    77248
    77333
    77334
    77335
    77336
    77337
    77412
    77413
    77414
    77415
    77416
    77466
    77467
    77468
    77469
    77470
    77543
    77544
    77545
    77546
    77547
    77633
    77634
    77635
    77636
    77637
    77715
    77716
    77717
    77718
    77719
    77771
    77772
    77773
    77774
    77775
    77843
    77844
    77845
    77846
    77847
    77933
    77934
    77935
    77936
    77937
    78018
    78019
    78020
    78021
    78022
    78076
    78077
    78078
    78079
    78080
    78144
    78145
    78146
    78147
    78148
    78232
    78233
    78234
    78235
    78236
    78319
    78320
    78321
    78322
    78323
    78382
    78383
    78384
    78385
    78386
    78445
    78446
    78447
    78448
    78449
    78532
    78533
    78534
    78535
    78536
    78620
    78621
    78622
    78623
    78624
    78688
    78689
    78690
    78691
    78692
    78746
    78747
    78748
    78749
    78750
    78831
    78832
    78833
    78834
    78835
    78921
    78922
    78923
    78924
    78925
    78994
    78995
    78996
    78997
    78998
    79049
    79050
    79051
    79052
    79053
    79131
    79132
    79133
    79134
    79135
    79221
    79222
    79223
    79224
    79225
    79299
    79300
    79301
    79302
    79303
    79353
    79354
    79355
    79356
    79357
    79431
    79432
    79433
    79434
    79435
    79520
    79521
    79522
    79523
    79524
    79602
    79603
    79604
    79605
    79606
    79657
    79658
    79659
    79660
    79661
    79731
    79732
    79733
    79734
    79735
    79820
    79821
    79822
    79823
    79824
    79905
    79906
    79907
    79908
    79909
    79963
    79964
    79965
    79966
    79967
    80031
    80032
    80033
    80034
    80035
    80120
    80121
    80122
    80123
    80124
    80207
    80208
    80209
    80210
    80211
    80269
    80270
    80271
    80272
    80273
    80332
    80333
    80334
    80335
    80336
    80419
    80420
    80421
    80422
    80423
    80507
    80508
    80509
    80510
    80511
    80575
    80576
    80577
    80578
    80579
    80633
    80634
    80635
    80636
    80637
    80719
    80720
    80721
    80722
    80723
    80808
    80809
    80810
    80811
    80812
    80880
    80881
    80882
    80883
    80884
    80936
    80937
    80938
    80939
    80940
    81018
    81019
    81020
    81021
    81022
    81108
    81109
    81110
    81111
    81112
    81185
    81186
    81187
    81188
    81189
    81239
    81240
    81241
    81242
    81243
    81318
    81319
    81320
    81321
    81322
    81408
    81409
    81410
    81411
    81412
    81489
    81490
    81491
    81492
    81493
    81544
    81545
    81546
    81547
    81548
    81618
    81619
    81620
    81621
    81622
    81707
    81708
    81709
    81710
    81711
    81792
    81793
    81794
    81795
    81796
    81849
    81850
    81851
    81852
    81853
    81918
    81919
    81920
    81921
    81922
    82007
    82008
    82009
    82010
    82011
    82094
    82095
    82096
    82097
    82098
    82155
    82156
    82157
    82158
    82159
    82219
    82220
    82221
    82222
    82223
    82307
    82308
    82309
    82310
    82311
    82395
    82396
    82397
    82398
    82399
    82461
    82462
    82463
    82464
    82465
    82520
    82521
    82522
    82523
    82524
    82606
    82607
    82608
    82609
    82610
    82695
    82696
    82697
    82698
    82699
    82767
    82768
    82769
    82770
    82771
    82823
    82824
    82825
    82826
    82827
    82906
    82907
    82908
    82909
    82910
    82995
    82996
    82997
    82998
    82999
    83072
    83073
    83074
    83075
    83076
    83126
    83127
    83128
    83129
    83130
    83205
    83206
    83207
    83208
    83209
    83295
    83296
    83297
    83298
    83299
    83376
    83377
    83378
    83379
    83380
    83430
    83431
    83432
    83433
    83434
    83505
    83506
    83507
    83508
    83509
    83595
    83596
    83597
    83598
    83599
    83679
    83680
    83681
    83682
    83683
    83735
    83736
    83737
    83738
    83739
    83805
    83806
    83807
    83808
    83809
    83894
    83895
    83896
    83897
    83898
    83981
    83982
    83983
    83984
    83985
    84041
    84042
    84043
    84044
    84045
    84106
    84107
    84108
    84109
    84110
    84194
    84195
    84196
    84197
    84198
    84282
    84283
    84284
    84285
    84286
    84347
    84348
    84349
    84350
    84351
    84407
    84408
    84409
    84410
    84411
    84493
    84494
    84495
    84496
    84497
    84582
    84583
    84584
    84585
    84586
    84653
    84654
    84655
    84656
    84657
    84709
    84710
    84711
    84712
    84713
    84793
    84794
    84795
    84796
    84797
    84883
    84884
    84885
    84886
    84887
    84958
    84959
    84960
    84961
    84962
    85013
    85014
    85015
    85016
    85017
    85093
    85094
    85095
    85096
    85097
    85182
    85183
    85184
    85185
    85186
    85262
    85263
    85264
    85265
    85266
    85317
    85318
    85319
    85320
    85321
    85393
    85394
    85395
    85396
    85397
    85482
    85483
    85484
    85485
    85486
    85566
    85567
    85568
    85569
    85570
    85622
    85623
    85624
    85625
    85626
    85693
    85694
    85695
    85696
    85697
    85782
    85783
    85784
    85785
    85786
    85868
    85869
    85870
    85871
    85872
    85928
    85929
    85930
    85931
    85932
    85993
    85994
    85995
    85996
    85997
    86081
    86082
    86083
    86084
    86085
    86169
    86170
    86171
    86172
    86173
    86234
    86235
    86236
    86237
    86238
    86294
    86295
    86296
    86297
    86298
    86381
    86382
    86383
    86384
    86385
    86470
    86471
    86472
    86473
    86474
    86539
    86540
    86541
    86542
    86543
    86596
    86597
    86598
    86599
    86600
    86680
    86681
    86682
    86683
    86684
    86770
    86771
    86772
    86773
    86774
    86845
    86846
    86847
    86848
    86849
    86899
    86900
    86901
    86902
    86903
    86980
    86981
    86982
    86983
    86984
    87070
    87071
    87072
    87073
    87074
    87149
    87150
    87151
    87152
    87153
    87203
    87204
    87205
    87206
    87207
    87280
    87281
    87282
    87283
    87284
    87369
    87370
    87371
    87372
    87373
    87452
    87453
    87454
    87455
    87456
    87508
    87509
    87510
    87511
    87512
    87580
    87581
    87582
    87583
    87584
    87669
    87670
    87671
    87672
    87673
    87755
    87756
    87757
    87758
    87759
    87814
    87815
    87816
    87817
    87818
    87880
    87881
    87882
    87883
    87884
    87969
    87970
    87971
    87972
    87973
    88056
    88057
    88058
    88059
    88060
    88120
    88121
    88122
    88123
    88124
    88181
    88182
    88183
    88184
    88185
    88268
    88269
    88270
    88271
    88272
    88357
    88358
    88359
    88360
    88361
    88426
    88427
    88428
    88429
    88430
    88483
    88484
    88485
    88486
    88487
    88568
    88569
    88570
    88571
    88572
    88657
    88658
    88659
    88660
    88661
    88731
    88732
    88733
    88734
    88735
    88786
    88787
    88788
    88789
    88790
    88867
    88868
    88869
    88870
    88871
    88957
    88958
    88959
    88960
    88961
    89036
    89037
    89038
    89039
    89040
    89090
    89091
    89092
    89093
    89094
    89167
    89168
    89169
    89170
    89171
    89257
    89258
    89259
    89260
    89261
    89339
    89340
    89341
    89342
    89343
    89395
    89396
    89397
    89398
    89399
    89467
    89468
    89469
    89470
    89471
    89556
    89557
    89558
    89559
    89560
    89642
    89643
    89644
    89645
    89646
    89700
    89701
    89702
    89703
    89704
    89768
    89769
    89770
    89771
    89772
    89856
    89857
    89858
    89859
    89860
    89943
    89944
    89945
    89946
    89947
    90006
    90007
    90008
    90009
    90010
    90069
    90070
    90071
    90072
    90073
    90155
    90156
    90157
    90158
    90159
    90244
    90245
    90246
    90247
    90248
    90312
    90313
    90314
    90315
    90316
    90370
    90371
    90372
    90373
    90374
    90455
    90456
    90457
    90458
    90459
    90544
    90545
    90546
    90547
    90548
    90618
    90619
    90620
    90621
    90622
    90673
    90674
    90675
    90676
    90677
    90755
    90756
    90757
    90758
    90759
    90844
    90845
    90846
    90847
    90848
    90922
    90923
    90924
    90925
    90926
    90976
    90977
    90978
    90979
    90980
    91054
    91055
    91056
    91057
    91058
    91144
    91145
    91146
    91147
    91148
    91226
    91227
    91228
    91229
    91230
    91281
    91282
    91283
    91284
    91285
    91354
    91355
    91356
    91357
    91358
    91444
    91445
    91446
    91447
    91448
    91529
    91530
    91531
    91532
    91533
    91586
    91587
    91588
    91589
    91590
    91655
    91656
    91657
    91658
    91659
    91743
    91744
    91745
    91746
    91747
    91830
    91831
    91832
    91833
    91834
    91892
    91893
    91894
    91895
    91896
    91956
    91957
    91958
    91959
    91960
    92043
    92044
    92045
    92046
    92047
    92131
    92132
    92133
    92134
    92135
    92198
    92199
    92200
    92201
    92202
    92257
    92258
    92259
    92260
    92261
    92342
    92343
    92344
    92345
    92346
    92432
    92433
    92434
    92435
    92436
    92504
    92505
    92506
    92507
    92508
    92559
    92560
    92561
    92562
    92563
    92642
    92643
    92644
    92645
    92646
    92732
    92733
    92734
    92735
    92736
    92809
    92810
    92811
    92812
    92813
    92863
    92864
    92865
    92866
    92867
    92942
    92943
    92944
    92945
    92946
    93031
    93032
    93033
    93034
    93035
    93113
    93114
    93115
    93116
    93117
    93167
    93168
    93169
    93170
    93171
    93242
    93243
    93244
    93245
    93246
    93331
    93332
    93333
    93334
    93335
    93415
    93416
    93417
    93418
    93419
    93473
    93474
    93475
    93476
    93477
    93542
    93543
    93544
    93545
    93546
    93631
    93632
    93633
    93634
    93635
    93717
    93718
    93719
    93720
    93721
    93779
    93780
    93781
    93782
    93783
    93843
    93844
    93845
    93846
    93847
    93930
    93931
    93932
    93933
    93934
    94018
    94019
    94020
    94021
    94022
    94085
    94086
    94087
    94088
    94089
    94144
    94145
    94146
    94147
    94148
    94230
    94231
    94232
    94233
    94234
    94319
    94320
    94321
    94322
    94323
    94390
    94391
    94392
    94393
    94394
    94446
    94447
    94448
    94449
    94450
    94529
    94530
    94531
    94532
    94533
    94619
    94620
    94621
    94622
    94623
    94695
    94696
    94697
    94698
    94699
    94750
    94751
    94752
    94753
    94754
    94829
    94830
    94831
    94832
    94833
    94919
    94920
    94921
    94922
    94923
    94999
    95000
    95001
    95002
    95003
    95054
    95055
    95056
    95057
    95058
    95129
    95130
    95131
    95132
    95133
    95218
    95219
    95220
    95221
    95222
    95302
    95303
    95304
    95305
    95306
    95359
    95360
    95361
    95362
    95363
    95429
    95430
    95431
    95432
    95433
    95518
    95519
    95520
    95521
    95522
    95604
    95605
    95606
    95607
    95608
    95665
    95666
    95667
    95668
    95669
    95730
    95731
    95732
    95733
    95734
    95818
    95819
    95820
    95821
    95822
    95905
    95906
    95907
    95908
    95909
    95971
    95972
    95973
    95974
    95975
    96031
    96032
    96033
    96034
    96035
    96117
    96118
    96119
    96120
    96121
    96206
    96207
    96208
    96209
    96210
    96277
    96278
    96279
    96280
    96281
    96333
    96334
    96335
    96336
    96337
    96417
    96418
    96419
    96420
    96421
    96506
    96507
    96508
    96509
    96510
    96582
    96583
    96584
    96585
    96586
    96636
    96637
    96638
    96639
    96640
    96716
    96717
    96718
    96719
    96720
    96806
    96807
    96808
    96809
    96810
    96886
    96887
    96888
    96889
    96890
    96940
    96941
    96942
    96943
    96944
    97016
    97017
    97018
    97019
    97020
    97106
    97107
    97108
    97109
    97110
    97189
    97190
    97191
    97192
    97193
    97245
    97246
    97247
    97248
    97249
    97316
    97317
    97318
    97319
    97320
    97405
    97406
    97407
    97408
    97409
    97491
    97492
    97493
    97494
    97495
    97551
    97552
    97553
    97554
    97555
    97617
    97618
    97619
    97620
    97621
    97705
    97706
    97707
    97708
    97709
    97793
    97794
    97795
    97796
    97797
    97857
    97858
    97859
    97860
    97861
    97918
    97919
    97920
    97921
    97922
    98004
    98005
    98006
    98007
    98008
    98093
    98094
    98095
    98096
    98097
    98163
    98164
    98165
    98166
    98167
    98220
    98221
    98222
    98223
    98224
    98304
    98305
    98306
    98307
    98308
    98393
    98394
    98395
    98396
    98397
    98468
    98469
    98470
    98471
    98472
    98523
    98524
    98525
    98526
    98527
    98604
    98605
    98606
    98607
    98608
    98693
    98694
    98695
    98696
    98697
    98773
    98774
    98775
    98776
    98777
    98827
    98828
    98829
    98830
    98831
    98903
    98904
    98905
    98906
    98907
    98993
    98994
    98995
    98996
    98997
    99076
    99077
    99078
    99079
    99080
    99132
    99133
    99134
    99135
    99136
    99204
    99205
    99206
    99207
    99208
    99293
    99294
    99295
    99296
    99297
    99378
    99379
    99380
    99381
    99382
    99438
    99439
    99440
    99441
    99442
    99504
    99505
    99506
    99507
    99508
    99592
    99593
    99594
    99595
    99596
    99680
    99681
    99682
    99683
    99684
    99744
    99745
    99746
    99747
    99748
    99805
    99806
    99807
    99808
    99809
    99892
    99893
    99894
    99895
    99896
    99980
    99981
    99982
    99983
    99984

```python
RA_roots = sorted(set(roots))
```

```python
# redifine residue_RA for plotting
def residue_RA(lam):
    mu = (beta * lam**2 + (beta - 1.0)/4.0)**(1/2)
    A = np.sin(lam*L1) + 2*lam*np.cos(lam*L1)
    B = np.sin(mu*L2) + 2*mu*np.cos(mu*L2)
    C = (1 + 4*mu**2)*(K_s2/K_s1)*np.sin(lam*L1)*np.sin(mu*L2)
    return A * B - C
```

```python
# check if there are no missing roots
plt.plot(lam_test, residue_RA(lam_test))
plt.scatter(RA_roots, residue_RA(np.array(RA_roots)), c = 'r')
plt.xlim(0, 5)
plt.ylim(-.25, .25)
```

```python
plt.plot(lam_test, residue_RA(lam_test))
plt.scatter(RA_roots, residue_RA(np.array(RA_roots)), c = 'r')
plt.xlim(4, 10)
plt.ylim(-.25, .25)
```

```python
residue_RA(np.array(RA_roots))
```

    array([ 1.33226763e-15,  1.85962357e-15,  1.99840144e-15, ...,
           -8.82573659e-09, -2.36650521e-08, -4.54201654e-08])

```python
# summation in Equation 22a and 22b in their paper (Srivastva and Yeh, 1991)
RA1 = np.zeros(t1_mesh.shape)
RA2 = np.zeros(t2_mesh.shape)

for root in RA_roots:
    mu = (beta*root**2 + (beta - 1.0)/4.0)**(1/2)
    A_ss = 4 * beta * root *K_s2/K_s1 + root*(L1 + beta* L2)
    A_sc = K_s2/K_s1*(beta * root * L2)/(2*mu)*(1 + 4*mu**2) + 2*root*mu*L1- (beta * root)/(2*mu)*(2 + L2)
    A_cs = K_s2/K_s1*L1/2*(1 + 4*mu**2) + 2*beta*root**2*L2 - 1.0 - L1/2.0
    A_cc = -mu*(2.0 + L1) - beta*root**2/mu*(2.0 + L2)

    D_n = (1/4 + root**2)/(mu*root)* \
         (A_ss*np.sin(root*L1)*np.sin(mu*L2) + \
          A_sc*np.sin(root*L1)*np.cos(mu*L2) + \
          A_cs*np.cos(root*L1)*np.sin(mu*L2) + \
          A_cc*np.cos(root*L1)*np.cos(mu*L2))

    RA1 += np.sin(root*(L1 + z1_mesh))*np.exp(-(1/4 + root**2)*t1_mesh)/D_n
    RA2 += (np.sin(root*L1) * (np.sin(mu*(L2 - z2_mesh)) + 2*mu*np.cos(mu*(L2 - z2_mesh)))\
            * np.exp(-(1/4 + root**2)*t2_mesh))/(D_n * (np.sin(mu*L2) + 2*mu*np.cos(mu*L2)))
```

In the example, $\beta = 10.0$ and thus we only use Case B. Also, Because $(\frac{\beta - 1}{4\beta})^{1/2} = 0.4743...$, we only take into accout of $\lambda < 0.474$.

```python
((beta-1)/(4*beta))**(1/2)
```

    0.4743416490252569

```python
lam_test = np.arange(0, 0.474, 0.001)
```

```python
def residue_RB(lam):
    mu = ((beta - 1.0)/4.0 - beta * lam**2)**(1/2)
    A = np.sinh(lam*L1) + 2*lam*np.cosh(lam*L1)
    B = np.sin(mu*L2) + 2*mu*np.cos(mu*L2)
    C = (1 + 4*mu**2)*(K_s2/K_s1)*np.sinh(lam*L1)*np.sin(mu*L2)
    return A * B - C
```

```python
# two sign changes: one is due to discontinuity, and the other one is the root
pd.set_option('display.max_rows', None)
data = {"lam": lam_test.flatten()[0:-1],
        "sign": np.sign(residue_RB(lam_test)).flatten()[0:-1],
        "change": np.sign(residue_RB(lam_test)).flatten()[0:-1] - np.sign(residue_RB(lam_test)).flatten()[1:]}
df = pd.DataFrame(data)

a_set = df.loc[np.abs(df["change"]) == 2]["lam"].values
```

```python
# program to find roots using Newton method

def residue_RB(lam):
    mu = ((beta - 1.0)/4.0 - beta * lam**2)**(1/2)
    A = mpmath.sinh(lam*L1) + 2*lam*mpmath.cosh(lam*L1)
    B = mpmath.sin(mu*L2) + 2*mu*mpmath.cos(mu*L2)
    C = (1 + 4*mu**2)*(K_s2/K_s1)*mpmath.sinh(lam*L1)*mpmath.sin(mu*L2)
    return A * B - C

roots = []

for a in a_set:
    a = int(a/0.001)
    for i in range(a, a + 10):
        print(i)
        initial_value = 0.001 * (i + 1)
        root = mpmath.findroot(residue_RB, initial_value, solver = 'newton')
        root_value = np.array(root, np.float).tolist()
        roots.append(root_value)
```

```python
# these roots are obtained through Newton's methoda
RB_roots = sorted(set(roots))
```

```python
# redifine for the plotting
def residue_RB(lam):
    mu = ((beta - 1.0)/4.0 - beta * lam**2)**(1/2)
    A = np.sinh(lam*L1) + 2*lam*np.cosh(lam*L1)
    B = np.sin(mu*L2) + 2*mu*np.cos(mu*L2)
    C = (1 + 4*mu**2)*(K_s2/K_s1)*np.sinh(lam*L1)*np.sin(mu*L2)
    return A * B - C
```

```python
plt.plot(lam_test, residue_RB(lam_test))
plt.scatter(RB_roots, residue_RB(np.array(RB_roots)), c = 'r')
plt.xlim(0, 0.5)
plt.ylim(-.25, .25)
```

```python
residue_RB(np.array(RB_roots))
```

    array([-3.77475828e-15,  1.42108547e-14,  2.66453526e-14, -1.69642078e-13,
            3.55271368e-14])

```python
# summation in Equation 25a and 25b in their paper (Srivastva and Yeh, 1991)
RB1 = np.zeros(t1_mesh.shape)
RB2 = np.zeros(t2_mesh.shape)

for root in RB_roots:
    mu = ((beta - 1.0)/4.0 - beta * root**2)**(1/2)
    B_ss = 4 * beta * root *K_s2/K_s1 + root*(L1 + beta* L2)
    B_sc = K_s2/K_s1*(beta * root * L2)/(2*mu)*(1 + 4*mu**2) + 2*root*mu*L1- (beta * root)/(2*mu)*(2 + L2)
    B_cs = -K_s2/K_s1*L1/2*(1 + 4*mu**2) + 2*beta*root**2*L2 + 1.0 + L1/2.0
    B_cc = mu*(2.0 + L1) - beta*root**2/mu*(2 + L2)

    D_n = (1/4 - root**2)/(mu*root)* \
         (B_ss*np.sinh(root*L1)*np.sin(mu*L2) + \
          B_sc*np.sinh(root*L1)*np.cos(mu*L2) + \
          B_cs*np.cosh(root*L1)*np.sin(mu*L2) + \
          B_cc*np.cosh(root*L1)*np.cos(mu*L2))

    RB1 += np.sinh(root*(L1 + z1_mesh))*np.exp(-(1/4 - root**2)*t1_mesh)/D_n
    RB2 += (np.sinh(root*L1) * (np.sin(mu*(L2 - z2_mesh)) + 2*mu*np.cos(mu*(L2 - z2_mesh)))\
            * np.exp(-(1/4 - root**2)*t2_mesh))/(D_n * (np.sin(mu*L2) + 2*mu*np.cos(mu*L2)))
```

```python
# Equation 30a and 30b in their paper (Srivastva and Yeh, 1991)
# note the analytical solution assumes alpha1 = alpha2

K_1 = q_B1 - (q_B1 - np.exp(alpha1 * psi_0)) * np.exp(-(L1 + z1_mesh)) \
      - 4 * (q_B1 - q_A1) * np.exp((L2 - z1_mesh)/2) * (RA1 + RB1)

K_2 = q_B2 - (q_B2 - q_B1 + (q_B1 - np.exp(alpha2 * psi_0)) * np.exp(-L1)) * np.exp(-z2_mesh) \
      - 4 * (q_B1 - q_A1) * np.exp((L2 - z2_mesh)/2) * (RA2 + RB2)

```

```python
# transformation
K_1_star = K_1 * K_s1
K_2_star = K_2 * K_s2
psi_1 = np.log(K_1_star/K_s1)/alpha1
psi_2 = np.log(K_2_star/K_s2)/alpha2
```

```python
psi_ini = np.concatenate((psi_2_ini, psi_1_ini), axis = 0)
z_star = np.concatenate((z2_star, z1_star), axis = 0)
psi = np.concatenate((psi_2, psi_1), axis = 0)
```

```python
# the initial condition is used for the solution at t = 0 because the numerical solution is unstable at t = 0.
psi[:, 0] = psi_ini.flatten()
```

```python
plt.plot(psi[:, 0], z_star, label = "t = 0 hour")
plt.plot(psi[:, 1], z_star, label = "t = 1 hour")
plt.plot(psi[:, 5], z_star, label = "t = 5 hour")
plt.plot(psi[:, 10], z_star, label = "t = 10 hour")
plt.plot(psi[:, 20], z_star, label = "t = 20 hour")
plt.plot(psi[:, 50], z_star, label = "t = 50 hour")
plt.plot(psi[:, 100], z_star, label = "t = 100 hour")

plt.legend(bbox_to_anchor=(1.05, 1), loc='upper left',)
plt.xlabel("$\\psi$ cm")
plt.ylabel("$z$ cm")
plt.xlim(-50, 0)
plt.ylim(-100, 100)
```

```python
# save solutions
# psi: each column for each time (0, 0.1, 0.2, ..., 10 hours)
# each row for each depth (10, 9.9, ..., -10.0 cm)
```

```python
# numpy format
# np.save("Srivastava_psi_heterogeneous", psi)
# matlab format
# matlab_data = {'data':psi}
# scipy.io.savemat("Srivastava_psi_heterogeneous", matlab_data)
```