Adjusting parameters in the NewtonRaphson method
Adjusting parameters
NewtonRaphson parameters and strategies are set automatically to ensure robustness and fast nonlinear solving. It is nevertheless possible for the user to adjust these parameters, using the Nonlinear system solvers tab of the Solving process options box.
Adjusting of NewtonRaphson method
The user can adjust the following NewtonRaphson parameters: Type of accuracy threshold: three options are available, namely:
 All variables convergence: all variables of the system must satisfy the required precision;
 Global convergence: the variable exhibiting the hardest convergence must satisfy the required precision;
 Automatic.
The Automatic option corresponds to All variables convergence in all cases, with a few remarkable exceptions, which are listed below: projects containing hysteretical materials (in 2D and 3D);
 when the optimal method with a stabilization stage relaxation method is used;
 in the case of 2D initialization for Skew.
For all these exceptions, the Automatic option corresponds to Global convergence instead, since this approach leads to better performance and improved robustness.
 The threshold: relative epsilon value below which NewtonRaphson nonlinear solver stops. Depending on the activation of looseness and/or strengthening, this threshold is fixed or is the starting point of the adaptive criteria strategy. Default value is 10e^{4}.
 Maximum number of NewtonRaphson iterations: the default value is 100.
 Adaptive criteria strategy relies on hard or easy convergence detection.
 Looseness of the threshold: this adaptive criteria strategy is meant to ease hard
convergence. The adaptation is based on the residual decrease between two
consecutive NewtonRaphson iterations. If the decrease between these two residuals
is less than a percentage P (default is 10%), we consider a hard convergence
situation (Red region on Figure
1). If we have a hard convergence situation, the threshold is multiplied
by a factor F (default is 1.78) to ease the convergence.
Percentage P and factor F can be modified in advanced mode:
This strategy is activated by default, except: for projects containing hysteretical materials (in 2D and 3D);
 when the optimal method with a stabilization stage relaxation method is used;
 in the case of 2D initialization for Skew;
 in 2D projects containing materials with the magnetomechanical property B(Stress).
 Strengthening of the threshold : this adaptive criteria strategy is meant to
harden easy convergence. The adaptation is based on the residual decrease between
two consecutive NewtonRaphson iterations.If the decrease between these two
residuals is more than a percentage P (default is 99%), we consider a too easy
convergence situation (Yellow region on Figure 1). If we have too easy convergence situation, the
threshold is divided by a factor F (default is 3.16) to harden the
convergence.
Percentage P and factor F can be modified in advanced mode:
This strategy is activated by default, except: for projects containing hysteretical materials (in 2D and 3D);
 when the optimal method with a stabilization stage relaxation method is used;
 in the case of 2D initialization for Skew;
 in 2D projects containing materials with the magnetomechanical property B(Stress).
Underrelaxation method (3D)
There are five methods for defining the relaxation coefficient a of the NewtonRaphson method:
 the stairs method, where the coefficient is determined at each NewtonRaphson iteration, according to a simple law that depends on the obtained accuracy by the NewtonRaphson algorithm,
 the fixed method, where the user inserts the coefficient value which is thus constant throughout the solving process,
 the optimal method, where the coefficient is determined at each NewtonRaphson iteration by minimizing the residual of the nonlinear system to be solved,
 the automatic method, where the program automatically determines, depending on the formulation, which method is used, the "stairs" or the "optimal" one.
 The maximal factor method, which computes at each NewtonRaphson iteration the largest coefficient such that the residual of the nonlinear system to be solved decreases.
The automatic method is the method chosen by default. These four methods are detailed in the following paragraph.
Stairs method
The relaxation coefficient is determined at each NewtonRaphson iteration, function of the value of the precision ε^{i1} obtained at the previous iteration, following the variation law given below:

at the first iteration:
α = 0,5
 at the next iterations:
 if ε^{i1} ∈ [0,1 ; +∞[ : α = 0,5
 if ε^{i1} ∈ [0,01 ; 0,1[ : α = 0,75
 if ε^{i1} ∈ [0 ; 0,01[ : α = 1
Fixed method
The value of the relaxation coefficient is inserted by the user in the interval ]0 ; 1]. The value of this coefficient is thus constant throughout the solving process.
Optimal method
The relaxation coefficient is determined at each iteration. The principle of the method consists of computing this coefficient so that the following objective function is minimum:
${W}^{i}=\sum _{j=1}^{n}{\left({R}_{j}^{i}\right)}^{2}$where ${R}_{j}^{i}$ is the jth component of the residual R(X^{i}) at the ith current NewtonRaphson iteration (R(X^{i}) is a vector with n elements). n is the number of unknowns of the system.
The search of the objective function minimum is carried out using an iterative method, due to the fact that W cannot be explicitly expressed function of α. The search is performed by computing the values of W^{i} for the values of
α = α_{k} = 1/2^{k1} (α = 1 then 1/2, 1/4, 1/8...), and it is stopped when W^{i}_{k+1} at the iteration k+1 is greater than W^{i}_{k} at the previous iteration k. Indeed, during the iterations, α = α_{k} = 1/2^{k1} decreases and W^{i}_{k} decreases up to a certain iteration and then it increases.
Automatic method
Flux 3D automatically determines based on the formulations used for the regions, which is the best relaxation method.
Flux 3D automatically chooses the optimal method, except for the regions that use a surface impedance formulation in magnetic scalar potential (reduced or total). In that case, the stairs method will be used.
In Flux 2D, for projects containing materials with the magnetomechanical property B(Stress), the optimal method is selected by the automatic method.
Maximal factor method
The relaxation coefficient (α) is computed at each NewtonRaphson iteration. This method consists in searching the largest coefficient satisfying a decrease of the residual of the nonlinear system. To do that, the residual is computed with different values of α, by first trying to increase this coefficient (maximum to 1) before decrease it only if the residual of the nonlinear system did not decrease with respect to the previous NewtonRaphson iteration.
More in details, the strategy is the following: at the i^{th} NewtonRaphson iteration, the algorithm starts with the relaxation coefficient α of the previous NewtonRaphson iteration (α=1 at the first iteration). Then it first increases that coefficient (α = min(αφ,1), with φ the golden ratio) and computes the new residual of the nonlinear system.
 If that residual is less than the residual of the previous NewtonRaphson iteration, the algorithm continues to increase that coefficient with the same rule, until it reaches α = 1 or obtains a residual greater than the one of the previous NewtonRaphson iteration. It will then keep the last α (the largest) which decreases the residual.
 If this residual is greater than the residual of the previous NewtonRaphson iteration, the algorithm decreases that coefficient (α = max(α/φ,β), with β the minimum relaxation coefficient, depending on the project and defined by Flux). If the residual becomes less than the one of the previous NewtonRaphson iteration then the algorithm keeps that coefficient, else it continues to decrease the coefficient, following the same rule.