RegulaFalsi class final
Implements the regula falsi method (also known as "false position method") to find the roots of a given equation.
Characteristics:
-
The method requires the root to be bracketed between two points
a
andb
otherwise it won't work. -
If you cannot assume that a function may be interpolated by a linear function, then applying this method method could result in worse results than the bisection method.
Constructors
- RegulaFalsi({required String function, required double a, required double b, double tolerance = 1.0e-10, int maxSteps = 15})
-
Creates a RegulaFalsi object to find the root of an equation by using
the regula falsi method.
const
Properties
- a → double
-
The starting point of the interval.
final
- b → double
-
The ending point of the interval.
final
- function → String
-
The function f(x) for which the algorithm has to find a solution.
finalinherited
- hashCode → int
-
The hash code for this object.
no setteroverride
- maxSteps → int
-
The maximum number of iterations to be made by the algorithm.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tolerance → double
-
The algorithm accuracy.
finalinherited
Methods
-
convergence(
List< double> guesses, int steps) → double -
To get a meaningful result, it makes sense to compute the rate of
convergence only if the algorithm made at least 3
steps
(iterations).inherited -
efficiency(
List< double> guesses, int steps) → double -
The efficiency is evaluated only if the convergence is not double.nan.
The formula is:
inherited
-
evaluateDerivativeOn(
double x) → num -
Evaluates the derivative of the function on the given
x
value.inherited -
evaluateOn(
double x) → num -
Evaluates the function on the given
x
value.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
solve(
) → ({double convergence, double efficiency, List< double> guesses}) -
Generates the succession generated by the root-finding algorithm. Returns
a Record object whose members are:
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override