Brent¶
(Source code, png, hires.png, pdf)
 
- 
class Brent(*args)¶
- Brent algorithm solver for 1D non linear equations. - Available constructor:
- Brent() - Brent(absError, relError, resError, maximumFunctionEvaluation) 
 - Parameters
- absErrorpositive float
- Absolute error: distance between two successive iterates at the end point. Default is - . 
- relErrorpositive float
- Relative error: distance between the two last successive iterates with regards to the last iterate. Default is - . 
- resErrorpositive float
- Residual error: difference between the last iterate value and the expected value. Default is - . 
- maximumFunctionEvaluationint
- The maximum number of evaluations of the function. Default is - . 
 
 - Notes - The Brent solver is a mix of Bisection, Secant and inverse quadratic interpolation. - Methods - getAbsoluteError(self)- Accessor to the absolute error. - getClassName(self)- Accessor to the object’s name. - getId(self)- Accessor to the object’s id. - Accessor to the maximum number of evaluations of the function. - getName(self)- Accessor to the object’s name. - getRelativeError(self)- Accessor to the relative error. - getResidualError(self)- Accessor to the residual error. - getShadowedId(self)- Accessor to the object’s shadowed id. - Accessor to the number of evaluations of the function. - getVisibility(self)- Accessor to the object’s visibility state. - hasName(self)- Test if the object is named. - hasVisibleName(self)- Test if the object has a distinguishable name. - setAbsoluteError(self, absoluteError)- Accessor to the absolute error. - setMaximumFunctionEvaluation(self, …)- Accessor to the maximum number of evaluations of the function. - setName(self, name)- Accessor to the object’s name. - setRelativeError(self, relativeError)- Accessor to the relative error. - setResidualError(self, residualError)- Accessor to the residual error. - setShadowedId(self, id)- Accessor to the object’s shadowed id. - setVisibility(self, visible)- Accessor to the object’s visibility state. - solve(self, \*args)- Solve an equation. - 
__init__(self, \*args)¶
- Initialize self. See help(type(self)) for accurate signature. 
 - 
getAbsoluteError(self)¶
- Accessor to the absolute error. - Returns
- absErrorfloat
- The absolute error: distance between two successive iterates at the end point. 
 
 
 - 
getClassName(self)¶
- Accessor to the object’s name. - Returns
- class_namestr
- The object class name (object.__class__.__name__). 
 
 
 - 
getId(self)¶
- Accessor to the object’s id. - Returns
- idint
- Internal unique identifier. 
 
 
 - 
getMaximumFunctionEvaluation(self)¶
- Accessor to the maximum number of evaluations of the function. - Returns
- maxEvalint
- The maximum number of evaluations of the function. 
 
 
 - 
getName(self)¶
- Accessor to the object’s name. - Returns
- namestr
- The name of the object. 
 
 
 - 
getRelativeError(self)¶
- Accessor to the relative error. - Returns
- relErrorfloat
- The relative error: distance between the two last successive iterates with regards to the last iterate. 
 
 
 - 
getResidualError(self)¶
- Accessor to the residual error. - Returns
- resErrorfloat
- The residual errors: difference between the last iterate value and the expected value. 
 
 
 - 
getShadowedId(self)¶
- Accessor to the object’s shadowed id. - Returns
- idint
- Internal unique identifier. 
 
 
 - 
getUsedFunctionEvaluation(self)¶
- Accessor to the number of evaluations of the function. - Returns
- nEvalint
- The number of evaluations of the function. 
 
 
 - 
getVisibility(self)¶
- Accessor to the object’s visibility state. - Returns
- visiblebool
- Visibility flag. 
 
 
 - 
hasName(self)¶
- Test if the object is named. - Returns
- hasNamebool
- True if the name is not empty. 
 
 
 - 
hasVisibleName(self)¶
- Test if the object has a distinguishable name. - Returns
- hasVisibleNamebool
- True if the name is not empty and not the default one. 
 
 
 - 
setAbsoluteError(self, absoluteError)¶
- Accessor to the absolute error. - Parameters
- absErrorfloat
- The absolute error: distance between two successive iterates at the end point. 
 
 
 - 
setMaximumFunctionEvaluation(self, maximumFunctionEvaluation)¶
- Accessor to the maximum number of evaluations of the function. - Parameters
- maxEvalint
- The maximum number of evaluations of the function. 
 
 
 - 
setName(self, name)¶
- Accessor to the object’s name. - Parameters
- namestr
- The name of the object. 
 
 
 - 
setRelativeError(self, 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(self, residualError)¶
- Accessor to the residual error. - Parameters
- resErrorfloat
- The residual errors: difference between the last iterate value and the expected value. 
 
 
 - 
setShadowedId(self, id)¶
- Accessor to the object’s shadowed id. - Parameters
- idint
- Internal unique identifier. 
 
 
 - 
setVisibility(self, visible)¶
- Accessor to the object’s visibility state. - Parameters
- visiblebool
- Visibility flag. 
 
 
 - 
solve(self, \*args)¶
- Solve an equation. - Available usages: - solve(function, value, infPoint, supPoint) - solve(function, value, infPoint, supPoint, infValue, supValue) - Parameters
- functionFunction
- The function of the equation - to be solved in the interval - . 
- valuefloat
- The value of which the function must be equal. 
- infPointfloat
- Lower bound of the interval definition of the variable - . 
- supPointfloat
- Upper bound of the interval definition of the variable - . 
- infValuefloat
- The value such that - . It must be of opposite sign of - . 
- supValuefloat
- The value such that - . It must be of opposite sign of - . 
 
- function
- Returns
- resultfloat
- The result of the root research. 
 
 - Notes - If the function - is continuous, the Brent solver will converge towards a root of the equation - in - . If not, it will converge towards either a root or a discontinuity point of - on - . Bisection guarantees a convergence. 
 
 OpenTURNS
      OpenTURNS