Static analyses (structsolve.analysis)#
- class structsolve.Analysis(calc_fext=None, calc_fint=None, calc_kC=None, calc_kG=None)#
Class that embodies all data required for linear/non-linear analysis
The structural model is defined by the callables passed to the constructor, which return the force vectors and stiffness matrices. The static analysis, linear or non-linear, is run with
static(), whose solution is stored in the attributesincrementsandcs.For non-linear analyses, the internal force vector \(\{F_{int}(c)\}\) must be in equilibrium with the external force vector scaled by the load factor \(\lambda\):
\[\{R\} = \lambda \{F_{ext}\} - \{F_{int}(c)\} = \{0\}\]and the tangent stiffness matrix \([K_T] = [K_C] + [K_G]\), given by the callables
calc_kCandcalc_kG, should be the exact derivative of \(\{F_{int}\}\) with respect to \(\{c\}\), such that the Newton-Raphson iterations converge quadratically.The analysis parameters are attributes of this class, described in the following tables together with their default values:
Non-Linear Algorithm
Description
NL_methodstr,'NR'(default) for the Newton-Raphson method, seenewton_raphson._solver_NR(), or'arc_length_riks'and'arc_length_crisfield'for the arc-length methods, seearc_length._solver_arc_length()line_searchbool, activates a safeguarding line-search, for the Newton-Raphson method only. The full step is tried first and only reduced when it fails a sufficient-decrease test on the residual norm. Default isFalsemax_iter_line_searchint, maximum number of iterations of the line-search. Default is20modified_NRbool, activates the modified Newton-Raphson method, where the tangent stiffness matrix is not updated at every iteration. Default isFalse, i.e. full Newton-Raphsoncompute_every_nint, ifmodified_NR=True, the tangent stiffness matrix is updated at every \(n\) iterations. Default is6kT_initial_statebool, ifmodified_NR=True, tells if the tangent stiffness matrix should be calculated already at the first iteration of the analysis, which is required for example when initial imperfections take place. Otherwise the linear constitutive stiffness matrix is used. Default isTrueIncrementation
Description
initialIncinitial load increment. In the arc-length methods it defines the initial arc-length increment, corresponding to a load factor increment of
initialIncalong the initial tangent. Default is0.1minIncminimum increment; the analysis stops when the load increment (Newton-Raphson) or the arc-length increment (arc-length methods) becomes smaller than
minInc. Default is1.e-4maxIncmaximum load increment, or maximum arc-length increment for the arc-length methods. Default is
1.maxArcLengthmaximum cumulative arc length covered by the arc-length methods. The arc length is dimensionless, with displacements scaled by the linear solution for a load factor of 1, such that in the linear regime an arc length of about
sqrt(2)corresponds to a load factor increment of 1. Default is18Convergence Criteria
Description
relTOLthe convergence is achieved when the norm of the residual force vector is smaller than
relTOLtimes the largest norm between the external and internal force vectors. Not used ifNone. Default is1.e-6absTOLthe convergence is also achieved when the maximum absolute residual force is smaller than this value, which depends on the units of the model. Not used if
None. Default isNonemaxNumItermaximum number of iterations (corrections) of a step; if achieved the increment is reduced. Default is
30too_slow_TOLa step is considered too slow when the smallest residual norm is not reduced by this fraction over the last iterations; the increment is then reduced. Default is
0.005- Parameters:
- calc_fextcallable, optional
calc_fext(inc=1., silent=False), must return a 1-D array with the external force vector. Required for linear and non-linear static analyses. The non-linear solvers call it withinc=1.and scale the returned vector by the load factor. It may declare the optional keyword argumentscandlbd, see the notes below.- calc_fintcallable, optional
calc_fint(c, silent=False), must return a 1-D array with the internal force vector for the solution vectorc. Required for non-linear analyses.- calc_kCcallable, optional
calc_kC(c=None, NLgeom=False, silent=False), must return a sparse matrix with the constitutive stiffness matrix. Withc=NoneandNLgeom=Falseit must return the linear stiffness matrix, and withNLgeom=Truethe constitutive part of the tangent stiffness matrix atc. Required for linear and non-linear static analyses.- calc_kGcallable, optional
calc_kG(c=None, NLgeom=False, silent=False), must return a sparse matrix with the geometric stiffness matrix atc. It is called withNLgeom=True. Required for non-linear analyses.
- Attributes:
Notes
Configuration-dependent loads, e.g. follower pressures, are supported through optional keyword arguments, passed only to the callables that declare them explicitly, see
callbacks:calc_fint(c, inc=lbd),calc_kC(c, NLgeom=True, inc=lbd)andcalc_kG(c, NLgeom=True, inc=lbd)receive the current load factor, such thatcalc_fintmay contain the configuration-dependent part of the load, scaled byinc, andcalc_kC + calc_kGits derivative.calc_fext(inc=1., c=c)must return the load vector of the configurationcfor a unit load factor, the derivative of the residual with respect to the load factor, used by the arc-length solvers.calc_fext(inc=1., c=c, lbd=lbd)also receives the current load factor when it declareslbd, for a derivative \(\partial R/\partial \lambda\) that depends on the load factor, e.g. prescribed displacements imposed exactly as linear constraints, where the reference vectorcalc_fext(inc=1.)may be null. The solvers then use \(\partial R/\partial \lambda\) for the displacement scale of the arc-length methods, for the predictor of the first Newton-Raphson increment and as a reference of the relative convergence criterion, seecallbacks. The linear static analysis never passeslbd.
The tangent stiffness matrix may then be unsymmetric, which the solvers support, since they use LU factorizations.
- static(NLgeom=False, silent=False)#
General solver for static analyses
The linear analysis solves \([K_C]\{c\} = \{F_{ext}\}\) using
solve(). When the load depends on the configuration, i.e.calc_fextdeclares the keyword argumentc, seecallbacks, the structure is still geometrically linear but the load is evaluated in the current configuration, \([K_C]\{c\} = \{F_{ext}(c)\}\), which is solved by the load correction iterations\[\{c_{k+1}\} = \{c_k\} + [K_C]^{-1}(\{F_{ext}(c_k)\} - [K_C]\{c_k\})\]starting from the solution of the reference load, until the relative criterion
relTOLis satisfied, seenewton_raphson._check_convergence(), ormaxNumIteriterations are done. For a follower load whose force vector is affine in \(c\), \(\{F(c)\} = \{F_0\} - [K_f]\{c\}\), this is the solution of \(([K_C] + [K_f])\{c\} = \{F_0\}\), with the convergence rate of the spectral radius of \([K_C]^{-1}[K_f]\), i.e. of the ratio of the load to the lowest critical load of the linearized problem; beyond it the iterations diverge. The non-linear analysis uses the solver selected by theNL_methodattribute.- Parameters:
- NLgeombool, optional
Flag to indicate whether a linear or a non-linear analysis is to be performed.
- silentbool, optional
A boolean to tell whether the log messages should be printed.
- Returns:
- incrementslist
Load factors of the converged increments. A linear analysis returns
[1.]. Non-linear analyses finish at a load factor of exactly1.unless they are stopped earlier, see the documentation of each solver.- cslist
Solution vectors of the converged increments.