Solver¶
- class Solver(*args)¶
SolverImplementation of 1D non linear equations.
- Parameters:
- absErrorpositive float
Absolute error between two successive iterates at the end point. Default value is defined in the ResourceMap via the Solver-DefaultAbsoluteError key is set to
.
- relErrorpositive float
Relative error between the two last successive iterates with regards to the last iterate. Default value is defined in the ResourceMap via the Solver-DefaultRelativeError key is set to
.
- resErrorpositive float
Absolute threshold on f(x) for accepting a given solution. It is also used as residual error for the least square optimizer. value. Default value is defined in the ResourceMap via the Solver-DefaultResidualError and is set to
.
- maximumFunctionEvaluationint
The maximum number of evaluations of the function. Default value is defined in the ResourceMap via the Solver-DefaultMaximumFunctionEvaluation and is set to
.
Methods
Accessor to the absolute error.
Accessor to the number of function calls.
Accessor to the object's name.
getId
()Accessor to the object's id.
Accessor to the underlying implementation.
Accessor to the maximum number of function calls.
getName
()Accessor to the object's name.
Accessor to the relative error.
Accessor to the residual error.
setAbsoluteError
(absoluteError)Accessor to the absolute error.
setMaximumCallsNumber
(maximumCallsNumber)Accessor to the maximum number of function calls.
setName
(name)Accessor to the object's name.
setRelativeError
(relativeError)Accessor to the relative error.
setResidualError
(residualError)Accessor to the residual error.
solve
(*args)Solve an equation.
Notes
This class enables to solve 1D non linear equations :
if
is a continuous function from
to
,
and if
is such that
, then
has at least a zero in the interval
. In particular, it is used in the root research of a
Directional Sampling simulation
.- __init__(*args)¶
- getAbsoluteError()¶
Accessor to the absolute error.
- Returns:
- absErrorfloat
The absolute error: distance between two successive iterates at the end point.
- getCallsNumber()¶
Accessor to the number of function calls.
- Returns:
- nEvalint
The number of function calls.
- getClassName()¶
Accessor to the object’s name.
- Returns:
- class_namestr
The object class name (object.__class__.__name__).
- getId()¶
Accessor to the object’s id.
- Returns:
- idint
Internal unique identifier.
- getImplementation()¶
Accessor to the underlying implementation.
- Returns:
- implImplementation
A copy of the underlying implementation object.
- getMaximumCallsNumber()¶
Accessor to the maximum number of function calls.
- Returns:
- maxEvalint
The maximum number of function calls.
- getName()¶
Accessor to the object’s name.
- Returns:
- namestr
The name of the object.
- getRelativeError()¶
Accessor to the relative error.
- Returns:
- relErrorfloat
The relative error: distance between the two last successive iterates with regards to the last iterate.
- getResidualError()¶
Accessor to the residual error.
- Returns:
- resErrorfloat
The residual errors: difference between the last iterate value and the expected value.
- setAbsoluteError(absoluteError)¶
Accessor to the absolute error.
- Parameters:
- absErrorfloat
The absolute error: distance between two successive iterates at the end point.
- setMaximumCallsNumber(maximumCallsNumber)¶
Accessor to the maximum number of function calls.
- Parameters:
- maxEvalint
The maximum number of function calls.
- setName(name)¶
Accessor to the object’s name.
- Parameters:
- namestr
The name of the object.
- setRelativeError(relativeError)¶
Accessor to the relative error.
- Parameters:
- relErrorfloat
The relative error: distance between the two last successive iterates with regards to the last iterate.
- setResidualError(residualError)¶
Accessor to the residual error.
- Parameters:
- resErrorfloat
The residual errors: difference between the last iterate value and the expected value.
- solve(*args)¶
Solve an equation.
- Parameters:
- function
Function
The function of the equation
to be solved in the interval
.
- valuefloat
The value to which the function must be equal.
- infPoint, supPointfloat
Lower and upper bounds of the variable
range.
- infValue, supValuefloat, optional
The values such that
, and
.
must be of opposite sign of
.
- startingPointsequence of float
Starting point for solving a system of (non linear) equations.
- bounds
Interval
Bounds for searching the solution of the system of equations.
- function
- Returns:
- resultfloat
The result of the root research.