```python
import matplotlib.pyplot as plt
import equations as eq
import sympy as sp
from solvers import *

%matplotlib inline
```

To build the discrete operator

\begin{equation}
A = a(x, y)\partial_x^2 + b(x, y)\partial_y^2 + \alpha(x, y)\partial_x + \beta(x, y)\partial_y + q(x, y) \partial_x\partial_y
\end{equation}

with the exact solution

\begin{equation}
u(x, y) = u_{\sf exact}
\end{equation}

fill coefficients and exact solution in the following template

```python
def my_favourite_equation(L_x, L_y):
    x, y = sp.symbols('x, y', real=True)
    a = .0
    b = .0
    alpha = .0
    beta = .0
    q = .0
    exact = .0
    return eq.construct_equation(a, b, alpha, beta, q, exact, x, y, L_x, L_y)
```

Here $L_x, L_y$ define the physical space $x, y \in \left[0, L_x\right]\times\left[0, L_y\right]$.

As an example we consider the following equation

\begin{equation}
    \cosh(x y)\partial^2_x + \left[1 + \cos(\pi x^2 y)\right]^2 \partial_y^2 + \exp(x)\partial_x + \exp(y)\partial_y + (1-x)(1-y)\partial_x\partial_y,
\end{equation}

\begin{equation}
    u_{\sf exact} = x + y + 3x^3
\end{equation}

```python
def equation_1633(L_x, L_y):
    x, y = sp.symbols('x, y', real=True)
    a = sp.cosh(x*y)
    b = (1 + sp.cos(sp.pi*x**2*y))**2
    alpha = sp.exp(x)
    beta = sp.exp(y)
    q = (1-x)*(1-y)
    exact = x + y + 3*x**3
    return eq.construct_equation(a, b, alpha, beta, q, exact, x, y, L_x, L_y)
```

When equation is defined we pass it to the function that construct ``coo_matrix``

```python
J = 5
n_x = n_y = 2**5
h = 2**-5

A, rhs, exact = eq.construct_matrix(equation_1633, 'Dirichlet', 1, 1, n_x, n_y)
```

We convert ``coo_matrix`` to dense format of ``numpy``

```python
A = A.toarray()
```

Now, we can run available solvers.

BiCGSTAB (scipy)

```python
solution, E_CG = BICGSTAB(A, rhs, tol=1e-15, verbose=True, write=True)
```

    Iteration #1
          error = 6e+03
    Iteration #2
          error = 2.6e+03
    Iteration #3
          error = 1.7e+03
    Iteration #4
          error = 1.2e+03
    Iteration #5
          error = 9.7e+02
    Iteration #6
          error = 7.9e+02
    Iteration #7
          error = 7.1e+02
    Iteration #8
          error = 5.9e+02
    Iteration #9
          error = 5.1e+02
    Iteration #10
          error = 4.6e+02
    Iteration #11
          error = 3.8e+02
    Iteration #12
          error = 3.4e+02
    Iteration #13
          error = 3e+02
    Iteration #14
          error = 2.7e+02
    Iteration #15
          error = 2.4e+02
    Iteration #16
          error = 2.1e+02
    Iteration #17
          error = 2e+02
    Iteration #18
          error = 1.9e+02
    Iteration #19
          error = 1.9e+02
    Iteration #20
          error = 1.7e+02
    Iteration #21
          error = 1.6e+02
    Iteration #22
          error = 1.5e+02
    Iteration #23
          error = 1.3e+02
    Iteration #24
          error = 1.2e+02
    Iteration #25
          error = 1e+02
    Iteration #26
          error = 9.6e+01
    Iteration #27
          error = 8.6e+01
    Iteration #28
          error = 8e+01
    Iteration #29
          error = 7.5e+01
    Iteration #30
          error = 6.9e+01
    Iteration #31
          error = 6.3e+01
    Iteration #32
          error = 5.9e+01
    Iteration #33
          error = 5.4e+01
    Iteration #34
          error = 4.9e+01
    Iteration #35
          error = 4.5e+01
    Iteration #36
          error = 4.2e+01
    Iteration #37
          error = 3.8e+01
    Iteration #38
          error = 3.5e+01
    Iteration #39
          error = 2.8e+01
    Iteration #40
          error = 2.8e+01
    Iteration #41
          error = 2.6e+01
    Iteration #42
          error = 2.2e+01
    Iteration #43
          error = 2.3e+01
    Iteration #44
          error = 1.7e+01
    Iteration #45
          error = 1.6e+01
    Iteration #46
          error = 1.4e+01
    Iteration #47
          error = 1.5e+02
    Iteration #48
          error = 1.3e+01
    Iteration #49
          error = 1.2e+01
    Iteration #50
          error = 1.2e+01
    Iteration #51
          error = 1.1e+01
    Iteration #52
          error = 9.3
    Iteration #53
          error = 8.8
    Iteration #54
          error = 9.7
    Iteration #55
          error = 5.2
    Iteration #56
          error = 4.3
    Iteration #57
          error = 4.5
    Iteration #58
          error = 4.3
    Iteration #59
          error = 5.9
    Iteration #60
          error = 6.5
    Iteration #61
          error = 6.0
    Iteration #62
          error = 2.9
    Iteration #63
          error = 2.2
    Iteration #64
          error = 2.5
    Iteration #65
          error = 2.1
    Iteration #66
          error = 2.3
    Iteration #67
          error = 2.0
    Iteration #68
          error = 1.2
    Iteration #69
          error = 0.54
    Iteration #70
          error = 0.49
    Iteration #71
          error = 0.27
    Iteration #72
          error = 0.21
    Iteration #73
          error = 0.11
    Iteration #74
          error = 0.1
    Iteration #75
          error = 0.087
    Iteration #76
          error = 3.2
    Iteration #77
          error = 0.15
    Iteration #78
          error = 0.13
    Iteration #79
          error = 0.12
    Iteration #80
          error = 0.1
    Iteration #81
          error = 0.11
    Iteration #82
          error = 0.15
    Iteration #83
          error = 0.12
    Iteration #84
          error = 0.12
    Iteration #85
          error = 0.014
    Iteration #86
          error = 0.0044
    Iteration #87
          error = 0.0029
    Iteration #88
          error = 0.0025
    Iteration #89
          error = 0.0027
    Iteration #90
          error = 0.0026
    Iteration #91
          error = 0.0026
    Iteration #92
          error = 0.0036
    Iteration #93
          error = 0.0025
    Iteration #94
          error = 0.00062
    Iteration #95
          error = 0.0012
    Iteration #96
          error = 0.00013
    Iteration #97
          error = 0.00021
    Iteration #98
          error = 8.6e-05
    Iteration #99
          error = 5.4e-05
    Iteration #100
          error = 4.9e-05
    Iteration #101
          error = 3.9e-05
    Iteration #102
          error = 3.6e-05
    Iteration #103
          error = 6.7e-05
    Iteration #104
          error = 0.00035
    Iteration #105
          error = 1.5e-05
    Iteration #106
          error = 1.9e-05
    Iteration #107
          error = 1.1e-05
    Iteration #108
          error = 8.1e-06
    Iteration #109
          error = 7.5e-06
    Iteration #110
          error = 7e-06
    Iteration #111
          error = 7.7e-06
    Iteration #112
          error = 3.3e-06
    Iteration #113
          error = 0.00015
    Iteration #114
          error = 1.1e-05
    Iteration #115
          error = 2.6e-05
    Iteration #116
          error = 2.2e-06
    Iteration #117
          error = 1.8e-06
    Iteration #118
          error = 7.7e-07
    Iteration #119
          error = 8.2e-07
    Iteration #120
          error = 6.7e-07
    Iteration #121
          error = 1.8e-07
    Iteration #122
          error = 1.2e-07
    Iteration #123
          error = 1.4e-06
    Iteration #124
          error = 1.1e-07
    Iteration #125
          error = 1.6e-07
    Iteration #126
          error = 1.1e-08
    Iteration #127
          error = 3.9e-09
    Iteration #128
          error = 1.1e-09
    Iteration #129
          error = 1.3e-09
    Iteration #130
          error = 1.6e-09
    Iteration #131
          error = 2e-09
    Iteration #132
          error = 1.6e-09
    Iteration #133
          error = 1.8e-09
    Iteration #134
          error = 1.7e-09
    Iteration #135
          error = 1.5e-09
    Iteration #136
          error = 1.6e-09
    Iteration #137
          error = 1.9e-09
    Iteration #138
          error = 1.3e-09
    Iteration #139
          error = 9.3e-09
    Iteration #140
          error = 2.3e-09
    Iteration #141
          error = 3.5e-10
    Iteration #142
          error = 2.5e-10
    Iteration #143
          error = 4e-10
    Iteration #144
          error = 1.1e-10
    Iteration #145
          error = 6.7e-11
    Iteration #146
          error = 6.1e-11
    Iteration #147
          error = 6.7e-11
    Iteration #148
          error = 6.2e-11
    Iteration #149
          error = 6.5e-11
    Iteration #150
          error = 6.1e-11

```python
np.linalg.norm(solution - exact)
```

    0.002945284470468839

Gauss-Seidel

```python
solution, E_GS = GS(A, rhs, tol=h**2, verbose=True, write=True)
```

    Iteration #1
          error = 5.6e+03
    Iteration #2
          error = 2.9e+03
    Iteration #3
          error = 1.9e+03
    Iteration #4
          error = 1.6e+03
    Iteration #5
          error = 1.3e+03
    Iteration #6
          error = 1.1e+03
    Iteration #7
          error = 9.7e+02
    Iteration #8
          error = 8.4e+02
    Iteration #9
          error = 7.3e+02
    Iteration #10
          error = 6.6e+02
    Iteration #11
          error = 6.2e+02
    Iteration #12
          error = 5.7e+02
    Iteration #13
          error = 5.3e+02
    Iteration #14
          error = 4.9e+02
    Iteration #15
          error = 4.5e+02
    Iteration #16
          error = 4.2e+02
    Iteration #17
          error = 3.9e+02
    Iteration #18
          error = 3.7e+02
    Iteration #19
          error = 3.5e+02
    Iteration #20
          error = 3.3e+02
    Iteration #21
          error = 3.2e+02
    Iteration #22
          error = 3e+02
    Iteration #23
          error = 2.9e+02
    Iteration #24
          error = 2.7e+02
    Iteration #25
          error = 2.6e+02
    Iteration #26
          error = 2.5e+02
    Iteration #27
          error = 2.4e+02
    Iteration #28
          error = 2.3e+02
    Iteration #29
          error = 2.2e+02
    Iteration #30
          error = 2.1e+02
    Iteration #31
          error = 2.1e+02
    Iteration #32
          error = 2e+02
    Iteration #33
          error = 1.9e+02
    Iteration #34
          error = 1.9e+02
    Iteration #35
          error = 1.8e+02
    Iteration #36
          error = 1.7e+02
    Iteration #37
          error = 1.7e+02
    Iteration #38
          error = 1.6e+02
    Iteration #39
          error = 1.6e+02
    Iteration #40
          error = 1.5e+02
    Iteration #41
          error = 1.5e+02
    Iteration #42
          error = 1.4e+02
    Iteration #43
          error = 1.4e+02
    Iteration #44
          error = 1.4e+02
    Iteration #45
          error = 1.3e+02
    Iteration #46
          error = 1.3e+02
    Iteration #47
          error = 1.3e+02
    Iteration #48
          error = 1.2e+02
    Iteration #49
          error = 1.2e+02
    Iteration #50
          error = 1.2e+02
    Iteration #51
          error = 1.2e+02
    Iteration #52
          error = 1.1e+02
    Iteration #53
          error = 1.1e+02
    Iteration #54
          error = 1.1e+02
    Iteration #55
          error = 1.1e+02
    Iteration #56
          error = 1.1e+02
    Iteration #57
          error = 1e+02
    Iteration #58
          error = 1e+02
    Iteration #59
          error = 1e+02
    Iteration #60
          error = 9.9e+01
    Iteration #61
          error = 9.8e+01
    Iteration #62
          error = 9.7e+01
    Iteration #63
          error = 9.5e+01
    Iteration #64
          error = 9.4e+01
    Iteration #65
          error = 9.3e+01
    Iteration #66
          error = 9.1e+01
    Iteration #67
          error = 9e+01
    Iteration #68
          error = 8.9e+01
    Iteration #69
          error = 8.8e+01
    Iteration #70
          error = 8.7e+01
    Iteration #71
          error = 8.6e+01
    Iteration #72
          error = 8.5e+01
    Iteration #73
          error = 8.4e+01
    Iteration #74
          error = 8.3e+01
    Iteration #75
          error = 8.2e+01
    Iteration #76
          error = 8.1e+01
    Iteration #77
          error = 8e+01
    Iteration #78
          error = 7.9e+01
    Iteration #79
          error = 7.8e+01
    Iteration #80
          error = 7.8e+01
    Iteration #81
          error = 7.7e+01
    Iteration #82
          error = 7.6e+01
    Iteration #83
          error = 7.5e+01
    Iteration #84
          error = 7.4e+01
    Iteration #85
          error = 7.3e+01
    Iteration #86
          error = 7.2e+01
    Iteration #87
          error = 7.2e+01
    Iteration #88
          error = 7.1e+01
    Iteration #89
          error = 7e+01
    Iteration #90
          error = 6.9e+01
    Iteration #91
          error = 6.8e+01
    Iteration #92
          error = 6.7e+01
    Iteration #93
          error = 6.6e+01
    Iteration #94
          error = 6.6e+01
    Iteration #95
          error = 6.5e+01
    Iteration #96
          error = 6.4e+01
    Iteration #97
          error = 6.4e+01
    Iteration #98
          error = 6.3e+01
    Iteration #99
          error = 6.2e+01
    Iteration #100
          error = 6.2e+01
    Iteration #101
          error = 6.1e+01
    Iteration #102
          error = 6e+01
    Iteration #103
          error = 5.9e+01
    Iteration #104
          error = 5.9e+01
    Iteration #105
          error = 5.8e+01
    Iteration #106
          error = 5.7e+01
    Iteration #107
          error = 5.7e+01
    Iteration #108
          error = 5.6e+01
    Iteration #109
          error = 5.5e+01
    Iteration #110
          error = 5.5e+01
    Iteration #111
          error = 5.4e+01
    Iteration #112
          error = 5.3e+01
    Iteration #113
          error = 5.3e+01
    Iteration #114
          error = 5.2e+01
    Iteration #115
          error = 5.2e+01
    Iteration #116
          error = 5.1e+01
    Iteration #117
          error = 5.1e+01
    Iteration #118
          error = 5e+01
    Iteration #119
          error = 5e+01
    Iteration #120
          error = 4.9e+01
    Iteration #121
          error = 4.8e+01
    Iteration #122
          error = 4.8e+01
    Iteration #123
          error = 4.7e+01
    Iteration #124
          error = 4.7e+01
    Iteration #125
          error = 4.6e+01
    Iteration #126
          error = 4.6e+01
    Iteration #127
          error = 4.5e+01
    Iteration #128
          error = 4.5e+01
    Iteration #129
          error = 4.4e+01
    Iteration #130
          error = 4.4e+01
    Iteration #131
          error = 4.3e+01
    Iteration #132
          error = 4.3e+01
    Iteration #133
          error = 4.2e+01
    Iteration #134
          error = 4.2e+01
    Iteration #135
          error = 4.1e+01
    Iteration #136
          error = 4.1e+01
    Iteration #137
          error = 4.1e+01
    Iteration #138
          error = 4e+01
    Iteration #139
          error = 4e+01
    Iteration #140
          error = 3.9e+01
    Iteration #141
          error = 3.9e+01
    Iteration #142
          error = 3.8e+01
    Iteration #143
          error = 3.8e+01
    Iteration #144
          error = 3.8e+01
    Iteration #145
          error = 3.7e+01
    Iteration #146
          error = 3.7e+01
    Iteration #147
          error = 3.6e+01
    Iteration #148
          error = 3.6e+01
    Iteration #149
          error = 3.6e+01
    Iteration #150
          error = 3.5e+01
    Iteration #151
          error = 3.5e+01
    Iteration #152
          error = 3.5e+01
    Iteration #153
          error = 3.4e+01
    Iteration #154
          error = 3.4e+01
    Iteration #155
          error = 3.3e+01
    Iteration #156
          error = 3.3e+01
    Iteration #157
          error = 3.3e+01
    Iteration #158
          error = 3.2e+01
    Iteration #159
          error = 3.2e+01
    Iteration #160
          error = 3.2e+01
    Iteration #161
          error = 3.1e+01
    Iteration #162
          error = 3.1e+01
    Iteration #163
          error = 3.1e+01
    Iteration #164
          error = 3e+01
    Iteration #165
          error = 3e+01
    Iteration #166
          error = 3e+01
    Iteration #167
          error = 3e+01
    Iteration #168
          error = 2.9e+01
    Iteration #169
          error = 2.9e+01
    Iteration #170
          error = 2.9e+01
    Iteration #171
          error = 2.8e+01
    Iteration #172
          error = 2.8e+01
    Iteration #173
          error = 2.8e+01
    Iteration #174
          error = 2.7e+01
    Iteration #175
          error = 2.7e+01
    Iteration #176
          error = 2.7e+01
    Iteration #177
          error = 2.7e+01
    Iteration #178
          error = 2.6e+01
    Iteration #179
          error = 2.6e+01
    Iteration #180
          error = 2.6e+01
    Iteration #181
          error = 2.6e+01
    Iteration #182
          error = 2.5e+01
    Iteration #183
          error = 2.5e+01
    Iteration #184
          error = 2.5e+01
    Iteration #185
          error = 2.5e+01
    Iteration #186
          error = 2.4e+01
    Iteration #187
          error = 2.4e+01
    Iteration #188
          error = 2.4e+01
    Iteration #189
          error = 2.4e+01
    Iteration #190
          error = 2.3e+01
    Iteration #191
          error = 2.3e+01
    Iteration #192
          error = 2.3e+01
    Iteration #193
          error = 2.3e+01
    Iteration #194
          error = 2.2e+01
    Iteration #195
          error = 2.2e+01
    Iteration #196
          error = 2.2e+01
    Iteration #197
          error = 2.2e+01
    Iteration #198
          error = 2.2e+01
    Iteration #199
          error = 2.1e+01
    Iteration #200
          error = 2.1e+01
    Iteration #201
          error = 2.1e+01
    Iteration #202
          error = 2.1e+01
    Iteration #203
          error = 2e+01
    Iteration #204
          error = 2e+01
    Iteration #205
          error = 2e+01
    Iteration #206
          error = 2e+01
    Iteration #207
          error = 2e+01
    Iteration #208
          error = 1.9e+01
    Iteration #209
          error = 1.9e+01
    Iteration #210
          error = 1.9e+01
    Iteration #211
          error = 1.9e+01
    Iteration #212
          error = 1.9e+01
    Iteration #213
          error = 1.9e+01
    Iteration #214
          error = 1.8e+01
    Iteration #215
          error = 1.8e+01
    Iteration #216
          error = 1.8e+01
    Iteration #217
          error = 1.8e+01
    Iteration #218
          error = 1.8e+01
    Iteration #219
          error = 1.7e+01
    Iteration #220
          error = 1.7e+01
    Iteration #221
          error = 1.7e+01
    Iteration #222
          error = 1.7e+01
    Iteration #223
          error = 1.7e+01
    Iteration #224
          error = 1.7e+01
    Iteration #225
          error = 1.6e+01
    Iteration #226
          error = 1.6e+01
    Iteration #227
          error = 1.6e+01
    Iteration #228
          error = 1.6e+01
    Iteration #229
          error = 1.6e+01
    Iteration #230
          error = 1.6e+01
    Iteration #231
          error = 1.6e+01
    Iteration #232
          error = 1.5e+01
    Iteration #233
          error = 1.5e+01
    Iteration #234
          error = 1.5e+01
    Iteration #235
          error = 1.5e+01
    Iteration #236
          error = 1.5e+01
    Iteration #237
          error = 1.5e+01
    Iteration #238
          error = 1.5e+01
    Iteration #239
          error = 1.4e+01
    Iteration #240
          error = 1.4e+01
    Iteration #241
          error = 1.4e+01
    Iteration #242
          error = 1.4e+01
    Iteration #243
          error = 1.4e+01
    Iteration #244
          error = 1.4e+01
    Iteration #245
          error = 1.4e+01
    Iteration #246
          error = 1.3e+01
    Iteration #247
          error = 1.3e+01
    Iteration #248
          error = 1.3e+01
    Iteration #249
          error = 1.3e+01
    Iteration #250
          error = 1.3e+01
    Iteration #251
          error = 1.3e+01
    Iteration #252
          error = 1.3e+01
    Iteration #253
          error = 1.3e+01
    Iteration #254
          error = 1.2e+01
    Iteration #255
          error = 1.2e+01
    Iteration #256
          error = 1.2e+01
    Iteration #257
          error = 1.2e+01
    Iteration #258
          error = 1.2e+01
    Iteration #259
          error = 1.2e+01
    Iteration #260
          error = 1.2e+01
    Iteration #261
          error = 1.2e+01
    Iteration #262
          error = 1.2e+01
    Iteration #263
          error = 1.1e+01
    Iteration #264
          error = 1.1e+01
    Iteration #265
          error = 1.1e+01
    Iteration #266
          error = 1.1e+01
    Iteration #267
          error = 1.1e+01
    Iteration #268
          error = 1.1e+01
    Iteration #269
          error = 1.1e+01
    Iteration #270
          error = 1.1e+01
    Iteration #271
          error = 1.1e+01
    Iteration #272
          error = 1e+01
    Iteration #273
          error = 1e+01
    Iteration #274
          error = 1e+01
    Iteration #275
          error = 1e+01
    Iteration #276
          error = 1e+01
    Iteration #277
          error = 9.9
    Iteration #278
          error = 9.8
    Iteration #279
          error = 9.8
    Iteration #280
          error = 9.7
    Iteration #281
          error = 9.6
    Iteration #282
          error = 9.5
    Iteration #283
          error = 9.4
    Iteration #284
          error = 9.3
    Iteration #285
          error = 9.2
    Iteration #286
          error = 9.1
    Iteration #287
          error = 9.0
    Iteration #288
          error = 8.9
    Iteration #289
          error = 8.9
    Iteration #290
          error = 8.8
    Iteration #291
          error = 8.7
    Iteration #292
          error = 8.6
    Iteration #293
          error = 8.5
    Iteration #294
          error = 8.4
    Iteration #295
          error = 8.4
    Iteration #296
          error = 8.3
    Iteration #297
          error = 8.2
    Iteration #298
          error = 8.1
    Iteration #299
          error = 8.1
    Iteration #300
          error = 8.0
    Iteration #301
          error = 7.9
    Iteration #302
          error = 7.8
    Iteration #303
          error = 7.8
    Iteration #304
          error = 7.7
    Iteration #305
          error = 7.6
    Iteration #306
          error = 7.5
    Iteration #307
          error = 7.5
    Iteration #308
          error = 7.4
    Iteration #309
          error = 7.3
    Iteration #310
          error = 7.3
    Iteration #311
          error = 7.2
    Iteration #312
          error = 7.1
    Iteration #313
          error = 7.0
    Iteration #314
          error = 7.0
    Iteration #315
          error = 6.9
    Iteration #316
          error = 6.8
    Iteration #317
          error = 6.8
    Iteration #318
          error = 6.7
    Iteration #319
          error = 6.7
    Iteration #320
          error = 6.6
    Iteration #321
          error = 6.5
    Iteration #322
          error = 6.5
    Iteration #323
          error = 6.4
    Iteration #324
          error = 6.3
    Iteration #325
          error = 6.3
    Iteration #326
          error = 6.2
    Iteration #327
          error = 6.2
    Iteration #328
          error = 6.1
    Iteration #329
          error = 6.0
    Iteration #330
          error = 6.0
    Iteration #331
          error = 5.9
    Iteration #332
          error = 5.9
    Iteration #333
          error = 5.8
    Iteration #334
          error = 5.8
    Iteration #335
          error = 5.7
    Iteration #336
          error = 5.7
    Iteration #337
          error = 5.6
    Iteration #338
          error = 5.5
    Iteration #339
          error = 5.5
    Iteration #340
          error = 5.4
    Iteration #341
          error = 5.4
    Iteration #342
          error = 5.3
    Iteration #343
          error = 5.3
    Iteration #344
          error = 5.2
    Iteration #345
          error = 5.2
    Iteration #346
          error = 5.1
    Iteration #347
          error = 5.1
    Iteration #348
          error = 5.0
    Iteration #349
          error = 5.0
    Iteration #350
          error = 5.0
    Iteration #351
          error = 4.9
    Iteration #352
          error = 4.9
    Iteration #353
          error = 4.8
    Iteration #354
          error = 4.8
    Iteration #355
          error = 4.7
    Iteration #356
          error = 4.7
    Iteration #357
          error = 4.6
    Iteration #358
          error = 4.6
    Iteration #359
          error = 4.5
    Iteration #360
          error = 4.5
    Iteration #361
          error = 4.5
    Iteration #362
          error = 4.4
    Iteration #363
          error = 4.4
    Iteration #364
          error = 4.3
    Iteration #365
          error = 4.3
    Iteration #366
          error = 4.3
    Iteration #367
          error = 4.2
    Iteration #368
          error = 4.2
    Iteration #369
          error = 4.1
    Iteration #370
          error = 4.1
    Iteration #371
          error = 4.1
    Iteration #372
          error = 4.0
    Iteration #373
          error = 4.0
    Iteration #374
          error = 3.9
    Iteration #375
          error = 3.9
    Iteration #376
          error = 3.9
    Iteration #377
          error = 3.8
    Iteration #378
          error = 3.8
    Iteration #379
          error = 3.8
    Iteration #380
          error = 3.7
    Iteration #381
          error = 3.7
    Iteration #382
          error = 3.7
    Iteration #383
          error = 3.6
    Iteration #384
          error = 3.6
    Iteration #385
          error = 3.6
    Iteration #386
          error = 3.5
    Iteration #387
          error = 3.5
    Iteration #388
          error = 3.5
    Iteration #389
          error = 3.4
    Iteration #390
          error = 3.4
    Iteration #391
          error = 3.4
    Iteration #392
          error = 3.3
    Iteration #393
          error = 3.3
    Iteration #394
          error = 3.3
    Iteration #395
          error = 3.2
    Iteration #396
          error = 3.2
    Iteration #397
          error = 3.2
    Iteration #398
          error = 3.1
    Iteration #399
          error = 3.1
    Iteration #400
          error = 3.1
    Iteration #401
          error = 3.0
    Iteration #402
          error = 3.0
    Iteration #403
          error = 3.0
    Iteration #404
          error = 3.0
    Iteration #405
          error = 2.9
    Iteration #406
          error = 2.9
    Iteration #407
          error = 2.9
    Iteration #408
          error = 2.9
    Iteration #409
          error = 2.8
    Iteration #410
          error = 2.8
    Iteration #411
          error = 2.8
    Iteration #412
          error = 2.7
    Iteration #413
          error = 2.7
    Iteration #414
          error = 2.7
    Iteration #415
          error = 2.7
    Iteration #416
          error = 2.6
    Iteration #417
          error = 2.6
    Iteration #418
          error = 2.6
    Iteration #419
          error = 2.6
    Iteration #420
          error = 2.5
    Iteration #421
          error = 2.5
    Iteration #422
          error = 2.5
    Iteration #423
          error = 2.5
    Iteration #424
          error = 2.4
    Iteration #425
          error = 2.4
    Iteration #426
          error = 2.4
    Iteration #427
          error = 2.4
    Iteration #428
          error = 2.4
    Iteration #429
          error = 2.3
    Iteration #430
          error = 2.3
    Iteration #431
          error = 2.3
    Iteration #432
          error = 2.3
    Iteration #433
          error = 2.2
    Iteration #434
          error = 2.2
    Iteration #435
          error = 2.2
    Iteration #436
          error = 2.2
    Iteration #437
          error = 2.2
    Iteration #438
          error = 2.1
    Iteration #439
          error = 2.1
    Iteration #440
          error = 2.1
    Iteration #441
          error = 2.1
    Iteration #442
          error = 2.1
    Iteration #443
          error = 2.0
    Iteration #444
          error = 2.0
    Iteration #445
          error = 2.0
    Iteration #446
          error = 2.0
    Iteration #447
          error = 2.0
    Iteration #448
          error = 1.9
    Iteration #449
          error = 1.9
    Iteration #450
          error = 1.9
    Iteration #451
          error = 1.9
    Iteration #452
          error = 1.9
    Iteration #453
          error = 1.9
    Iteration #454
          error = 1.8
    Iteration #455
          error = 1.8
    Iteration #456
          error = 1.8
    Iteration #457
          error = 1.8
    Iteration #458
          error = 1.8
    Iteration #459
          error = 1.8
    Iteration #460
          error = 1.7
    Iteration #461
          error = 1.7
    Iteration #462
          error = 1.7
    Iteration #463
          error = 1.7
    Iteration #464
          error = 1.7
    Iteration #465
          error = 1.7
    Iteration #466
          error = 1.6
    Iteration #467
          error = 1.6
    Iteration #468
          error = 1.6
    Iteration #469
          error = 1.6
    Iteration #470
          error = 1.6
    Iteration #471
          error = 1.6
    Iteration #472
          error = 1.6
    Iteration #473
          error = 1.5
    Iteration #474
          error = 1.5
    Iteration #475
          error = 1.5
    Iteration #476
          error = 1.5
    Iteration #477
          error = 1.5
    Iteration #478
          error = 1.5
    Iteration #479
          error = 1.5
    Iteration #480
          error = 1.4
    Iteration #481
          error = 1.4
    Iteration #482
          error = 1.4
    Iteration #483
          error = 1.4
    Iteration #484
          error = 1.4
    Iteration #485
          error = 1.4
    Iteration #486
          error = 1.4
    Iteration #487
          error = 1.3
    Iteration #488
          error = 1.3
    Iteration #489
          error = 1.3
    Iteration #490
          error = 1.3
    Iteration #491
          error = 1.3
    Iteration #492
          error = 1.3
    Iteration #493
          error = 1.3
    Iteration #494
          error = 1.3
    Iteration #495
          error = 1.2
    Iteration #496
          error = 1.2
    Iteration #497
          error = 1.2
    Iteration #498
          error = 1.2
    Iteration #499
          error = 1.2
    Iteration #500
          error = 1.2
    Iteration #501
          error = 1.2
    Iteration #502
          error = 1.2
    Iteration #503
          error = 1.2
    Iteration #504
          error = 1.1
    Iteration #505
          error = 1.1
    Iteration #506
          error = 1.1
    Iteration #507
          error = 1.1
    Iteration #508
          error = 1.1
    Iteration #509
          error = 1.1
    Iteration #510
          error = 1.1
    Iteration #511
          error = 1.1
    Iteration #512
          error = 1.1
    Iteration #513
          error = 1.0
    Iteration #514
          error = 1.0
    Iteration #515
          error = 1.0
    Iteration #516
          error = 1.0
    Iteration #517
          error = 1.0
    Iteration #518
          error = 1.0
    Iteration #519
          error = 0.99
    Iteration #520
          error = 0.98
    Iteration #521
          error = 0.97
    Iteration #522
          error = 0.96
    Iteration #523
          error = 0.95
    Iteration #524
          error = 0.95
    Iteration #525
          error = 0.94
    Iteration #526
          error = 0.93
    Iteration #527
          error = 0.92
    Iteration #528
          error = 0.91
    Iteration #529
          error = 0.9
    Iteration #530
          error = 0.89
    Iteration #531
          error = 0.88
    Iteration #532
          error = 0.88
    Iteration #533
          error = 0.87
    Iteration #534
          error = 0.86
    Iteration #535
          error = 0.85
    Iteration #536
          error = 0.84
    Iteration #537
          error = 0.83
    Iteration #538
          error = 0.83
    Iteration #539
          error = 0.82
    Iteration #540
          error = 0.81
    Iteration #541
          error = 0.8
    Iteration #542
          error = 0.8
    Iteration #543
          error = 0.79
    Iteration #544
          error = 0.78
    Iteration #545
          error = 0.77
    Iteration #546
          error = 0.77
    Iteration #547
          error = 0.76
    Iteration #548
          error = 0.75
    Iteration #549
          error = 0.74
    Iteration #550
          error = 0.74
    Iteration #551
          error = 0.73
    Iteration #552
          error = 0.72
    Iteration #553
          error = 0.72
    Iteration #554
          error = 0.71
    Iteration #555
          error = 0.7
    Iteration #556
          error = 0.7
    Iteration #557
          error = 0.69
    Iteration #558
          error = 0.68
    Iteration #559
          error = 0.68
    Iteration #560
          error = 0.67
    Iteration #561
          error = 0.66
    Iteration #562
          error = 0.66
    Iteration #563
          error = 0.65
    Iteration #564
          error = 0.64
    Iteration #565
          error = 0.64
    Iteration #566
          error = 0.63
    Iteration #567
          error = 0.63
    Iteration #568
          error = 0.62
    Iteration #569
          error = 0.61
    Iteration #570
          error = 0.61
    Iteration #571
          error = 0.6
    Iteration #572
          error = 0.6
    Iteration #573
          error = 0.59
    Iteration #574
          error = 0.59
    Iteration #575
          error = 0.58
    Iteration #576
          error = 0.57
    Iteration #577
          error = 0.57
    Iteration #578
          error = 0.56
    Iteration #579
          error = 0.56
    Iteration #580
          error = 0.55
    Iteration #581
          error = 0.55
    Iteration #582
          error = 0.54
    Iteration #583
          error = 0.54
    Iteration #584
          error = 0.53
    Iteration #585
          error = 0.53
    Iteration #586
          error = 0.52
    Iteration #587
          error = 0.52
    Iteration #588
          error = 0.51
    Iteration #589
          error = 0.51
    Iteration #590
          error = 0.5
    Iteration #591
          error = 0.5
    Iteration #592
          error = 0.49
    Iteration #593
          error = 0.49
    Iteration #594
          error = 0.48
    Iteration #595
          error = 0.48
    Iteration #596
          error = 0.47
    Iteration #597
          error = 0.47
    Iteration #598
          error = 0.47
    Iteration #599
          error = 0.46
    Iteration #600
          error = 0.46
    Iteration #601
          error = 0.45
    Iteration #602
          error = 0.45
    Iteration #603
          error = 0.44
    Iteration #604
          error = 0.44
    Iteration #605
          error = 0.44
    Iteration #606
          error = 0.43
    Iteration #607
          error = 0.43
    Iteration #608
          error = 0.42
    Iteration #609
          error = 0.42
    Iteration #610
          error = 0.41
    Iteration #611
          error = 0.41
    Iteration #612
          error = 0.41
    Iteration #613
          error = 0.4
    Iteration #614
          error = 0.4
    Iteration #615
          error = 0.4
    Iteration #616
          error = 0.39
    Iteration #617
          error = 0.39
    Iteration #618
          error = 0.38
    Iteration #619
          error = 0.38
    Iteration #620
          error = 0.38
    Iteration #621
          error = 0.37
    Iteration #622
          error = 0.37
    Iteration #623
          error = 0.37
    Iteration #624
          error = 0.36
    Iteration #625
          error = 0.36
    Iteration #626
          error = 0.36
    Iteration #627
          error = 0.35
    Iteration #628
          error = 0.35
    Iteration #629
          error = 0.35
    Iteration #630
          error = 0.34
    Iteration #631
          error = 0.34
    Iteration #632
          error = 0.34
    Iteration #633
          error = 0.33
    Iteration #634
          error = 0.33
    Iteration #635
          error = 0.33
    Iteration #636
          error = 0.32
    Iteration #637
          error = 0.32
    Iteration #638
          error = 0.32
    Iteration #639
          error = 0.31
    Iteration #640
          error = 0.31
    Iteration #641
          error = 0.31
    Iteration #642
          error = 0.3
    Iteration #643
          error = 0.3
    Iteration #644
          error = 0.3
    Iteration #645
          error = 0.3
    Iteration #646
          error = 0.29
    Iteration #647
          error = 0.29
    Iteration #648
          error = 0.29
    Iteration #649
          error = 0.29
    Iteration #650
          error = 0.28
    Iteration #651
          error = 0.28
    Iteration #652
          error = 0.28
    Iteration #653
          error = 0.27
    Iteration #654
          error = 0.27
    Iteration #655
          error = 0.27
    Iteration #656
          error = 0.27
    Iteration #657
          error = 0.26
    Iteration #658
          error = 0.26
    Iteration #659
          error = 0.26
    Iteration #660
          error = 0.26
    Iteration #661
          error = 0.25
    Iteration #662
          error = 0.25
    Iteration #663
          error = 0.25
    Iteration #664
          error = 0.25
    Iteration #665
          error = 0.24
    Iteration #666
          error = 0.24
    Iteration #667
          error = 0.24
    Iteration #668
          error = 0.24
    Iteration #669
          error = 0.24
    Iteration #670
          error = 0.23
    Iteration #671
          error = 0.23
    Iteration #672
          error = 0.23
    Iteration #673
          error = 0.23
    Iteration #674
          error = 0.22
    Iteration #675
          error = 0.22
    Iteration #676
          error = 0.22
    Iteration #677
          error = 0.22
    Iteration #678
          error = 0.22
    Iteration #679
          error = 0.21
    Iteration #680
          error = 0.21
    Iteration #681
          error = 0.21
    Iteration #682
          error = 0.21
    Iteration #683
          error = 0.21
    Iteration #684
          error = 0.2
    Iteration #685
          error = 0.2
    Iteration #686
          error = 0.2
    Iteration #687
          error = 0.2
    Iteration #688
          error = 0.2
    Iteration #689
          error = 0.19
    Iteration #690
          error = 0.19
    Iteration #691
          error = 0.19
    Iteration #692
          error = 0.19
    Iteration #693
          error = 0.19
    Iteration #694
          error = 0.19
    Iteration #695
          error = 0.18
    Iteration #696
          error = 0.18
    Iteration #697
          error = 0.18
    Iteration #698
          error = 0.18
    Iteration #699
          error = 0.18
    Iteration #700
          error = 0.17
    Iteration #701
          error = 0.17
    Iteration #702
          error = 0.17
    Iteration #703
          error = 0.17
    Iteration #704
          error = 0.17
    Iteration #705
          error = 0.17
    Iteration #706
          error = 0.16
    Iteration #707
          error = 0.16
    Iteration #708
          error = 0.16
    Iteration #709
          error = 0.16
    Iteration #710
          error = 0.16
    Iteration #711
          error = 0.16
    Iteration #712
          error = 0.16
    Iteration #713
          error = 0.15
    Iteration #714
          error = 0.15
    Iteration #715
          error = 0.15
    Iteration #716
          error = 0.15
    Iteration #717
          error = 0.15
    Iteration #718
          error = 0.15
    Iteration #719
          error = 0.15
    Iteration #720
          error = 0.14
    Iteration #721
          error = 0.14
    Iteration #722
          error = 0.14
    Iteration #723
          error = 0.14
    Iteration #724
          error = 0.14
    Iteration #725
          error = 0.14
    Iteration #726
          error = 0.14
    Iteration #727
          error = 0.13
    Iteration #728
          error = 0.13
    Iteration #729
          error = 0.13
    Iteration #730
          error = 0.13
    Iteration #731
          error = 0.13
    Iteration #732
          error = 0.13
    Iteration #733
          error = 0.13
    Iteration #734
          error = 0.13
    Iteration #735
          error = 0.12
    Iteration #736
          error = 0.12
    Iteration #737
          error = 0.12
    Iteration #738
          error = 0.12
    Iteration #739
          error = 0.12
    Iteration #740
          error = 0.12
    Iteration #741
          error = 0.12
    Iteration #742
          error = 0.12
    Iteration #743
          error = 0.12
    Iteration #744
          error = 0.11
    Iteration #745
          error = 0.11
    Iteration #746
          error = 0.11
    Iteration #747
          error = 0.11
    Iteration #748
          error = 0.11
    Iteration #749
          error = 0.11
    Iteration #750
          error = 0.11
    Iteration #751
          error = 0.11
    Iteration #752
          error = 0.11
    Iteration #753
          error = 0.1
    Iteration #754
          error = 0.1
    Iteration #755
          error = 0.1
    Iteration #756
          error = 0.1
    Iteration #757
          error = 0.1
    Iteration #758
          error = 0.1
    Iteration #759
          error = 0.099
    Iteration #760
          error = 0.098
    Iteration #761
          error = 0.097
    Iteration #762
          error = 0.096
    Iteration #763
          error = 0.095
    Iteration #764
          error = 0.094
    Iteration #765
          error = 0.093
    Iteration #766
          error = 0.093
    Iteration #767
          error = 0.092
    Iteration #768
          error = 0.091
    Iteration #769
          error = 0.09
    Iteration #770
          error = 0.089
    Iteration #771
          error = 0.088
    Iteration #772
          error = 0.087
    Iteration #773
          error = 0.087
    Iteration #774
          error = 0.086
    Iteration #775
          error = 0.085
    Iteration #776
          error = 0.084
    Iteration #777
          error = 0.083
    Iteration #778
          error = 0.082
    Iteration #779
          error = 0.082
    Iteration #780
          error = 0.081
    Iteration #781
          error = 0.08
    Iteration #782
          error = 0.079
    Iteration #783
          error = 0.079
    Iteration #784
          error = 0.078
    Iteration #785
          error = 0.077
    Iteration #786
          error = 0.076
    Iteration #787
          error = 0.076
    Iteration #788
          error = 0.075
    Iteration #789
          error = 0.074
    Iteration #790
          error = 0.073
    Iteration #791
          error = 0.073
    Iteration #792
          error = 0.072
    Iteration #793
          error = 0.071
    Iteration #794
          error = 0.071
    Iteration #795
          error = 0.07
    Iteration #796
          error = 0.069
    Iteration #797
          error = 0.069
    Iteration #798
          error = 0.068
    Iteration #799
          error = 0.067
    Iteration #800
          error = 0.067
    Iteration #801
          error = 0.066
    Iteration #802
          error = 0.065
    Iteration #803
          error = 0.065
    Iteration #804
          error = 0.064
    Iteration #805
          error = 0.064
    Iteration #806
          error = 0.063
    Iteration #807
          error = 0.062
    Iteration #808
          error = 0.062
    Iteration #809
          error = 0.061
    Iteration #810
          error = 0.061
    Iteration #811
          error = 0.06
    Iteration #812
          error = 0.059
    Iteration #813
          error = 0.059
    Iteration #814
          error = 0.058
    Iteration #815
          error = 0.058
    Iteration #816
          error = 0.057
    Iteration #817
          error = 0.057
    Iteration #818
          error = 0.056
    Iteration #819
          error = 0.056
    Iteration #820
          error = 0.055
    Iteration #821
          error = 0.055
    Iteration #822
          error = 0.054
    Iteration #823
          error = 0.053
    Iteration #824
          error = 0.053
    Iteration #825
          error = 0.052
    Iteration #826
          error = 0.052
    Iteration #827
          error = 0.051
    Iteration #828
          error = 0.051
    Iteration #829
          error = 0.05
    Iteration #830
          error = 0.05
    Iteration #831
          error = 0.05
    Iteration #832
          error = 0.049
    Iteration #833
          error = 0.049
    Iteration #834
          error = 0.048
    Iteration #835
          error = 0.048
    Iteration #836
          error = 0.047
    Iteration #837
          error = 0.047
    Iteration #838
          error = 0.046
    Iteration #839
          error = 0.046
    Iteration #840
          error = 0.045
    Iteration #841
          error = 0.045
    Iteration #842
          error = 0.045
    Iteration #843
          error = 0.044
    Iteration #844
          error = 0.044
    Iteration #845
          error = 0.043
    Iteration #846
          error = 0.043
    Iteration #847
          error = 0.042
    Iteration #848
          error = 0.042
    Iteration #849
          error = 0.042
    Iteration #850
          error = 0.041
    Iteration #851
          error = 0.041
    Iteration #852
          error = 0.04
    Iteration #853
          error = 0.04
    Iteration #854
          error = 0.04
    Iteration #855
          error = 0.039
    Iteration #856
          error = 0.039
    Iteration #857
          error = 0.039
    Iteration #858
          error = 0.038
    Iteration #859
          error = 0.038
    Iteration #860
          error = 0.037
    Iteration #861
          error = 0.037
    Iteration #862
          error = 0.037
    Iteration #863
          error = 0.036
    Iteration #864
          error = 0.036
    Iteration #865
          error = 0.036
    Iteration #866
          error = 0.035
    Iteration #867
          error = 0.035
    Iteration #868
          error = 0.035
    Iteration #869
          error = 0.034
    Iteration #870
          error = 0.034
    Iteration #871
          error = 0.034
    Iteration #872
          error = 0.033
    Iteration #873
          error = 0.033
    Iteration #874
          error = 0.033
    Iteration #875
          error = 0.032
    Iteration #876
          error = 0.032
    Iteration #877
          error = 0.032
    Iteration #878
          error = 0.031
    Iteration #879
          error = 0.031
    Iteration #880
          error = 0.031
    Iteration #881
          error = 0.031
    Iteration #882
          error = 0.03
    Iteration #883
          error = 0.03
    Iteration #884
          error = 0.03
    Iteration #885
          error = 0.029
    Iteration #886
          error = 0.029
    Iteration #887
          error = 0.029
    Iteration #888
          error = 0.029
    Iteration #889
          error = 0.028
    Iteration #890
          error = 0.028
    Iteration #891
          error = 0.028
    Iteration #892
          error = 0.028
    Iteration #893
          error = 0.027
    Iteration #894
          error = 0.027
    Iteration #895
          error = 0.027
    Iteration #896
          error = 0.026
    Iteration #897
          error = 0.026
    Iteration #898
          error = 0.026
    Iteration #899
          error = 0.026
    Iteration #900
          error = 0.025
    Iteration #901
          error = 0.025
    Iteration #902
          error = 0.025
    Iteration #903
          error = 0.025
    Iteration #904
          error = 0.025
    Iteration #905
          error = 0.024
    Iteration #906
          error = 0.024
    Iteration #907
          error = 0.024
    Iteration #908
          error = 0.024
    Iteration #909
          error = 0.023
    Iteration #910
          error = 0.023
    Iteration #911
          error = 0.023
    Iteration #912
          error = 0.023
    Iteration #913
          error = 0.022
    Iteration #914
          error = 0.022
    Iteration #915
          error = 0.022
    Iteration #916
          error = 0.022
    Iteration #917
          error = 0.022
    Iteration #918
          error = 0.021
    Iteration #919
          error = 0.021
    Iteration #920
          error = 0.021
    Iteration #921
          error = 0.021
    Iteration #922
          error = 0.021
    Iteration #923
          error = 0.02
    Iteration #924
          error = 0.02
    Iteration #925
          error = 0.02
    Iteration #926
          error = 0.02
    Iteration #927
          error = 0.02
    Iteration #928
          error = 0.019
    Iteration #929
          error = 0.019
    Iteration #930
          error = 0.019
    Iteration #931
          error = 0.019
    Iteration #932
          error = 0.019
    Iteration #933
          error = 0.019
    Iteration #934
          error = 0.018
    Iteration #935
          error = 0.018
    Iteration #936
          error = 0.018
    Iteration #937
          error = 0.018
    Iteration #938
          error = 0.018
    Iteration #939
          error = 0.017
    Iteration #940
          error = 0.017
    Iteration #941
          error = 0.017
    Iteration #942
          error = 0.017
    Iteration #943
          error = 0.017
    Iteration #944
          error = 0.017
    Iteration #945
          error = 0.017
    Iteration #946
          error = 0.016
    Iteration #947
          error = 0.016
    Iteration #948
          error = 0.016
    Iteration #949
          error = 0.016
    Iteration #950
          error = 0.016
    Iteration #951
          error = 0.016
    Iteration #952
          error = 0.015
    Iteration #953
          error = 0.015
    Iteration #954
          error = 0.015
    Iteration #955
          error = 0.015
    Iteration #956
          error = 0.015
    Iteration #957
          error = 0.015
    Iteration #958
          error = 0.015
    Iteration #959
          error = 0.014
    Iteration #960
          error = 0.014
    Iteration #961
          error = 0.014
    Iteration #962
          error = 0.014
    Iteration #963
          error = 0.014
    Iteration #964
          error = 0.014
    Iteration #965
          error = 0.014
    Iteration #966
          error = 0.013
    Iteration #967
          error = 0.013
    Iteration #968
          error = 0.013
    Iteration #969
          error = 0.013
    Iteration #970
          error = 0.013
    Iteration #971
          error = 0.013
    Iteration #972
          error = 0.013
    Iteration #973
          error = 0.013
    Iteration #974
          error = 0.012
    Iteration #975
          error = 0.012
    Iteration #976
          error = 0.012
    Iteration #977
          error = 0.012
    Iteration #978
          error = 0.012
    Iteration #979
          error = 0.012
    Iteration #980
          error = 0.012
    Iteration #981
          error = 0.012
    Iteration #982
          error = 0.012
    Iteration #983
          error = 0.011
    Iteration #984
          error = 0.011
    Iteration #985
          error = 0.011
    Iteration #986
          error = 0.011
    Iteration #987
          error = 0.011
    Iteration #988
          error = 0.011
    Iteration #989
          error = 0.011
    Iteration #990
          error = 0.011
    Iteration #991
          error = 0.011
    Iteration #992
          error = 0.01
    Iteration #993
          error = 0.01
    Iteration #994
          error = 0.01
    Iteration #995
          error = 0.01
    Iteration #996
          error = 0.01
    Iteration #997
          error = 0.01
    Iteration #998
          error = 0.0099
    Iteration #999
          error = 0.0098
    Iteration #1000
          error = 0.0097
    Iteration #1001
          error = 0.0096
    Iteration #1002
          error = 0.0095
    Iteration #1003
          error = 0.0094
    Iteration #1004
          error = 0.0093
    Iteration #1005
          error = 0.0093
    Iteration #1006
          error = 0.0092
    Iteration #1007
          error = 0.0091
    Iteration #1008
          error = 0.009
    Iteration #1009
          error = 0.0089
    Iteration #1010
          error = 0.0088
    Iteration #1011
          error = 0.0087
    Iteration #1012
          error = 0.0087
    Iteration #1013
          error = 0.0086
    Iteration #1014
          error = 0.0085
    Iteration #1015
          error = 0.0084
    Iteration #1016
          error = 0.0083
    Iteration #1017
          error = 0.0082
    Iteration #1018
          error = 0.0082
    Iteration #1019
          error = 0.0081
    Iteration #1020
          error = 0.008
    Iteration #1021
          error = 0.0079
    Iteration #1022
          error = 0.0079
    Iteration #1023
          error = 0.0078
    Iteration #1024
          error = 0.0077
    Iteration #1025
          error = 0.0076
    Iteration #1026
          error = 0.0076
    Iteration #1027
          error = 0.0075
    Iteration #1028
          error = 0.0074
    Iteration #1029
          error = 0.0073
    Iteration #1030
          error = 0.0073
    Iteration #1031
          error = 0.0072
    Iteration #1032
          error = 0.0071
    Iteration #1033
          error = 0.0071
    Iteration #1034
          error = 0.007
    Iteration #1035
          error = 0.0069
    Iteration #1036
          error = 0.0069
    Iteration #1037
          error = 0.0068
    Iteration #1038
          error = 0.0067
    Iteration #1039
          error = 0.0067
    Iteration #1040
          error = 0.0066
    Iteration #1041
          error = 0.0065
    Iteration #1042
          error = 0.0065
    Iteration #1043
          error = 0.0064
    Iteration #1044
          error = 0.0064
    Iteration #1045
          error = 0.0063
    Iteration #1046
          error = 0.0062
    Iteration #1047
          error = 0.0062
    Iteration #1048
          error = 0.0061
    Iteration #1049
          error = 0.0061
    Iteration #1050
          error = 0.006
    Iteration #1051
          error = 0.0059
    Iteration #1052
          error = 0.0059
    Iteration #1053
          error = 0.0058
    Iteration #1054
          error = 0.0058
    Iteration #1055
          error = 0.0057
    Iteration #1056
          error = 0.0057
    Iteration #1057
          error = 0.0056
    Iteration #1058
          error = 0.0056
    Iteration #1059
          error = 0.0055
    Iteration #1060
          error = 0.0054
    Iteration #1061
          error = 0.0054
    Iteration #1062
          error = 0.0053
    Iteration #1063
          error = 0.0053
    Iteration #1064
          error = 0.0052
    Iteration #1065
          error = 0.0052
    Iteration #1066
          error = 0.0051
    Iteration #1067
          error = 0.0051
    Iteration #1068
          error = 0.005
    Iteration #1069
          error = 0.005
    Iteration #1070
          error = 0.0049
    Iteration #1071
          error = 0.0049
    Iteration #1072
          error = 0.0049
    Iteration #1073
          error = 0.0048
    Iteration #1074
          error = 0.0048
    Iteration #1075
          error = 0.0047
    Iteration #1076
          error = 0.0047
    Iteration #1077
          error = 0.0046
    Iteration #1078
          error = 0.0046
    Iteration #1079
          error = 0.0045
    Iteration #1080
          error = 0.0045
    Iteration #1081
          error = 0.0044
    Iteration #1082
          error = 0.0044
    Iteration #1083
          error = 0.0044
    Iteration #1084
          error = 0.0043
    Iteration #1085
          error = 0.0043
    Iteration #1086
          error = 0.0042
    Iteration #1087
          error = 0.0042
    Iteration #1088
          error = 0.0042
    Iteration #1089
          error = 0.0041
    Iteration #1090
          error = 0.0041
    Iteration #1091
          error = 0.004
    Iteration #1092
          error = 0.004
    Iteration #1093
          error = 0.004
    Iteration #1094
          error = 0.0039
    Iteration #1095
          error = 0.0039
    Iteration #1096
          error = 0.0038
    Iteration #1097
          error = 0.0038
    Iteration #1098
          error = 0.0038
    Iteration #1099
          error = 0.0037
    Iteration #1100
          error = 0.0037
    Iteration #1101
          error = 0.0037
    Iteration #1102
          error = 0.0036
    Iteration #1103
          error = 0.0036
    Iteration #1104
          error = 0.0036
    Iteration #1105
          error = 0.0035
    Iteration #1106
          error = 0.0035
    Iteration #1107
          error = 0.0035
    Iteration #1108
          error = 0.0034
    Iteration #1109
          error = 0.0034
    Iteration #1110
          error = 0.0034
    Iteration #1111
          error = 0.0033
    Iteration #1112
          error = 0.0033
    Iteration #1113
          error = 0.0033
    Iteration #1114
          error = 0.0032
    Iteration #1115
          error = 0.0032
    Iteration #1116
          error = 0.0032
    Iteration #1117
          error = 0.0031
    Iteration #1118
          error = 0.0031
    Iteration #1119
          error = 0.0031
    Iteration #1120
          error = 0.0031
    Iteration #1121
          error = 0.003
    Iteration #1122
          error = 0.003
    Iteration #1123
          error = 0.003
    Iteration #1124
          error = 0.0029
    Iteration #1125
          error = 0.0029
    Iteration #1126
          error = 0.0029
    Iteration #1127
          error = 0.0029
    Iteration #1128
          error = 0.0028
    Iteration #1129
          error = 0.0028
    Iteration #1130
          error = 0.0028
    Iteration #1131
          error = 0.0027
    Iteration #1132
          error = 0.0027
    Iteration #1133
          error = 0.0027
    Iteration #1134
          error = 0.0027
    Iteration #1135
          error = 0.0026
    Iteration #1136
          error = 0.0026
    Iteration #1137
          error = 0.0026
    Iteration #1138
          error = 0.0026
    Iteration #1139
          error = 0.0025
    Iteration #1140
          error = 0.0025
    Iteration #1141
          error = 0.0025
    Iteration #1142
          error = 0.0025
    Iteration #1143
          error = 0.0024
    Iteration #1144
          error = 0.0024
    Iteration #1145
          error = 0.0024
    Iteration #1146
          error = 0.0024
    Iteration #1147
          error = 0.0024
    Iteration #1148
          error = 0.0023
    Iteration #1149
          error = 0.0023
    Iteration #1150
          error = 0.0023
    Iteration #1151
          error = 0.0023
    Iteration #1152
          error = 0.0022
    Iteration #1153
          error = 0.0022
    Iteration #1154
          error = 0.0022
    Iteration #1155
          error = 0.0022
    Iteration #1156
          error = 0.0022
    Iteration #1157
          error = 0.0021
    Iteration #1158
          error = 0.0021
    Iteration #1159
          error = 0.0021
    Iteration #1160
          error = 0.0021
    Iteration #1161
          error = 0.0021
    Iteration #1162
          error = 0.002
    Iteration #1163
          error = 0.002
    Iteration #1164
          error = 0.002
    Iteration #1165
          error = 0.002
    Iteration #1166
          error = 0.002
    Iteration #1167
          error = 0.0019
    Iteration #1168
          error = 0.0019
    Iteration #1169
          error = 0.0019
    Iteration #1170
          error = 0.0019
    Iteration #1171
          error = 0.0019
    Iteration #1172
          error = 0.0018
    Iteration #1173
          error = 0.0018
    Iteration #1174
          error = 0.0018
    Iteration #1175
          error = 0.0018
    Iteration #1176
          error = 0.0018
    Iteration #1177
          error = 0.0018
    Iteration #1178
          error = 0.0017
    Iteration #1179
          error = 0.0017
    Iteration #1180
          error = 0.0017
    Iteration #1181
          error = 0.0017
    Iteration #1182
          error = 0.0017
    Iteration #1183
          error = 0.0017
    Iteration #1184
          error = 0.0016
    Iteration #1185
          error = 0.0016
    Iteration #1186
          error = 0.0016
    Iteration #1187
          error = 0.0016
    Iteration #1188
          error = 0.0016
    Iteration #1189
          error = 0.0016
    Iteration #1190
          error = 0.0016
    Iteration #1191
          error = 0.0015
    Iteration #1192
          error = 0.0015
    Iteration #1193
          error = 0.0015
    Iteration #1194
          error = 0.0015
    Iteration #1195
          error = 0.0015
    Iteration #1196
          error = 0.0015
    Iteration #1197
          error = 0.0015
    Iteration #1198
          error = 0.0014
    Iteration #1199
          error = 0.0014
    Iteration #1200
          error = 0.0014
    Iteration #1201
          error = 0.0014
    Iteration #1202
          error = 0.0014
    Iteration #1203
          error = 0.0014
    Iteration #1204
          error = 0.0014
    Iteration #1205
          error = 0.0013
    Iteration #1206
          error = 0.0013
    Iteration #1207
          error = 0.0013
    Iteration #1208
          error = 0.0013
    Iteration #1209
          error = 0.0013
    Iteration #1210
          error = 0.0013
    Iteration #1211
          error = 0.0013
    Iteration #1212
          error = 0.0013
    Iteration #1213
          error = 0.0012
    Iteration #1214
          error = 0.0012
    Iteration #1215
          error = 0.0012
    Iteration #1216
          error = 0.0012
    Iteration #1217
          error = 0.0012
    Iteration #1218
          error = 0.0012
    Iteration #1219
          error = 0.0012
    Iteration #1220
          error = 0.0012
    Iteration #1221
          error = 0.0012
    Iteration #1222
          error = 0.0011
    Iteration #1223
          error = 0.0011
    Iteration #1224
          error = 0.0011
    Iteration #1225
          error = 0.0011
    Iteration #1226
          error = 0.0011
    Iteration #1227
          error = 0.0011
    Iteration #1228
          error = 0.0011
    Iteration #1229
          error = 0.0011
    Iteration #1230
          error = 0.0011
    Iteration #1231
          error = 0.001
    Iteration #1232
          error = 0.001
    Iteration #1233
          error = 0.001
    Iteration #1234
          error = 0.001
    Iteration #1235
          error = 0.001
    Iteration #1236
          error = 0.001
    Iteration #1237
          error = 0.00099
    Iteration #1238
          error = 0.00098
    Iteration #1239
          error = 0.00097

```python
np.linalg.norm(solution - exact)
```

    0.00268087828815313

Belief propagation split solver (see the article for details)

```python
solution, E_split = split_BP_solver(A, rhs, tol=h**2, verbose=True, write=True)
```

    Iteration #1
          error = 1.8e+03
    Iteration #2
          error = 8.3e+02
    Iteration #3
          error = 4.6e+02
    Iteration #4
          error = 2.6e+02
    Iteration #5
          error = 1.5e+02
    Iteration #6
          error = 8.5e+01
    Iteration #7
          error = 4.9e+01
    Iteration #8
          error = 2.8e+01
    Iteration #9
          error = 1.6e+01
    Iteration #10
          error = 9.0
    Iteration #11
          error = 5.1
    Iteration #12
          error = 2.9
    Iteration #13
          error = 1.6
    Iteration #14
          error = 0.92
    Iteration #15
          error = 0.52
    Iteration #16
          error = 0.29
    Iteration #17
          error = 0.17
    Iteration #18
          error = 0.093
    Iteration #19
          error = 0.052
    Iteration #20
          error = 0.03
    Iteration #21
          error = 0.017
    Iteration #22
          error = 0.0094
    Iteration #23
          error = 0.0053
    Iteration #24
          error = 0.003
    Iteration #25
          error = 0.0017
    Iteration #26
          error = 0.00094

```python
np.linalg.norm(solution - exact)
```

    0.002932809634837446

```python
solution_1, E_BP = GaBP(A, rhs, tol=h**2, verbose=True, write=True)
```

    Iteration #1, error = 6.8e+03
    Iteration #2, error = 5.2e+03
    Iteration #3, error = 3.7e+03
    Iteration #4, error = 2.6e+03
    Iteration #5, error = 1.6e+03
    Iteration #6, error = 9.7e+02
    Iteration #7, error = 6.9e+02
    Iteration #8, error = 5.4e+02
    Iteration #9, error = 4.4e+02
    Iteration #10, error = 3.6e+02
    Iteration #11, error = 3.2e+02
    Iteration #12, error = 2.9e+02
    Iteration #13, error = 2.7e+02
    Iteration #14, error = 2.5e+02
    Iteration #15, error = 2.2e+02
    Iteration #16, error = 2.1e+02
    Iteration #17, error = 1.9e+02
    Iteration #18, error = 1.8e+02
    Iteration #19, error = 1.7e+02
    Iteration #20, error = 1.6e+02
    Iteration #21, error = 1.5e+02
    Iteration #22, error = 1.4e+02
    Iteration #23, error = 1.4e+02
    Iteration #24, error = 1.3e+02
    Iteration #25, error = 1.3e+02
    Iteration #26, error = 1.2e+02
    Iteration #27, error = 1.2e+02
    Iteration #28, error = 1.1e+02
    Iteration #29, error = 1.1e+02
    Iteration #30, error = 1.1e+02
    Iteration #31, error = 1e+02
    Iteration #32, error = 1e+02
    Iteration #33, error = 9.7e+01
    Iteration #34, error = 9.4e+01
    Iteration #35, error = 9.1e+01
    Iteration #36, error = 8.9e+01
    Iteration #37, error = 8.6e+01
    Iteration #38, error = 8.3e+01
    Iteration #39, error = 8.1e+01
    Iteration #40, error = 7.8e+01
    Iteration #41, error = 7.6e+01
    Iteration #42, error = 7.4e+01
    Iteration #43, error = 7.2e+01
    Iteration #44, error = 7e+01
    Iteration #45, error = 6.8e+01
    Iteration #46, error = 6.6e+01
    Iteration #47, error = 6.4e+01
    Iteration #48, error = 6.3e+01
    Iteration #49, error = 6.1e+01
    Iteration #50, error = 5.9e+01
    Iteration #51, error = 5.7e+01
    Iteration #52, error = 5.6e+01
    Iteration #53, error = 5.4e+01
    Iteration #54, error = 5.3e+01
    Iteration #55, error = 5.2e+01
    Iteration #56, error = 5e+01
    Iteration #57, error = 4.9e+01
    Iteration #58, error = 4.8e+01
    Iteration #59, error = 4.6e+01
    Iteration #60, error = 4.5e+01
    Iteration #61, error = 4.4e+01
    Iteration #62, error = 4.3e+01
    Iteration #63, error = 4.2e+01
    Iteration #64, error = 4.1e+01
    Iteration #65, error = 3.9e+01
    Iteration #66, error = 3.8e+01
    Iteration #67, error = 3.7e+01
    Iteration #68, error = 3.7e+01
    Iteration #69, error = 3.6e+01
    Iteration #70, error = 3.5e+01
    Iteration #71, error = 3.4e+01
    Iteration #72, error = 3.3e+01
    Iteration #73, error = 3.2e+01
    Iteration #74, error = 3.1e+01
    Iteration #75, error = 3e+01
    Iteration #76, error = 3e+01
    Iteration #77, error = 2.9e+01
    Iteration #78, error = 2.8e+01
    Iteration #79, error = 2.7e+01
    Iteration #80, error = 2.7e+01
    Iteration #81, error = 2.6e+01
    Iteration #82, error = 2.5e+01
    Iteration #83, error = 2.5e+01
    Iteration #84, error = 2.4e+01
    Iteration #85, error = 2.4e+01
    Iteration #86, error = 2.3e+01
    Iteration #87, error = 2.2e+01
    Iteration #88, error = 2.2e+01
    Iteration #89, error = 2.1e+01
    Iteration #90, error = 2.1e+01
    Iteration #91, error = 2e+01
    Iteration #92, error = 2e+01
    Iteration #93, error = 1.9e+01
    Iteration #94, error = 1.9e+01
    Iteration #95, error = 1.8e+01
    Iteration #96, error = 1.8e+01
    Iteration #97, error = 1.8e+01
    Iteration #98, error = 1.7e+01
    Iteration #99, error = 1.7e+01
    Iteration #100, error = 1.6e+01
    Iteration #101, error = 1.6e+01
    Iteration #102, error = 1.5e+01
    Iteration #103, error = 1.5e+01
    Iteration #104, error = 1.5e+01
    Iteration #105, error = 1.4e+01
    Iteration #106, error = 1.4e+01
    Iteration #107, error = 1.4e+01
    Iteration #108, error = 1.3e+01
    Iteration #109, error = 1.3e+01
    Iteration #110, error = 1.3e+01
    Iteration #111, error = 1.2e+01
    Iteration #112, error = 1.2e+01
    Iteration #113, error = 1.2e+01
    Iteration #114, error = 1.2e+01
    Iteration #115, error = 1.1e+01
    Iteration #116, error = 1.1e+01
    Iteration #117, error = 1.1e+01
    Iteration #118, error = 1e+01
    Iteration #119, error = 1e+01
    Iteration #120, error = 1e+01
    Iteration #121, error = 9.7
    Iteration #122, error = 9.5
    Iteration #123, error = 9.3
    Iteration #124, error = 9.1
    Iteration #125, error = 8.8
    Iteration #126, error = 8.6
    Iteration #127, error = 8.4
    Iteration #128, error = 8.2
    Iteration #129, error = 8.0
    Iteration #130, error = 7.8
    Iteration #131, error = 7.6
    Iteration #132, error = 7.5
    Iteration #133, error = 7.3
    Iteration #134, error = 7.1
    Iteration #135, error = 6.9
    Iteration #136, error = 6.8
    Iteration #137, error = 6.6
    Iteration #138, error = 6.5
    Iteration #139, error = 6.3
    Iteration #140, error = 6.2
    Iteration #141, error = 6.0
    Iteration #142, error = 5.9
    Iteration #143, error = 5.7
    Iteration #144, error = 5.6
    Iteration #145, error = 5.5
    Iteration #146, error = 5.3
    Iteration #147, error = 5.2
    Iteration #148, error = 5.1
    Iteration #149, error = 5.0
    Iteration #150, error = 4.8
    Iteration #151, error = 4.7
    Iteration #152, error = 4.6
    Iteration #153, error = 4.5
    Iteration #154, error = 4.4
    Iteration #155, error = 4.3
    Iteration #156, error = 4.2
    Iteration #157, error = 4.1
    Iteration #158, error = 4.0
    Iteration #159, error = 3.9
    Iteration #160, error = 3.8
    Iteration #161, error = 3.7
    Iteration #162, error = 3.6
    Iteration #163, error = 3.5
    Iteration #164, error = 3.5
    Iteration #165, error = 3.4
    Iteration #166, error = 3.3
    Iteration #167, error = 3.2
    Iteration #168, error = 3.1
    Iteration #169, error = 3.1
    Iteration #170, error = 3.0
    Iteration #171, error = 2.9
    Iteration #172, error = 2.9
    Iteration #173, error = 2.8
    Iteration #174, error = 2.7
    Iteration #175, error = 2.7
    Iteration #176, error = 2.6
    Iteration #177, error = 2.5
    Iteration #178, error = 2.5
    Iteration #179, error = 2.4
    Iteration #180, error = 2.4
    Iteration #181, error = 2.3
    Iteration #182, error = 2.3
    Iteration #183, error = 2.2
    Iteration #184, error = 2.2
    Iteration #185, error = 2.1
    Iteration #186, error = 2.1
    Iteration #187, error = 2.0
    Iteration #188, error = 2.0
    Iteration #189, error = 1.9
    Iteration #190, error = 1.9
    Iteration #191, error = 1.8
    Iteration #192, error = 1.8
    Iteration #193, error = 1.7
    Iteration #194, error = 1.7
    Iteration #195, error = 1.7
    Iteration #196, error = 1.6
    Iteration #197, error = 1.6
    Iteration #198, error = 1.5
    Iteration #199, error = 1.5
    Iteration #200, error = 1.5
    Iteration #201, error = 1.4
    Iteration #202, error = 1.4
    Iteration #203, error = 1.4
    Iteration #204, error = 1.3
    Iteration #205, error = 1.3
    Iteration #206, error = 1.3
    Iteration #207, error = 1.2
    Iteration #208, error = 1.2
    Iteration #209, error = 1.2
    Iteration #210, error = 1.2
    Iteration #211, error = 1.1
    Iteration #212, error = 1.1
    Iteration #213, error = 1.1
    Iteration #214, error = 1.0
    Iteration #215, error = 1.0
    Iteration #216, error = 1.0
    Iteration #217, error = 0.97
    Iteration #218, error = 0.95
    Iteration #219, error = 0.93
    Iteration #220, error = 0.91
    Iteration #221, error = 0.89
    Iteration #222, error = 0.86
    Iteration #223, error = 0.84
    Iteration #224, error = 0.82
    Iteration #225, error = 0.8
    Iteration #226, error = 0.79
    Iteration #227, error = 0.77
    Iteration #228, error = 0.75
    Iteration #229, error = 0.73
    Iteration #230, error = 0.71
    Iteration #231, error = 0.7
    Iteration #232, error = 0.68
    Iteration #233, error = 0.66
    Iteration #234, error = 0.65
    Iteration #235, error = 0.63
    Iteration #236, error = 0.62
    Iteration #237, error = 0.6
    Iteration #238, error = 0.59
    Iteration #239, error = 0.58
    Iteration #240, error = 0.56
    Iteration #241, error = 0.55
    Iteration #242, error = 0.54
    Iteration #243, error = 0.52
    Iteration #244, error = 0.51
    Iteration #245, error = 0.5
    Iteration #246, error = 0.49
    Iteration #247, error = 0.47
    Iteration #248, error = 0.46
    Iteration #249, error = 0.45
    Iteration #250, error = 0.44
    Iteration #251, error = 0.43
    Iteration #252, error = 0.42
    Iteration #253, error = 0.41
    Iteration #254, error = 0.4
    Iteration #255, error = 0.39
    Iteration #256, error = 0.38
    Iteration #257, error = 0.37
    Iteration #258, error = 0.36
    Iteration #259, error = 0.36
    Iteration #260, error = 0.35
    Iteration #261, error = 0.34
    Iteration #262, error = 0.33
    Iteration #263, error = 0.32
    Iteration #264, error = 0.32
    Iteration #265, error = 0.31
    Iteration #266, error = 0.3
    Iteration #267, error = 0.29
    Iteration #268, error = 0.29
    Iteration #269, error = 0.28
    Iteration #270, error = 0.27
    Iteration #271, error = 0.27
    Iteration #272, error = 0.26
    Iteration #273, error = 0.25
    Iteration #274, error = 0.25
    Iteration #275, error = 0.24
    Iteration #276, error = 0.24
    Iteration #277, error = 0.23
    Iteration #278, error = 0.23
    Iteration #279, error = 0.22
    Iteration #280, error = 0.21
    Iteration #281, error = 0.21
    Iteration #282, error = 0.2
    Iteration #283, error = 0.2
    Iteration #284, error = 0.19
    Iteration #285, error = 0.19
    Iteration #286, error = 0.19
    Iteration #287, error = 0.18
    Iteration #288, error = 0.18
    Iteration #289, error = 0.17
    Iteration #290, error = 0.17
    Iteration #291, error = 0.16
    Iteration #292, error = 0.16
    Iteration #293, error = 0.16
    Iteration #294, error = 0.15
    Iteration #295, error = 0.15
    Iteration #296, error = 0.15
    Iteration #297, error = 0.14
    Iteration #298, error = 0.14
    Iteration #299, error = 0.14
    Iteration #300, error = 0.13
    Iteration #301, error = 0.13
    Iteration #302, error = 0.13
    Iteration #303, error = 0.12
    Iteration #304, error = 0.12
    Iteration #305, error = 0.12
    Iteration #306, error = 0.11
    Iteration #307, error = 0.11
    Iteration #308, error = 0.11
    Iteration #309, error = 0.11
    Iteration #310, error = 0.1
    Iteration #311, error = 0.1
    Iteration #312, error = 0.099
    Iteration #313, error = 0.097
    Iteration #314, error = 0.094
    Iteration #315, error = 0.092
    Iteration #316, error = 0.09
    Iteration #317, error = 0.088
    Iteration #318, error = 0.086
    Iteration #319, error = 0.084
    Iteration #320, error = 0.082
    Iteration #321, error = 0.08
    Iteration #322, error = 0.078
    Iteration #323, error = 0.076
    Iteration #324, error = 0.074
    Iteration #325, error = 0.072
    Iteration #326, error = 0.071
    Iteration #327, error = 0.069
    Iteration #328, error = 0.067
    Iteration #329, error = 0.066
    Iteration #330, error = 0.064
    Iteration #331, error = 0.063
    Iteration #332, error = 0.061
    Iteration #333, error = 0.06
    Iteration #334, error = 0.058
    Iteration #335, error = 0.057
    Iteration #336, error = 0.056
    Iteration #337, error = 0.054
    Iteration #338, error = 0.053
    Iteration #339, error = 0.052
    Iteration #340, error = 0.05
    Iteration #341, error = 0.049
    Iteration #342, error = 0.048
    Iteration #343, error = 0.047
    Iteration #344, error = 0.046
    Iteration #345, error = 0.045
    Iteration #346, error = 0.044
    Iteration #347, error = 0.043
    Iteration #348, error = 0.042
    Iteration #349, error = 0.041
    Iteration #350, error = 0.04
    Iteration #351, error = 0.039
    Iteration #352, error = 0.038
    Iteration #353, error = 0.037
    Iteration #354, error = 0.036
    Iteration #355, error = 0.035
    Iteration #356, error = 0.034
    Iteration #357, error = 0.033
    Iteration #358, error = 0.033
    Iteration #359, error = 0.032
    Iteration #360, error = 0.031
    Iteration #361, error = 0.03
    Iteration #362, error = 0.03
    Iteration #363, error = 0.029
    Iteration #364, error = 0.028
    Iteration #365, error = 0.028
    Iteration #366, error = 0.027
    Iteration #367, error = 0.026
    Iteration #368, error = 0.026
    Iteration #369, error = 0.025
    Iteration #370, error = 0.024
    Iteration #371, error = 0.024
    Iteration #372, error = 0.023
    Iteration #373, error = 0.023
    Iteration #374, error = 0.022
    Iteration #375, error = 0.022
    Iteration #376, error = 0.021
    Iteration #377, error = 0.021
    Iteration #378, error = 0.02
    Iteration #379, error = 0.02
    Iteration #380, error = 0.019
    Iteration #381, error = 0.019
    Iteration #382, error = 0.018
    Iteration #383, error = 0.018
    Iteration #384, error = 0.017
    Iteration #385, error = 0.017
    Iteration #386, error = 0.017
    Iteration #387, error = 0.016
    Iteration #388, error = 0.016
    Iteration #389, error = 0.015
    Iteration #390, error = 0.015
    Iteration #391, error = 0.015
    Iteration #392, error = 0.014
    Iteration #393, error = 0.014
    Iteration #394, error = 0.014
    Iteration #395, error = 0.013
    Iteration #396, error = 0.013
    Iteration #397, error = 0.013
    Iteration #398, error = 0.012
    Iteration #399, error = 0.012
    Iteration #400, error = 0.012
    Iteration #401, error = 0.012
    Iteration #402, error = 0.011
    Iteration #403, error = 0.011
    Iteration #404, error = 0.011
    Iteration #405, error = 0.01
    Iteration #406, error = 0.01
    Iteration #407, error = 0.01
    Iteration #408, error = 0.0097
    Iteration #409, error = 0.0095
    Iteration #410, error = 0.0093
    Iteration #411, error = 0.0091
    Iteration #412, error = 0.0088
    Iteration #413, error = 0.0086
    Iteration #414, error = 0.0084
    Iteration #415, error = 0.0082
    Iteration #416, error = 0.008
    Iteration #417, error = 0.0078
    Iteration #418, error = 0.0076
    Iteration #419, error = 0.0075
    Iteration #420, error = 0.0073
    Iteration #421, error = 0.0071
    Iteration #422, error = 0.0069
    Iteration #423, error = 0.0068
    Iteration #424, error = 0.0066
    Iteration #425, error = 0.0065
    Iteration #426, error = 0.0063
    Iteration #427, error = 0.0061
    Iteration #428, error = 0.006
    Iteration #429, error = 0.0059
    Iteration #430, error = 0.0057
    Iteration #431, error = 0.0056
    Iteration #432, error = 0.0054
    Iteration #433, error = 0.0053
    Iteration #434, error = 0.0052
    Iteration #435, error = 0.0051
    Iteration #436, error = 0.0049
    Iteration #437, error = 0.0048
    Iteration #438, error = 0.0047
    Iteration #439, error = 0.0046
    Iteration #440, error = 0.0045
    Iteration #441, error = 0.0044
    Iteration #442, error = 0.0043
    Iteration #443, error = 0.0042
    Iteration #444, error = 0.0041
    Iteration #445, error = 0.004
    Iteration #446, error = 0.0039
    Iteration #447, error = 0.0038
    Iteration #448, error = 0.0037
    Iteration #449, error = 0.0036
    Iteration #450, error = 0.0035
    Iteration #451, error = 0.0034
    Iteration #452, error = 0.0034
    Iteration #453, error = 0.0033
    Iteration #454, error = 0.0032
    Iteration #455, error = 0.0031
    Iteration #456, error = 0.003
    Iteration #457, error = 0.003
    Iteration #458, error = 0.0029
    Iteration #459, error = 0.0028
    Iteration #460, error = 0.0028
    Iteration #461, error = 0.0027
    Iteration #462, error = 0.0026
    Iteration #463, error = 0.0026
    Iteration #464, error = 0.0025
    Iteration #465, error = 0.0025
    Iteration #466, error = 0.0024
    Iteration #467, error = 0.0023
    Iteration #468, error = 0.0023
    Iteration #469, error = 0.0022
    Iteration #470, error = 0.0022
    Iteration #471, error = 0.0021
    Iteration #472, error = 0.0021
    Iteration #473, error = 0.002
    Iteration #474, error = 0.002
    Iteration #475, error = 0.0019
    Iteration #476, error = 0.0019
    Iteration #477, error = 0.0018
    Iteration #478, error = 0.0018
    Iteration #479, error = 0.0017
    Iteration #480, error = 0.0017
    Iteration #481, error = 0.0017
    Iteration #482, error = 0.0016
    Iteration #483, error = 0.0016
    Iteration #484, error = 0.0015
    Iteration #485, error = 0.0015
    Iteration #486, error = 0.0015
    Iteration #487, error = 0.0014
    Iteration #488, error = 0.0014
    Iteration #489, error = 0.0014
    Iteration #490, error = 0.0013
    Iteration #491, error = 0.0013
    Iteration #492, error = 0.0013
    Iteration #493, error = 0.0012
    Iteration #494, error = 0.0012
    Iteration #495, error = 0.0012
    Iteration #496, error = 0.0012
    Iteration #497, error = 0.0011
    Iteration #498, error = 0.0011
    Iteration #499, error = 0.0011
    Iteration #500, error = 0.0011
    Iteration #501, error = 0.001
    Iteration #502, error = 0.001
    Iteration #503, error = 0.00098
    Iteration #504, error = 0.00095

```python
np.linalg.norm(solution - exact)
```

    0.002932809634837446

For other available solvers see the notebook that reproduces figures from the article.

Now it is possible to access convergence history. For example for the split solver

```python
plt.plot(np.log(E_split))
```

or for the Gaussian belief propagation solver

```python
plt.plot(np.log(E_BP))
```


```python
import numpy as np
import matplotlib.pyplot as pl
%matplotlib inline
```

```python
import sympy as sm
```

```python
s0, w0, d = sm.symbols('s0 w0 d', positive=True, real=True)
ti, tj, dt, t, tp = sm.symbols('ti, tj, dt, t, tp', real=True)
tau = sm.symbols('tau', real=True, positive=True)
efp = sm.exp(-w0 * (t - tp) / sm.sqrt(2))
efm = sm.exp(-w0 * (tp - t) / sm.sqrt(2))
kernp = s0 * w0 * efp * sm.cos(w0 * (t-tp) / sm.sqrt(2) - sm.pi / 4)
kernm = s0 * w0 * efm * sm.cos(w0 * (tp-t) / sm.sqrt(2) - sm.pi / 4)
```

```python
k1 = sm.simplify(
    sm.integrate(
        sm.integrate(kernp, (tp, tj - d / 2, tj + d / 2)), (t, tj + d / 2, ti + d / 2)
    )
    / d ** 2
)
k2 = sm.simplify(
    sm.integrate(sm.integrate(kernp, (tp, tj - d / 2, t)), (t, ti - d / 2, tj + d / 2))
    / d ** 2
)
k3 = sm.simplify(
    sm.integrate(sm.integrate(kernm, (tp, t, tj + d / 2)), (t, ti - d / 2, tj + d / 2))
    / d ** 2
)
```

```python
kD = sm.simplify((k1 + k2 + k3).expand())
res = sm.simplify(kD.subs([(ti, tau + tj)]))
res
```

$\displaystyle \frac{2 s_{0}}{d} - \frac{2 s_{0} \tau}{d^{2}} + \frac{s_{0} e^{- \frac{\sqrt{2} d w_{0}}{2} - \frac{\sqrt{2} \tau w_{0}}{2}} \cos{\left(\frac{\sqrt{2} d w_{0}}{2} + \frac{\sqrt{2} \tau w_{0}}{2} + \frac{\pi}{4} \right)}}{d^{2} w_{0}} + \frac{s_{0} e^{- \frac{\sqrt{2} d w_{0}}{2} + \frac{\sqrt{2} \tau w_{0}}{2}} \cos{\left(\frac{\sqrt{2} d w_{0}}{2} - \frac{\sqrt{2} \tau w_{0}}{2} + \frac{\pi}{4} \right)}}{d^{2} w_{0}} - \frac{2 s_{0} e^{- \frac{\sqrt{2} \tau w_{0}}{2}} \cos{\left(\frac{\sqrt{2} \tau w_{0}}{2} + \frac{\pi}{4} \right)}}{d^{2} w_{0}}$

```python
resd = sm.simplify(res.subs([(tau, d)]))
resd
```

$\displaystyle \frac{\sqrt{2} s_{0}}{2 d^{2} w_{0}} + \frac{s_{0} e^{- \sqrt{2} d w_{0}} \cos{\left(\sqrt{2} d w_{0} + \frac{\pi}{4} \right)}}{d^{2} w_{0}} - \frac{2 s_{0} e^{- \frac{\sqrt{2} d w_{0}}{2}} \cos{\left(\frac{\sqrt{2} d w_{0}}{2} + \frac{\pi}{4} \right)}}{d^{2} w_{0}}$

```python
def var(w0, d):
    e1 = np.sqrt(2) * d * w0
    f1 = 1 / (d * d * w0 * np.sqrt(2))
    f2 = 1 * np.exp(-e1) * np.cos(e1 + np.pi / 4) / (d * d * w0)
    f3 = 2  * np.exp(-e1) *np.cos(e1/2 + np.pi / 4) / (d * d * w0)
    return f1 + f2 - f3

def mvar(s0, w0, d, alpha, sigma):
    alpha = s0 * alpha[:, None] * np.sqrt(var(w0, d))
    sum = np.sum(alpha, axis=0)
    sum2 = np.sum(alpha**2, axis=0)
    num = sigma * sigma + sum2
    denom = len(alpha) * (1 + sum2 / (sigma * sigma)) - (sum / sigma) ** 2
    return num / denom

def var1(s0, w0, d, alpha, sigma):
    alpha = s0 * alpha[:, None] * np.sqrt(var(w0, d))
    sum = np.sum(alpha, axis=0)
    return sigma * sigma / len(alpha) + (sum / len(alpha))**2
```

```python
s0 = np.linspace(0, 100, 1000)
w0 = 0.001
alpha = np.linspace(1, 2, 3)
sigma = 0.1 * np.sqrt(3)
d = 2 * np.pi / w0
pl.plot(s0, mvar(s0, w0, d, alpha, sigma))
pl.plot(s0, var1(s0, w0, d, alpha, sigma))
```

```python

```


This notebook shows how to draw water retention curve (WRC) and hydraulic conductivity function (HCF) using van-Genuchen-Mualem model:

\begin{equation}
  \label{eq:VGM_theta}
  \theta(\psi) = \theta_r + \frac{\theta_s - \theta_r}{(1+(-\alpha\psi)^n)^m},
\end{equation}

\begin{equation}
  \label{eq:VGM_K}
  K(\theta(\psi)) = K_sS_e^l(1-(1-S_e^{1/m})^m)^2,
\end{equation}

where $\theta_r$, $\theta_s$, $\alpha$, $n$, $K_s$, and $l$ are the Mualem-van Genuchen fitting parameters; $m = 1-1/n$; and the effective saturation $S_e$ is defined as

\begin{equation}
    \label{eq:effective_saturation}
    S_e = \frac{\theta - \theta_r}{\theta_s - \theta_r}.
\end{equation}

```python
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import AutoMinorLocator
```

The function below is used to set a fixed aspect ratio when drawing a plot in logarithmic scale using matplotlib.

```python
def fixed_aspect_ratio_row(ratio):
    '''
    Set a fixed aspect ratio on matplotlib plots
    regardless of axis units
    '''
    xvals,yvals = axs[row].get_xlim(),axs[row].get_ylim()

    xrange = xvals[1]-xvals[0]
    yrange = yvals[1]-yvals[0]
    axs[row].set_aspect(ratio*(xrange/yrange), adjustable='box')
```

```python
def VGM_theta_K(psi, theta_r, theta_s, alpha, n, K_s, l):
    """
    this function calculates volumetric water content and hydraulic conductivity
    from matric potential (psi: negative) given VGM (van-Genuchen and Mualem model) parameters
    output: (theta, K)
    theta: volumetric water content
    K: hydraulic conductivity
    """
    m = 1 - 1/n
    S_e = (1 + (-alpha*psi)**n)**(-m)
    theta =  S_e * (theta_s - theta_r) + theta_r
    K = K_s*S_e**l*(1-(1-S_e**(1/m))**m)**2
    return theta, K
```

```python
# VGM parameters(van Genuchen, 1980)
# theta_r, theta_s, alpha, n, K_s, l (units: cm, day)
VGM_parameters = {"sand": [0.045, 0.43, 0.145, 2.68, 712.8, 0.5],
                  "loam": [0.078, 0.43, 0.036, 1.56, 24.96, 0.5],
                  "clay": [0.068, 0.38, 0.008, 1.09, 4.8, 0.5]
                 }
```

Matric potential data are prepared here. By using np.arange funciton in logarithmic scale, equally spaced matric potential in logarithmic scale can be prepared.

```python
log10_h = np.arange(0, 6, 0.1)  # logarithm of suction (negative matric potential) in cm
psi = -10**log10_h
```

```python
for soil in ["sand", "loam", "clay"]:
    vars()['theta_VGM_'+ soil], vars()['K_VGM_'+ soil] = VGM_theta_K(psi, *VGM_parameters[soil])
```

```python
## water retention curve and hydraulic conductivity function for VGM model
fig, axs = plt.subplots(1, 2, sharex=False, sharey=False, figsize=(5.0, 5/2), facecolor='none', edgecolor='#000000')

plt.rcParams['font.family'] = 'Times New Roman'
plt.rcParams['font.size'] = 8
plt.rcParams['axes.linewidth'] = 1

plt.subplots_adjust(wspace = 0.6)

row = 0

# volumetric water content data
theta_sand = vars()['theta_VGM_'+'sand']
theta_loam = vars()['theta_VGM_'+ 'loam']
theta_clay = vars()['theta_VGM_'+ 'clay']

# hydraulic conductivity data
log_K_sand = np.log10(vars()['K_VGM_'+ 'sand'])
log_K_loam = np.log10(vars()['K_VGM_'+ 'loam'])
log_K_clay = np.log10(vars()['K_VGM_'+ 'clay'])

# plotting water retention curve
axs[0].plot(log10_h, theta_sand, '-',color='#767575', linewidth=1,label='Sand')
axs[0].plot(log10_h, theta_loam, '--',color='#E85295', linewidth=1,label='Loam')
axs[0].plot(log10_h, theta_clay, ':',color='#229DD9', linewidth=1,label='Clay')

# x-axis
ticks_x = np.arange(-1, 6, 1)
ticklabels_x = [r"-10$^{{{}}}$".format(tick) for tick in ticks_x]
axs[0].set_xticks(ticks_x)
axs[0].set_xticklabels(ticklabels_x)

minor_ticks = []
for i in range(-1, 6):
    for j in range(2,10):
         minor_ticks.append(i+np.log10(j))

axs[0].set_xticks(minor_ticks, minor=True)
axs[0].tick_params(axis='x', pad=5)

# y-axis
ticks_y = np.arange(0.0,0.5,0.1)
axs[0].set_yticks(ticks_y)

axs[0].tick_params(axis='y', pad=5)
axs[0].yaxis.set_minor_locator(AutoMinorLocator(5))

# tick parameters
axs[0].tick_params(axis = 'both', which = 'major', direction = 'in',size=4, width=1, color='#000000', labelsize=8)
axs[0].tick_params(axis = 'both', which = 'minor', direction = 'in',size=2,width=0.5, color='#000000', labelsize=8)

# limits for x and y axes
axs[0].set_xlim(0, 6)
axs[0].set_ylim(0.00,0.5)

# axes label
axs[0].set_xlabel('Matric Potential $\\psi$ [cm]', fontsize=8,color='#000000')
axs[0].set_ylabel('Volumetric Water Content $\\theta$ [-]', fontsize=8,color='#000000')
fixed_aspect_ratio_row(1.0)

row = 1

# plot hydraulic conductivity functions
axs[1].plot(log10_h, log_K_sand, '-',color='#767575', linewidth=1,label='Sand')
axs[1].plot(log10_h, log_K_loam, '--',color='#E85295', linewidth=1,label='Loam')
axs[1].plot(log10_h, log_K_clay, ':',color='#229DD9', linewidth=1,label='Clay')

# x-axis
ticks_x = np.arange(0, 6, 1)
ticklabels_x = [r"-10$^{{{}}}$".format(tick) for tick in ticks_x]
axs[1].set_xticks(ticks_x)
axs[1].set_xticklabels(ticklabels_x)

minor_ticks = []
for i in range(0, 6):
    for j in range(2,10):
         minor_ticks.append(i+np.log10(j))

axs[1].set_xticks(minor_ticks, minor=True)
axs[1].tick_params(axis='x', pad=5)

# y-axis
ticks_y = np.arange(-10, 3, 2)
ticklabels_y = [r"10$^{{{}}}$".format(tick) for tick in ticks_y]
minor_ticks = []
for i in range(-10, 3):
    for j in range(2,10):
         minor_ticks.append(i+np.log10(j))

axs[1].set_yticks(ticks_y)
axs[1].set_yticks(minor_ticks, minor=True)
axs[1].set_yticklabels(ticklabels_y)
axs[1].tick_params(axis='y', pad=5)

# tick parameters
axs[1].tick_params(axis = 'both', which = 'major', direction = 'in',size=4, width=1, color='#000000', labelsize=8)
axs[1].tick_params(axis = 'both', which = 'minor', direction = 'in',size=2,width=0.5, color='#000000', labelsize=8)

# limits for x and y axes
axs[1].set_xlim(0, 6)
axs[1].set_ylim(-10, 3)

axs[1].set_xlabel('Matric Potential $\\psi$ [cm]', fontsize=8,color='#000000')
axs[1].set_ylabel('Hydraulic Conductivity $K$ [cm day$^{-1}$]', fontsize=8,color='#000000')
fixed_aspect_ratio_row(1.0)

axs[1].legend(loc = (0.55,0.65), numpoints=3,fontsize=8, facecolor = 'None', edgecolor = 'None')

# plt.savefig('VGM.pdf')
# plt.savefig('VGM.eps')
# plt.savefig('VGM.png', transparent = True)
```