Solution¶
Procedures¶
- sigmaepsilon.solid.fem.linsolve.solve_standard_form(K: coo_matrix, f: ndarray, *args, use_umfpack: bool = True, summary: bool = False, permc_spec: str = 'COLAMD', solver: Optional[str] = None, mtype: int = 11, assume_regular: bool = False, **kwargs)[source]¶
Solves the discrete equilibrium equations \(\mathbf{K} \mathbf{u} = \mathbf{f}\) for \(\mathbf{u}\).
- Parameters
K (scipy.sparse.spmatrix) – The stiffness matrix in coo format.
f (numpy.ndarray) – The vector of nodal loads.
use_umfpack (bool, Optional) – Only if solver is ‘scipy’. See the documentation
scipy.sparse.linalg.spsolve()for further meaning. Default is True.permc_spec (str, Optional) – Only if solver is ‘scipy’. See the documentation
scipy.sparse.linalg.spsolve()for further meaning.solver (str, Optional) – The solver to use. Currently supported options are ‘scipy’ and ‘pardiso’. If nothing is specified, we prefer ‘pardiso’ if it is around, otherwise the solver falls back to SciPy.
mtype (int, Optional) – Matrix type indicator for the pypardiso solver. The Default value is 11, which denassumes a real and nonsymmetric coefficient matrix.
assume_regular (bool, Optional) – If True, it is assumed that the input is according to the standard form, otherwise some preprocessing on the inputs is performed.
- Returns
numpy.ndarray – The solution as a numpy array. The returned array has the same shape as f.
dict, Optional – A summary including the most important characteristics of the solution process. Only if ‘summary’ is True.
- sigmaepsilon.solid.fem.dyn.Rayleigh_quotient(M: spmatrix, *, K: Optional[spmatrix] = None, u: Optional[ndarray] = None, f: Optional[ndarray] = None, **kw) ndarray[source]¶
Returns Rayleigh’s quotient
\begin{equation} \frac{\mathbf{v}^T \mathbf{K} \mathbf{v}}{\mathbf{v}^T \mathbf{M} \mathbf{v}}, \end{equation}for a prescribed action \(\mathbf{v}\).
- Parameters
M (scipy.linalg.sparse.spmatrix) – The mass matrix.
u (numpy.ndarray, Optional) – The vector of nodal displacements (1d or 2d).
K (scipy.linalg.sparse.spmatrix, Optional) – The stiffness matrix. It can be omitted, if ‘f’ is provided.
f (numpy.ndarray, Optional) – The vector of nodal forces (1d or 2d). It can be omitted, if ‘K’ is provided.
Notes
The Rayleigh quotient is
higher than, or equal to the square of the smallest natural circular frequency,
smaller than, or equal to the square of the highest natural circular frequency.
- Returns
An 1d array of floats.
- Return type
- sigmaepsilon.solid.fem.dyn.effective_modal_mass(M: Union[ndarray, spmatrix], action: ndarray, mode: ndarray) float[source]¶
Returns the effective modal mass for a specific mode.
Assumes that the modal shapes are normalized to the mass matrix.
- Parameters
M (numpy.ndarray) – 2d mass matrix as a NumPy or SciPy 2d float array.
action (Iterable) – 1d iterable, with a length matching the dof layout of the structure.
mode (numpy.ndarray) – 1d array representing a modal shape.
- Returns
The effective modal mass.
- Return type
- sigmaepsilon.solid.fem.dyn.effective_modal_masses(M: Union[ndarray, spmatrix], action: ndarray, modes: ndarray) ndarray[source]¶
Returns the effective modal mass for several modes.
Assumes that the modal shapes are normalized to the mass matrix.
- Parameters
M (numpy.ndarray) – Mass matrix as a NumPy or SciPy 2d float array.
action (numpy.ndarray) – 1d iterable, with a length matching the dof layout of the structure.
modes (numpy.ndarray) – A matrix, whose columns are eigenmodes of interest.
Notes
The sum of all effective masses equals the total mass of the structure.
- Returns
1d float array of effective modal masses
- Return type
- sigmaepsilon.solid.fem.dyn.estimate_smallest_natural_circular_frequency(*args, **kwargs) ndarray[source]¶
Returns a lower bound estimation of the smallest natural frequency using Rayleigh’s quotient. See
Rayleigh_quotient()for the input.Notes
This relies on the equivalence of elastic internal energy and kinetic energy of undamped conservative systems.
- Returns
An 1d array of floats.
- Return type
See also
- sigmaepsilon.solid.fem.dyn.natural_circular_frequencies(K: spmatrix, M: spmatrix, *, k: int = 10, return_vectors: bool = False, maxiter: int = 5000, normalize: bool = True, as_dense: bool = False, around: Optional[float] = None, nmode: str = 'M', which: str = 'SM', **kwargs) Tuple[ndarray][source]¶
Returns the natural circular frequencies \(\omega_{0i}\) and optionally the corresponding eigenvectors as (not trivial) solutions to the eigenproblem
\begin{equation} \left( \mathbf{K} - \omega^2 \mathbf{M} \right) \mathbf{v} = \mathbf{0}. \end{equation}- Parameters
K (scipy.linalg.sparse.spmatrix) – The stiffness matrix in sparse format.
M (scipy.linalg.sparse.spmatrix) – The mass matrix in sparse format.
k (int, Optional) – The number of solutions to return. Only if ‘as_dense’ is False. Default is 10.
return_vectors (bool, Optional) – To return eigenvectors or not. Default is False.
maxiter (int, Optional) – Maximum number of iterations, if solved using sparse matrices. Only if ‘as_dense’ is False. Default is 5000.
normalize (bool, Optional) – If True, the returned eigenvectors are normalized to the mass matrix. Only if ‘return_vectors’ is True. Default is True.
as_dense (bool, Optional) – If True, the stiffness and mass matrices are handled as dense arrays. In this case, if ‘return_vectors’ is True, all eigenvalues and vectors are returned, regardless of other parameters.
around (float, Optional) – A target (possibly an approximation) value around which eigenvalues are searched. Default is None.
which (str, ['LM' | 'SM' | 'LA' | 'SA' | 'BE' | 'LR' | 'SR') –
‘LI’ | ‘SI’], OptionalWhich k eigenvectors and eigenvalues to find:
’LM’ : largest magnitude
’SM’ : smallest magnitude
’LA’ : Largest (algebraic) eigenvalues.
’SA’ : Smallest (algebraic) eigenvalues.
’BE’ : Half (k/2) from each end of the spectrum.
’LR’ : largest real part
’SR’ : smallest real part
’LI’ : largest imaginary part
’SI’ : smallest imaginary part
Only if ‘as_dense’ is False. Default is ‘LM’.
**kwargs (dict, Optional) – Keyword arguments are forwarded to the appropriate routine of SciPy.
Note
Calculation is done using the relavant routines of Scipy, see its documentation for more control over the parameters.
See also
scipy.linalg.eigs(),scipy.sparse.linalg.eigsh()- Returns
numpy.ndarray – The natural circular frequencies.
numpy.ndarray – The eigenvectors, only if ‘return_vectors’ is True.