package owl-base

  1. Overview
  2. Docs
OCaml Scientific and Engineering Computing - Base

Install

Dune Dependency

Authors

Maintainers

Sources

owl-0.8.0.tbz
sha256=862af251e2a3e7a6b79724a4020a0c9308b36f12c85cd0a52385c4df82132c66
sha512=c1dabbf467a587757b11a28b9c6e8f68a86ce799d07c7ab5f2afa92d20145ba9e4282975aeb269b7324f5ba90d1576db156006f4d58177a860def773f9d974f2

doc/owl-base/Owl_maths_root/index.html

Module Owl_maths_rootSource

Root finding algorithms for nonlinear functions

Type definition
Sourcetype solver =
  1. | Bisec
  2. | FalsePos
  3. | Ridder
  4. | Brent
    (*

    Type of root functions of univariate functions.

    *)
Core functions
Sourceval fzero : ?solver:solver -> ?max_iter:int -> ?xtol:float -> (float -> float) -> float -> float -> float

``fzero ~solver f a b`` tries to find the root of univariate function ``f`` in the bracket ``a, b`` using method ``solver``. This is the hub function of the individual root finding algorithms in the following sections. You can certainly call each individual ones.

Parameters: * ``solver``: solver, default one is Brent method. * ``max_iter``: maximum number of iterations, default value is ``1000``. * ``xtol``: the tolerance of ``x`` on abscissa, default value is ``1e-6``. * ``f``: the univariate scalar function to find root. * ``a``: boundary of bracket. * ``b``: boundary of bracket.

Root of univariate functions
Sourceval bisec : ?max_iter:int -> ?xtol:float -> (float -> float) -> float -> float -> float

``bisec f a b`` tries to find the root of univariate function ``f`` in the bracket defined by ``a, b``.

Parameters: * ``max_iter``: maximum number of iterations. * ``xtol``: the tolerance of ``x`` on abscissa. * ``f``: the univariate scalar function to find root. * ``a``: boundary of bracket. * ``b``: boundary of bracket.

Sourceval false_pos : ?max_iter:int -> ?xtol:float -> (float -> float) -> float -> float -> float

``false_pos f a b`` tries to find the root of univariate function ``f`` in the bracket defined by ``a, b``.

Parameters: * ``max_iter``: maximum number of iterations. * ``xtol``: the tolerance of ``x`` on abscissa. * ``f``: the univariate scalar function to find root. * ``a``: boundary of bracket. * ``b``: boundary of bracket.

Sourceval ridder : ?max_iter:int -> ?xtol:float -> (float -> float) -> float -> float -> float

``ridder f a b`` tries to find the root of univariate function ``f`` in the bracket defined by ``a, b``.

Parameters: * ``max_iter``: maximum number of iterations. * ``xtol``: the tolerance of ``x`` on abscissa. * ``f``: the univariate scalar function to find root. * ``a``: boundary of bracket. * ``b``: boundary of bracket.

Sourceval brent : ?max_iter:int -> ?xtol:float -> (float -> float) -> float -> float -> float

``brent f a b`` tries to find the root of univariate function ``f`` in the bracket defined by ``a, b``.

Parameters: * ``max_iter``: maximum number of iterations. * ``xtol``: the tolerance of ``x`` on abscissa. * ``f``: the univariate scalar function to find root. * ``a``: boundary of bracket. * ``b``: boundary of bracket.

Refer to :cite:`brent2013algorithms`

Helper functions
Sourceval bracket_expand : ?rate:float -> ?max_iter:int -> (float -> float) -> float -> float -> (float * float) option

``bracket_expand f a b`` expands the bracket ``a, b`` for a given function ``f`` until it finds ``f a`` and ``f b`` have different signs.

Parameters: * ``max_iter``: maximum number of iterations, the default is 100 * ``rate``: rate of growth, the default is 1.6 * ``f``: the univariate scalar function to find root. * ``a``: initial boundary of bracket. * ``b``: initial boundary of bracket.

OCaml

Innovation. Community. Security.