46 $this->rTol = $oP->rPrec;
47 $this->rDx = $oP->rPrec / 10;
57 abstract protected function CalcFn($rX);
75 return (abs($rFn) < $this->rTol);
86 if(self::DBG) spip_log(
'Newton '.$this->iCpt.
' Relax='.$this->rRelax.
'- f('.$rX.
') = '.$rFn,
'hydraulic.'._LOG_DEBUG);
87 if($this->
FuzzyEqual($rFn) || $this->iCpt >= $this->iCptMax) {
94 if($rFn < 0 xor $this->rFnPrec < 0) {
96 if($this->rRelax > 1) {
100 elseif($this->nOscil>2) {
103 $this->rRelax *= 0.5;
106 $this->rFnPrec = $rFn;
107 $Delta = $rFn / $rDer;
108 while(abs($Delta*$this->rRelax) < $this->rTol && $rFn > 10*$this->rTol && $this->rRelax < 2^8) {
113 while($rX - $Delta*$rRelax <= 0 && $rRelax > 1E-4) {
118 $this->rDelta = $Delta;
120 return $this->
Newton($rX);
133 if($this->iCpt >= $this->iCptMax) {
CalcFn($rX)
Calcul de la fonction f(x) dont on cherche le zéro.
CalcDer($x)
Calcul de la dérivée f'(x) (peut être redéfini pour calcul analytique)
FuzzyEqual($rFn)
Test d'égalité à une tolérance près.
HasConverged()
Pour savoir si le Newton a convergé
__construct(cParam $oP)
Constructeur de la classe.
$rFnPrec
Coefficient de relaxation.
$iCptMax
n° itération Newton
$oLog
Nombre de changement de signe de Delta.
Newton($rX)
Fonction récursive de calcul de la suite du Newton.
Gestion des Paramètres du canal (hors section)
$iOscil
Mémorisation du Fn précédent pour détecter le changement de signe.