pub struct SolverConfig {
pub prev_value_variation: f64,
pub epsilon: f64,
pub max_ulps: u32,
pub maxiter: usize,
pub finite_difference_stepwidth: f64,
pub dampening: f64,
}
Expand description
Solver parameters used in the NetworkAnalysis::solve
function.
The default values given for each field are used in the implementation of the Default
trait.
Fields§
§prev_value_variation: f64
This value is used to create a “zeroth” iteration value which is necessary to start the first iteration. This is a heuristic value which can be varied if the solver does not converge. Default is 0.9.
epsilon: f64
The Newton-Raphson algorithmus used in the implementations of NetworkAnalysis
uses the ulps_eq
from the approx crate in order
to determine whether the root has been found with sufficient precision (i.e., f(x_0) == 0
is approximately fulfilled). ulps_eq
uses both an absolute
difference check (using the epsilon
field) and an ULPs (using max_ulps
field) comparison. For the former check, is used.
Default is the square root of the machine precision (std::f64::EPSILON.sqrt()
).
max_ulps: u32
See epsilon
. Default is 4.
maxiter: usize
Maximum number of iterations of the underlying Newton-Raphson solver. When maxiter
is exceeded, the solver terminates with an error. Default is 200.
finite_difference_stepwidth: f64
If no custom Jacobian function is given, the Jacobian is calculated as a finite difference approximation (see [1])
This field finite_difference_stepwidth
corresponds to the stepwidth h
.
Default is the square root of the machine precision (std::f64::EPSILON.sqrt()
).
- Pauletti, Ruy & Almeida Neto, Edgard: A finite-difference approximation to Newton´s Method Jacobian Matrices. IABSE-IASS Symposium London 2011).
dampening: f64
As described in [2], the dampening factor tau can be used to increase the convergence probability at the cost of higher iteration time. Default is 1.0 (no dampening).
- Okawa, Hirotada et al.: The W4 method: A new multi-dimensional root-finding scheme for nonlinear systems of equations. Applied Numerical Mathematics 183 (2023) 157-172.
Trait Implementations§
Source§impl Clone for SolverConfig
impl Clone for SolverConfig
Source§fn clone(&self) -> SolverConfig
fn clone(&self) -> SolverConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SolverConfig
impl Debug for SolverConfig
Source§impl Default for SolverConfig
impl Default for SolverConfig
Source§fn default() -> Self
fn default() -> Self
See the docstring of SolverConfig
for the default parameters values.
Auto Trait Implementations§
impl Freeze for SolverConfig
impl RefUnwindSafe for SolverConfig
impl Send for SolverConfig
impl Sync for SolverConfig
impl Unpin for SolverConfig
impl UnwindSafe for SolverConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.