# Error in example scripts

**URL:** <https://bempp.discourse.group/t/error-in-example-scripts/341>\
**Category:** Bempp\
**Created:** [12 September 2025 14:05 UTC](https://bempp.discourse.group/t/error-in-example-scripts/341 "2025-09-12T14:05:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alanlindsay](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@alanlindsay](https://bempp.discourse.group/u/alanlindsay)\
**Post date:** [12 September 2025 14:05 UTC](https://bempp.discourse.group/t/error-in-example-scripts/341/1 "2025-09-12T14:05:50Z")

</div>

Hi there,

I’m trying to familiarize myself with bempp by running the example scripts. I’m getting the following error related to the gmres solver:

For example, when executing line 72 of the reentrant cube capacitance example, I get the following error.

```
x, info = scipy.sparse.linalg.gmres(A_op, b_vec, rtol=tol, restart=restart, maxiter=maxiter, callback=callback)

```

TypeError: gmres() got an unexpected keyword argument ‘rtol’

Any feedback to resolve this issue would be appreciated.

Alan

---

<div class="post-metadata">

**Author:** ![Elwin](https://yyz2.discourse-cdn.com/free1/user_avatar/bempp.discourse.group/elwin/32/38_2.png) [@Elwin](https://bempp.discourse.group/u/Elwin)\
**Post date:** [15 September 2025 11:26 UTC](https://bempp.discourse.group/t/error-in-example-scripts/341/2 "2025-09-15T11:26:27Z")

</div>

Hi Alan,

The Generalized Minimum Residual (GMRES) algorithm is an iterative method to solve the linear system. The `rtol` argument is the relative tolerance for the termination criterion of GMRES. Check your version of `scipy` because legacy versions have the `tol` argument instead.

Also, notice that bempp-cl also has its own interface to the GMRES algorithm, with different function arguments. Check the documentation for the syntax of `bempp_cl.api.linalg.gmres()`.

Best,

Elwin

---

<div class="post-metadata">

**Author:** ![alanlindsay](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@alanlindsay](https://bempp.discourse.group/u/alanlindsay)\
**Post date:** [15 September 2025 11:56 UTC](https://bempp.discourse.group/t/error-in-example-scripts/341/3 "2025-09-15T11:56:15Z")

</div>

Thanks Elwin,

It seems I have multiple environments installed and some of them had older scipy. When I went through and updated them all it started working. Thanks!

Alan
