iode.Simulation.relax

property Simulation.relax: float

Relaxation parameter.

It modifies the algorithm’s behavior in the following way in the following way: the variable \(X\), calculated by the associated model equation, is not for subsequent iterations, but replaced by

\[X[k] = X^\prime * \lambda + X[k-1] * (1 - \lambda)\]

where:

  • \(X^\prime\) is the result of calculating the equation,

  • \(\lambda\) is the relaxation parameter,

  • \(X[k-1]\) is the result of the calculation at the previous iteration,

  • \(X[k]\) is the new value

If \(\lambda\) is 1, \(X[k]\) is the result of calculating the equation without modification. If \(\lambda\) is 0, \(X\) will never change.

It is recommended to set this parameter to a value between 0.5 and 1 when a model doesn’t converge or converges too slowly.

Default value is 1.0.

Parameters:
value: float

New relaxation parameter value. Its value must be in the range [0.1, 1.0].

Examples

>>> from iode import Simulation
>>> simu = Simulation()
>>> simu.relax
1.0
>>> simu.relax = 0.9
>>> simu.relax
0.9