# brent's method and numerical derivatives

**URL:** <https://discourse.opengeosys.org/t/brents-method-and-numerical-derivatives/279>\
**Category:** ogs-devs\
**Tags:** mailing-list\
**Created:** [October 6, 2016, 11:42am UTC](https://discourse.opengeosys.org/t/brents-method-and-numerical-derivatives/279 "2016-10-06T11:42:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christof\_Beyer](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/c/71c47a/32.png) [@Christof\_Beyer](https://discourse.opengeosys.org/u/Christof_Beyer)\
**Post date:** [October 6, 2016, 11:42am UTC](https://discourse.opengeosys.org/t/brents-method-and-numerical-derivatives/279/1 "2016-10-06T11:42:16Z")

</div>

Dear all,

is someone aware of freely available and easy to plug in (OGS5) implementations of

- Brent's method ([http://www.aip.de/groups/soe/local/numres/bookcpdf/c9-3.pdf\](http://www.aip.de/groups/soe/local/numres/bookcpdf/c9-3.pdf%5C))

- numerical approximation of derivatives ([http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c5-7.pdf\](http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c5-7.pdf%5C))

Best, Christof

> **···**
>
> --  
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Dr. Christof Beyer  
> Institute of Geosciences  
> Geohydromodelling  
> Christian-Albrechts-University Kiel  
> Ludewig-Meyn-Str. 10  
> 24118 Kiel  
> Germany
> 
> phone: +49(0)431-8803172  
> fax: +49(0)431-8807606  
> mobile: +49(0)176-24297908  
> email: christof.beyer@gpi.uni-kiel.de  
> home: [www.uni-kiel.de/ghm](http://www.uni-kiel.de/ghm)  
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

---

<div class="post-metadata">

**Author:** ![Joshua](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/j/48db29/32.png) [@Joshua](https://discourse.opengeosys.org/u/Joshua)\
**Post date:** [October 6, 2016, 2:43pm UTC](https://discourse.opengeosys.org/t/brents-method-and-numerical-derivatives/279/2 "2016-10-06T14:43:55Z")

</div>

Christof,

Norbert put one in (brent) when he did the helmholtz equations of state. On the road now and can’t remember exactly where it is, but can look later. It’s in there, with the eos, probably called zbrent.

Josh

> **···**
>
> On Oct 6, 2016 4:42 AM, “cb” [cb@gpi.uni-kiel.de](mailto:cb@gpi.uni-kiel.de) wrote:
> 
> > Dear all,
> > 
> > is someone aware of freely available and easy to plug in (OGS5) implementations of
> > 
> > - Brent’s method ([http://www.aip.de/groups/soe/local/numres/bookcpdf/c9-3.pdf](http://www.aip.de/groups/soe/local/numres/bookcpdf/c9-3.pdf))
> > 
> > - numerical approximation of derivatives ([http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c5-7.pdf](http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c5-7.pdf))
> > 
> > Best, Christof
> > 
> > –
> > 
> > * * *
> > 
> > Dr. Christof Beyer
> > 
> > Institute of Geosciences
> > 
> > Geohydromodelling
> > 
> > Christian-Albrechts-University Kiel
> > 
> > Ludewig-Meyn-Str. 10
> > 
> > 24118 Kiel
> > 
> > Germany
> > 
> > phone: +49(0)431-8803172
> > 
> > fax: +49(0)431-8807606
> > 
> > mobile: +49(0)176-24297908
> > 
> > email: [christof.beyer@gpi.uni-kiel.de](mailto:christof.beyer@gpi.uni-kiel.de)
> > 
> > home: [www.uni-kiel.de/ghm](http://www.uni-kiel.de/ghm)
> > 
> > * * *
> > 
> > –
> > 
> > You received this message because you are subscribed to the Google Groups “ogs-devs” group.
> > 
> > To unsubscribe from this group and stop receiving emails from it, send an email to [ogs-devs+unsubscribe@googlegroups.com](mailto:ogs-devs+unsubscribe@googlegroups.com).
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![bilke](https://discourse.opengeosys.org/user_avatar/discourse.opengeosys.org/bilke/32/868_2.png) [@bilke](https://discourse.opengeosys.org/u/bilke)\
**Post date:** [October 6, 2016, 2:50pm UTC](https://discourse.opengeosys.org/t/brents-method-and-numerical-derivatives/279/3 "2016-10-06T14:50:52Z")

</div>

Hi Christoph,

you can find Brent’s method in ThirdParty/Brent:

> **[ogs5/ThirdParty/Brent at master · ufz/ogs5](https://github.com/ufz/ogs5/tree/master/ThirdParty/Brent)**
>
> OpenGeoSys THM/C simulator version 5. Contribute to ufz/ogs5 development by creating an account on GitHub.

Best,  
Lars

Am 6. Oktober 2016 um 13:42:19, cb (cb@gpi.uni-kiel.de) schrieb:

> **···**
>
> > Dear all,
> > 
> > is someone aware of freely available and easy to plug in (OGS5)  
> > implementations of
> > 
> > - Brent's method  
> > ([http://www.aip.de/groups/soe/local/numres/bookcpdf/c9-3.pdf\](http://www.aip.de/groups/soe/local/numres/bookcpdf/c9-3.pdf%5C))
> > 
> > - numerical approximation of derivatives  
> > ([http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c5-7.pdf\](http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c5-7.pdf%5C))
> > 
> > Best, Christof
> > 
> > --  
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Dr. Christof Beyer  
> > Institute of Geosciences  
> > Geohydromodelling  
> > Christian-Albrechts-University Kiel  
> > Ludewig-Meyn-Str. 10  
> > 24118 Kiel  
> > Germany
> > 
> > phone: +49(0)431-8803172  
> > fax: +49(0)431-8807606  
> > mobile: +49(0)176-24297908  
> > email: christof.beyer@gpi.uni-kiel.de  
> > home: [www.uni-kiel.de/ghm](http://www.uni-kiel.de/ghm)  
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups "ogs-devs"  
> > group.  
> > To unsubscribe from this group and stop receiving emails from it, send an email to ogs-devs+unsubscribe@googlegroups.com.  
> > For more options, visit [https://groups.google.com/d/optout\](https://groups.google.com/d/optout%5C).

---

<div class="post-metadata">

**Author:** ![Singh\_Ashok](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/s/96bed5/32.png) [@Singh\_Ashok](https://discourse.opengeosys.org/u/Singh_Ashok)\
**Post date:** [October 6, 2016, 3:13pm UTC](https://discourse.opengeosys.org/t/brents-method-and-numerical-derivatives/279/4 "2016-10-06T15:13:23Z")

</div>

void NsPol3 (double p, double q, double r, vector\* roots)

> **···**
>
> On Thu, Oct 6, 2016 at 4:50 PM, Lars Bilke [lars.bilke@ufz.de](mailto:lars.bilke@ufz.de) wrote:
> 
> > Hi Christoph,
> > 
> > you can find Brent’s method in ThirdParty/Brent:
> > 
> > [https://github.com/ufz/ogs5/tree/master/ThirdParty/Brent](https://github.com/ufz/ogs5/tree/master/ThirdParty/Brent)
> > 
> > Best,
> > 
> > Lars
> > 
> > Am 6. Oktober 2016 um 13:42:19, cb ([cb@gpi.uni-kiel.de](mailto:cb@gpi.uni-kiel.de)) schrieb:
> > 
> > > Dear all,
> > 
> > > 
> > 
> > > is someone aware of freely available and easy to plug in (OGS5)
> > 
> > > implementations of
> > 
> > > 
> > 
> > > - Brent’s method
> > 
> > > ([http://www.aip.de/groups/soe/local/numres/bookcpdf/c9-3.pdf](http://www.aip.de/groups/soe/local/numres/bookcpdf/c9-3.pdf))
> > 
> > > 
> > 
> > > - numerical approximation of derivatives
> > 
> > > ([http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c5-7.pdf](http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c5-7.pdf))
> > 
> > > 
> > 
> > > Best, Christof
> > 
> > > 
> > 
> > > –
> > 
> > > * * *
> > 
> > > Dr. Christof Beyer
> > 
> > > Institute of Geosciences
> > 
> > > Geohydromodelling
> > 
> > > Christian-Albrechts-University Kiel
> > 
> > > Ludewig-Meyn-Str. 10
> > 
> > > 24118 Kiel
> > 
> > > Germany
> > 
> > > 
> > 
> > > phone: +49(0)431-8803172
> > 
> > > fax: +49(0)431-8807606
> > 
> > > mobile: +49(0)176-24297908
> > 
> > > email: [christof.beyer@gpi.uni-kiel.de](mailto:christof.beyer@gpi.uni-kiel.de)
> > 
> > > home: [www.uni-kiel.de/ghm](http://www.uni-kiel.de/ghm)
> > 
> > > * * *
> > 
> > > 
> > 
> > > –
> > 
> > > You received this message because you are subscribed to the Google Groups “ogs-devs”
> > 
> > > group.
> > 
> > > To unsubscribe from this group and stop receiving emails from it, send an email to [ogs-devs+unsubscribe@googlegroups.com](mailto:ogs-devs+unsubscribe@googlegroups.com).
> > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > > 
> > 
> > –
> > 
> > You received this message because you are subscribed to the Google Groups “ogs-devs” group.
> > 
> > To unsubscribe from this group and stop receiving emails from it, send an email to [ogs-devs+unsubscribe@googlegroups.com](mailto:ogs-devs+unsubscribe@googlegroups.com).
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Christof\_Beyer](https://discourse.opengeosys.org/letter_avatar_proxy/v4/letter/c/71c47a/32.png) [@Christof\_Beyer](https://discourse.opengeosys.org/u/Christof_Beyer)\
**Post date:** [October 6, 2016, 5:58pm UTC](https://discourse.opengeosys.org/t/brents-method-and-numerical-derivatives/279/5 "2016-10-06T17:58:53Z")

</div>

Thanks guys!

```
  eos zbrent is the same as gcc zbrent and is based on Numerical Recipes. This is the functio I want to replace.

```

I’ll try Lars and Ashoks suggestions.

Christof

> **···**
>
> On Thu, Oct 6, 2016 at 4:50 PM, Lars Bilke [lars.bilke@ufz.de](mailto:lars.bilke@ufz.de)  
> wrote:
> 
> > ```
> > Hi Christoph,
> > 
> > you can find Brent’s method in ThirdParty/Brent:
> > 
> > [https://github.com/ufz/ogs5/tree/master/ThirdParty/Brent](https://github.com/ufz/ogs5/tree/master/ThirdParty/Brent) 
> > 
> > Best,
> > 
> > Lars
> > 
> > Am 6. Oktober 2016 um 13:42:19, cb (cb@gpi.uni-kiel.de ) schrieb:
> > 
> > > Dear all,
> > 
> > >
> > 
> > > is someone aware of freely available and easy to plug in (OGS5)
> > 
> > > implementations of
> > 
> > >
> > 
> > > - Brent's method
> > 
> > > ([http://www.aip.de/groups/soe/local/numres/bookcpdf/c9-3.pdf](http://www.aip.de/groups/soe/local/numres/bookcpdf/c9-3.pdf))
> > 
> > >
> > 
> > > - numerical approximation of derivatives
> > 
> > > ([http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c5-7.pdf](http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c5-7.pdf))
> > 
> > >
> > 
> > > Best, Christof
> > 
> > >
> > 
> > > --
> > 
> > > _______________________________________
> > 
> > > Dr. Christof Beyer
> > 
> > > Institute of Geosciences
> > 
> > > Geohydromodelling
> > 
> > > Christian-Albrechts-University Kiel
> > 
> > > Ludewig-Meyn-Str. 10
> > 
> > > 24118 Kiel
> > 
> > > Germany
> > 
> > >
> > 
> > > phone: +49(0)431-8803172
> > 
> > > fax: +49(0)431-8807606
> > 
> > > mobile: +49(0)176-24297908
> > 
> > > email: christof.beyer@gpi.uni-kiel.de
> > 
> > > home: [www.uni-kiel.de/ghm](http://www.uni-kiel.de/ghm)
> > 
> > > _______________________________________
> > 
> > >
> > 
> > > --
> > 
> > > You received this message because you are subscribed to the Google Groups "ogs-devs"
> > 
> > > group.
> > 
> > > To unsubscribe from this group and stop receiving emails from it, send an email to ogs-devs+unsubscribe@googlegroups.com.
> > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > >
> > 
> > --
> > 
> > You received this message because you are subscribed to the Google Groups "ogs-devs" group.
> > 
> > To unsubscribe from this group and stop receiving emails from it, send an email to ogs-devs+unsubscribe@googlegroups.com.
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > ```
