Stabilized Newton-Raphson solver (structsolve.stabilized_newton_raphson)#
Stabilized Newton-Raphson solver for non-linear static analyses
Selected with Analysis.NL_method = 'stabilized_NR'. A load-controlled
Newton-Raphson solver that passes the load factors at which the plain
iterations fail, e.g. local folds and mode jumps of the postbuckling of
stiffened panels, with viscous stabilization and a correction to the
undamped equilibrium. The implementation is shared with the
Newton-Raphson solver, see newton_raphson.
The solver is used through Analysis.static() with
Analysis.NL_method = 'stabilized_NR', the viscous forces being scaled
by Analysis.stabilization_factor. The status of each accepted state is
in Analysis.stabilization_status and Analysis.damped_residuals.
- structsolve.stabilized_newton_raphson._solver_stabilized_NR(an, silent=False)#
Newton-Raphson solver with load control and viscous stabilization
Used by
Analysis.static()whenNL_method='stabilized_NR'. Runsnewton_raphson._solver_NR()withstabilized=True: the load factor is incremented as withNL_method='NR', and every increment is solved in up to three stages:the Newton-Raphson iterations of
newton_raphson._NR_iterations()from the predictor extrapolated from the previous converged increment;when they fail, the iterations on the equilibrium with viscous forces proportional to the change of the solution since the last converged state, see
newton_raphson._stabilized_iterations();when these converge, the Newton-Raphson iterations without viscous forces again, from the damped state.
A state from stage 1 is recorded as
'undamped'and one from stage 3 as'corrected'inan.stabilization_status; both satisfy the convergence criteria of the undamped equilibrium. When stage 3 fails, the damped state of stage 2 is accepted and recorded as'damped', with the relative residual of its undamped equilibrium inan.damped_residualsand a warning. When stage 2 fails, the load increment is multiplied byINC_CUT_FACTORand the increment starts again at stage 1. The load increment is multiplied byan.stabilization_inc_growth, limited byan.maxInc, after an'undamped'state reached with at mostan.stabilization_inc_growth_max_itercorrections, also after a cut, and is kept after the other states.The viscous forces are scaled by
an.stabilization_factor. Each stage stops afteran.stabilization_max_itercorrections or at a residual that is not finite; stages 1 and 2 also stop when their residual grows byan.stabilization_divergence_factor, and stage 3 when it grows byan.stabilization_correction_divergence_factor, never with its defaultNone, seenewton_raphson._check_divergence_stabilized(), instead of the checks ofNL_method='NR'(an.maxNumIter,an.too_slow_TOL,an.early_divergence). All the other options ofNL_method='NR'apply to the three stages: the convergence criteria, the full or modified Newton-Raphson method, the line search,an.linear_solver, the constraints and their values, the inertia,an.on_converged,an.stop_criterion,an.final_load_factorandan.restart_state, the latter only from apath_stateof'stabilized_NR'.- Parameters:
- an
Analysis Analysis object, the accepted load factors and solutions are appended to
an.incrementsandan.cs, and their status toan.stabilization_statusandan.damped_residuals.- silentbool, optional
A boolean to tell whether the log messages should be printed.
- an
- Raises:
- ValueError
When
an.stabilization_factoris not a positive finite number, when the otheran.stabilization_*options are not valid, seenewton_raphson._stabilization_control(), whenan.final_load_factorisNone, or for the invalid options ofnewton_raphson._solver_NR().
Notes
The equilibrium at the load factor \(\lambda_{n+1} = \lambda_n + \Delta\lambda\) is \(\boldsymbol{R}(\boldsymbol{c}) = \boldsymbol{F}_{int}(\boldsymbol{c}) - \lambda_{n+1} \boldsymbol{F}_{ext} = \boldsymbol{0}\). Where the equilibrium path has a limit point or a fold in the load factor, or where the solution jumps to another buckling pattern, there is no equilibrium near the last converged state \(\boldsymbol{c}_n\), and the Newton-Raphson iterations fail at every load increment beyond it, whereas the arc-length methods may turn back along the path instead of going past the jump.
The stabilization treats the load factor as a pseudo-time \(t\) and adds to the internal force vector the viscous forces of the damping matrix \(\mu \boldsymbol{D}\), discretized by the backward Euler method over the increment, \(\Delta t = \Delta\lambda\):
\[\boldsymbol{R}_v(\boldsymbol{c}) = \boldsymbol{F}_{int}(\boldsymbol{c}) + \frac{\mu}{\Delta\lambda} \boldsymbol{D} (\boldsymbol{c} - \boldsymbol{c}_n) - \lambda_{n+1} \boldsymbol{F}_{ext} = \boldsymbol{0}, \qquad \boldsymbol{D} = \mathrm{diag}(|K_{C0,11}|, \ldots, |K_{C0,NN}|)\]with \(\mu\) =
an.stabilization_factor, dimensionless, and \(\boldsymbol{K}_{C0}\) the linear stiffness matrixcalc_kC(), whose diagonal makes the viscous forces independent of the units of each degree of freedom, as the weights of Crisfield’s criterion, seeconvergence. The Jacobian of \(\boldsymbol{R}_v\) is \(\boldsymbol{K}_T + (\mu/\Delta\lambda) \boldsymbol{D}\): the diagonal term makes it regular where \(\boldsymbol{K}_T\) is singular or indefinite and resists a large change of the solution within one increment, such that the iterations converge to a nearby damped state instead of failing. A smaller \(\Delta\lambda\) increases the viscous coefficient \(\mu/\Delta\lambda\). The damped iterations start from \(\boldsymbol{c}_n\), or, withan.constraint_values, from the predictor of stage 1, which satisfies the constraints at \(\lambda_{n+1}\).The damped state does not satisfy \(\boldsymbol{R} = \boldsymbol{0}\): the viscous forces are the residual of its undamped equilibrium. Stage 3 removes them: the Newton-Raphson iterations of \(\boldsymbol{R}\) start from the damped state, which is closer to an equilibrium beyond the jump than the extrapolated predictor of stage 1. A corrected state is an equilibrium of \(\boldsymbol{R}\) to the tolerance of the convergence criteria, such that the viscous forces do not accumulate along the path. A damped-only state,
'damped'inan.stabilization_status, is not an equilibrium: its relative residual inan.damped_residualsmeasures how far it is from one, and stresses or displacements of such a state must not be read as those of an equilibrium.Near a mode jump the iterations of each stage may converge slowly, with a residual that does not decrease for several iterations. With \(r_j\) the residual norm of the convergence criterion at the iteration \(j\) of a stage, \(r_1\) that of its starting point, stages 1 and 2 therefore stop only after \(N\) =
an.stabilization_max_itercorrections, at a residual that is not finite, or at the iteration \(j\) where \(r_j > f r_1\), \(f\) =an.stabilization_divergence_factor, without the too-slow check ofNL_method='NR', which would stop iterations that converge and turn stage 1 into a stabilized increment. The divergence check stops stage 1 at the increment where the plain iterations would jump to an equilibrium far from \(\boldsymbol{c}_n\), which is then reached through the damped state. Stage 3 has, by default, no divergence check: from the damped state, where the tangent stiffness matrix is nearly singular, its first corrections may increase \(r_j\) by several orders of magnitude before it converges, and stopping it would accept a damped state, which is not an equilibrium. With \(f_c\) =an.stabilization_correction_divergence_factor, stage 3 also stops when \(r_j > f_c r_1\). The ratio \(r_j/r_1\) depends on the norm of the criterion: the same iterations may exceed \(f\) or \(f_c\) with the scaled norm ofconvergence='crisfield'and not with the Euclidean norm ofconvergence='relative', or the opposite.With \(\Delta\lambda_n\) the last increment and \(k\) the number of corrections of an
'undamped'increment, the next increment is\[\begin{split}\Delta\lambda_{n+1} = \begin{cases} \min(g \Delta\lambda_n, \Delta\lambda_{max}) & k \le k_g \\ \Delta\lambda_n & \text{otherwise} \end{cases}\end{split}\]with \(g\) =
an.stabilization_inc_growth, \(k_g\) =an.stabilization_inc_growth_max_iterand \(\Delta\lambda_{max}\) =an.maxInc, and \(\Delta\lambda_{n+1} = \Delta\lambda_n\) after a'corrected'or'damped'increment.The scheme does not guarantee:
that the equilibrium found after a jump is the one a dynamic process would reach: the viscous path is an artificial one, and another \(\mu\), \(\Delta\lambda\) or predictor may give another equilibrium;
that the accepted states are stable: their stability is not checked, unless
an.inertiarecords the inertia of the tangent stiffness matrix, seenewton_raphson._converged_state();that a state exists at every load factor: when the damped iterations fail, the increment is cut as with
NL_method='NR', and the analysis stops atan.minInc.
The dissipated energy of the viscous forces relative to the strain energy or to the external work is not computed: the callables give neither the strain energy nor the work along the path between the converged states.
The choices of this solver are the damping matrix from the diagonal of the linear stiffness matrix, the load factor as the pseudo-time, the start of the damped iterations from the last converged state and the correction of stage 3. The full and modified Newton-Raphson iterations of the three stages are those of [1] (Sections 1.2.2 and 1.2.3, pp. 8-13).
References
[1]Crisfield, M.A., Non-linear Finite Element Analysis of Solids and Structures, Volume 1: Essentials, John Wiley & Sons, Chichester, 1991.
Stages of an increment#
- structsolve.newton_raphson._stabilized_iterations(an, c, dc, total, viscous, fext, silent=False, lbd_dependent=False, q=None, w=None, K0_abs=None, proj=None, control=None, correction_control=None)#
Stabilized iterations of a step at which Newton-Raphson failed, followed by the correction to the undamped equilibrium
The equilibrium with the viscous forces
viscous*dcis solved by_NR_iterations()from the predictordc; from the damped solution, the undamped equilibrium is solved by_NR_iterations()without viscous forces. The state is accepted when the damped iterations converge: corrected when the undamped iterations also converge, damped-only otherwise, with a warning.- Parameters:
- an
Analysis Analysis object.
- carray-like
Solution at the last converged state.
- dcarray-like
Predictor of the solution increment of the damped iterations.
- totalfloat
Load factor of the step, dimensionless.
- viscousarray-like
Coefficients of the viscous forces, 1-D array of the size of
c, see_NR_iterations().- fextarray-like
External force vector for a unit load factor.
- silentbool, optional
A boolean to tell whether the log messages should be printed.
- lbd_dependent, q, w, K0_abs, projoptional
As in
_NR_iterations().- controltuple or None, optional
(max_iter, divergence_factor)of the damped iterations and, whencorrection_controlisNone, of the correction, see_check_divergence_stabilized();Noneuses_check_divergence().- correction_controltuple or None, optional
(max_iter, divergence_factor)of the correction only, see_stabilization_control();Noneusescontrol.
- an
- Returns:
- convergedbool
Whether the damped iterations converged, i.e. whether the state is accepted.
- dcarray-like
Solution increment of the accepted state: the corrected one, or the damped one when the correction failed.
- qarray-like or None
The last \(\boldsymbol{q}\) evaluated, see
_NR_iterations().- statusstr or None
'corrected'or'damped',Nonewhen the damped iterations failed.- damped_residualfloat or None
For a damped-only state, the relative residual of its undamped equilibrium, Crisfield’s \(\zeta\) or the relative residual of
an.convergence = 'relative', see_check_convergence();Noneotherwise.
Notes
With \(\boldsymbol{c}_n\) =
c, \(\lambda_{n+1}\) =totaland \(\boldsymbol{v}\) =viscous, the damped iterations solve\[\boldsymbol{F}_{int}(\boldsymbol{c}_n + \Delta \boldsymbol{c}) + \boldsymbol{V} \Delta \boldsymbol{c} - \lambda_{n+1} \boldsymbol{F}_{ext} = \boldsymbol{0}, \qquad \boldsymbol{V} = \mathrm{diag}(\boldsymbol{v})\]for \(\Delta \boldsymbol{c}_d\), and the correction solves \(\boldsymbol{F}_{int}(\boldsymbol{c}_n + \Delta \boldsymbol{c}) - \lambda_{n+1} \boldsymbol{F}_{ext} = \boldsymbol{0}\) from \(\Delta \boldsymbol{c} = \Delta \boldsymbol{c}_d\). At a damped solution the undamped residual is \(-\boldsymbol{V} \Delta \boldsymbol{c}_d\), to the tolerance of the damped iterations:
damped_residualis the relative size of the viscous forces, measured by the convergence criterion.Near a mode jump the tangent stiffness matrix at the damped state is nearly singular, and the first corrections may increase the residual by several orders of magnitude before the iterations converge to the equilibrium beyond the jump. The correction is therefore controlled by
correction_control, by default without a divergence check, see_stabilization_control(): stopping it accepts the damped state, which is not an equilibrium.
Iteration control and increment growth#
The options Analysis.stabilization_max_iter,
Analysis.stabilization_divergence_factor,
Analysis.stabilization_correction_divergence_factor,
Analysis.stabilization_inc_growth and
Analysis.stabilization_inc_growth_max_iter are validated by
newton_raphson._stabilization_control(), and each stage is stopped
by newton_raphson._check_divergence_stabilized().
- structsolve.newton_raphson._stabilization_control(an)#
The iteration control of the damped and correction stages and the increment growth of
NL_method='stabilized_NR', validated- Returns:
- controltuple
(an.stabilization_max_iter, an.stabilization_divergence_factor), see_check_divergence_stabilized(), the control of the plain and of the damped iterations.- growthtuple
(an.stabilization_inc_growth, an.stabilization_inc_growth_max_iter).- correction_controltuple
(an.stabilization_max_iter, f_c), the control of the correction to the undamped equilibrium, with \(f_c\) =an.stabilization_correction_divergence_factor, or \(f_c = \infty\) when it isNone, i.e. without a divergence check.
- Raises:
- ValueError
When
stabilization_max_iterorstabilization_inc_growth_max_iteris not a positive integer, whenstabilization_divergence_factororstabilization_inc_growthis not a finite number larger than or equal to 1, or whenstabilization_correction_divergence_factoris neitherNonenor such a number.
- structsolve.newton_raphson._check_divergence_stabilized(Rnorm, Rnorms, iteration, control, silent=False)#
Check if the iterations of a stage of
NL_method='stabilized_NR'must be stopped without convergenceUsed instead of
_check_divergence()by the three stages of an increment ofNL_method='stabilized_NR', see_solver_NR()and_stabilized_iterations(). The iterations are stopped when the residual is not finite, whenmax_itercorrections were performed, or when the residual norm is larger thandivergence_factortimes the residual norm of the first iteration, at any iteration; there is no too-slow check.- Parameters:
- Rnormfloat
Norm of the residual at the current iteration, the norm of the convergence criterion, see
_check_convergence().- Rnormslist
Norms of the residual at the previous iterations of the stage, the current norm is appended to it.
- iterationint
Current iteration, starting at 1.
- controltuple
(max_iter, divergence_factor),an.stabilization_max_iterandan.stabilization_divergence_factor, or, for the correction to the undamped equilibrium,an.stabilization_correction_divergence_factor, \(\infty\) when it isNone, see_stabilization_control().- silentbool, optional
A boolean to tell whether the log messages should be printed.
- Returns:
- stopbool
Whether the iterations must be stopped.
Notes
With \(r_i\) the residual norm at the iteration \(i\) of the stage, \(r_1\) being the residual of its starting point, \(N\) =
max_iterand \(f\) =divergence_factor, the iterations are stopped at the iteration \(j\) when \(r_j\) is not finite, when \(j > N\), or when \(r_j > f r_1\). Unlike_check_divergence(), the divergence check is not delayed and no iteration is stopped for a residual that stagnates, which happens over several iterations before the convergence near a mode jump.