tmdsimpy.VibrationSystem¶
- class tmdsimpy.VibrationSystem(M, K, C=None, ab=None)¶
Bases:
objectA vibration system model with several useful residual functions. The system has N displacement degrees of Freedom.
- Parameters:
- M(N,N) numpy.ndarray
Mass Matrix
- K(N,N) numpy.ndarray
Stiffness Matrix, n x n
- C(N,N) numpy.ndarray or None, optional
Damping Matrix. If ab is provided, that will be used instead to construct a damping matrix. If both are None, then a zero damping matrix will be used. Default is None.
- ablist of length 2 or None, optional
Mass and Stiffness Proportional Damping Coefficients. If provided, used to recalculate stiffness matrix as C = ab[0]*self.M + ab[1]*self.K. The default is None.
See also
VibrationSystem.set_new_CSets the damping matrix to a new value for an existing object.
Notes
A number of methods are provided for adding and modifying the state of nonlinear forces. Other methods are provided to give residual evaluations for a range of nonlinear vibration methods.
- __init__(M, K, C=None, ab=None)¶
Methods
__init__(M, K[, C, ab])add_nl_force(nlforce)Add a nonlinear force to the model.
epmc_res(Uwxa, Fl, h[, Nt, aft_tol, calc_grad])Residual for Extended Periodic Motion Concept (EPMC).
hbm_amp_control_res(UFw, Fl, h, recov, amp, ...)Residual for harmonic balance method (HBM) with amplitude control.
hbm_amp_phase_control_dA_res(UFcFsA, Fl, h, ...)Residual for harmonic balance method (HBM) with amplitude and phase control for continuation with respect to amplitude.
hbm_amp_phase_control_res(UFcFsw, Fl, h, ...)Residual for harmonic balance method (HBM) with amplitude and phase control.
hbm_base_res(Uw, Ub, base_flag, h[, Nt, aft_tol])Residual for Harmonic Balance Method (HBM) with applied base excitation.
hbm_res(Uw, Fl, h[, Nt, aft_tol, calc_grad])Residual for the basic Harmonic Balance Method (HBM).
hbm_res_dFl(UF, w, Fl, h[, Nt, aft_tol, ...])Residual for Harmonic Balance Method (HBM) for continuation with respect to force scaling.
Initialize all hysteretic forces to have initial zero force states.
linear_frf(w, Fl, solver[, neigs, Flsin])Calculates linear frequency response function (FRF) of system.
linear_frf_base(w, Ub, base_flag, solver[, ...])Calculates linear frequency response function (FRF) of system with base excitation.
Reset the friction coefficient to the real value for analysis.
Set an initial position for friction model slides to be used during frequency domain analysis.
set_new_C([C, ab])Set the damping matrix to a new value after initialization.
Set friction coefficients to a prestress value for analysis.
shooting_res(Uw, Fl[, Nt, return_aux])Residual for shooting calculations
static_res(U, Fstatic)Residual function for static analysis.
total_aft(U, w, h[, Nt, aft_tol, calc_grad])Apply Alternating Frequency Time (AFT) Method to calculate all nonlinear harmonic forces.
Update internal nonlinear force history variables to reflect the current state.
vprnm_amp_phase_res(UFcFswA, Fl, h, rhi, ...)Residual for the Variable Phase Resonance Nonlinear Modes (VPRNM) with extra constraints.
vprnm_res(UwF, h, rhi, Fl[, Nt, aft_tol, ...])Residual for the basic Variable Phase Resonance Nonlinear Modes (VPRNM).
vprnm_single_eqn(U, w, h, rhi[, Nt, ...])Single residual equation evaluation for Variable Phase Resonance Nonlinear Modes (VPRNM).
- add_nl_force(nlforce)¶
Add a nonlinear force to the model.
- Parameters:
- nlforcetmdsimpy.nlforces.NonlinearForce or similar
Nonlinear force to be added to model.
Notes
The provided nonlinear force is appendended to the end of self.nonlinear_forces.
- epmc_res(Uwxa, Fl, h, Nt=128, aft_tol=1e-07, calc_grad=True)¶
Residual for Extended Periodic Motion Concept (EPMC).
- Parameters:
- Uwxa(N*Nhc+3,) numpy.ndarray
Global harmonic degrees of freedom, all DOFs for each harmonic component and then the next harmonic component in h. These are followed by the modal frequency in rad/s (first harmonic), the mass proportional self excitation coefficient, and the log10(modal amplitude). Harmonic DOFs are the mass normalized mode shape.
- Fl(N*Nhc,) numpy.ndarray
First N entries are the applied static forces if harmonic 0 is included in h. All other entries define a phase constraint to make the solution unique.
- h1D np.array, sorted
List of included harmonics, sorted and without repeats. Harmonics should be positive integers or zero.
- Ntint, power of 2, optional
Number of time steps for AFT. The default is 128.
- aft_tolfloat, optional
Tolerance for AFT. The default is 1e-7.
- calc_gradbool
Flag where True indicates that the gradients should be calculated and returned. If False, then returns only (R,) as a tuple. False should only be passed if all nonlinear forces have AFT methods that accept the calc_grad keyword. If True, the argument is not passed to nonlinear forces. The default is True.
- Returns:
- R(N*Nhc,) numpy.ndarray
Evaluated residual for EPMC analysis.
- dRdUwx(N*Nhc,N*Nhc) numpy.ndarray
Derivative of R with respect to Uwx = Uwxa[:-1].
- dRda(N*Nhc,) numpy.ndarray
Derivative of R with respect to a = Uwxa[-1] (log amplitude).
Notes
EPMC was proposed by [1].
The number of harmonic components is Nhc = tmdsimpy.utils.harmonic.Nhc(h)
Mass normalization constraint for amplitude is applied to harmonic 1 here. If you need subharmonic components, then some restructuring is likely needed.
References
[1]Krack, M. 2015. “Nonlinear Modal Analysis of Nonconservative Systems: Extension of the Periodic Motion Concept.” Computers & Structures 154:59–71. https://doi.org/10.1016/j.compstruc.2015.03.008.
- hbm_amp_control_res(UFw, Fl, h, recov, amp, order, Nt=128, aft_tol=1e-07, calc_grad=True)¶
Residual for harmonic balance method (HBM) with amplitude control.
Control is applied exclusively to the 1st harmonic.
- Parameters:
- UFw(N*Nhc+2,) numpy.ndarray
Global harmonic degrees of freedom, all DOFs for each harmonic component and then the next harmonic component in h. These are followed by the force scaling for all harmonics except the zeroth harmonic and the frequency in rad/s of first harmonic.
- Fl(N*Nhc,) numpy.ndarray
Applied external forcing harmonic coefficients in the same ordering as displacements in UFw. Static (zeroth harmonic) forces are not scaled. Other harmonics are scaled in this method by UFw[-2].
- h1D np.array, sorted
List of included harmonics, sorted and without repeats. Harmonics should be positive integers or zero.
- recov(N,) numpy.ndarray
Recovery matrix to extract the DOF that has amplitude and phase control.
- ampfloat
Amplitude that the recovered DOF is controlled to (defined by recov and order).
- orderint, positive or zero
Exponent on frequency to multiply the controlled displacement by. This allows for control of 0=displacement, 1=velocity, or 2=acceleration. Control does not consider sign changes due to derivatives when controlling order != 0.
- Ntint, power of 2, optional
Number of time steps for AFT. The default is 128.
- aft_tolfloat, optional
Tolerance for AFT. The default is 1e-7.
- calc_gradbool
Flag where True indicates that the gradients should be calculated and returned. If False, then returns only (R,) as a tuple. False should only be passed if all nonlinear forces have AFT methods that accept the calc_grad keyword. If True, the argument is not passed to nonlinear forces. The default is True.
- Returns:
- R(N*Nhc+1,) numpy.ndarray
Evaluated residual for HBM analysis with amplitude control.
- dRdUF(N*Nhc+1,N*Nhc+1) numpy.ndarray
Derivative of R with respect to UF = UFw[:-1].
- dRdw(N*Nhc+1,) numpy.ndarray
Derivative of R with respect to w = UFw[-1].
See also
hbm_resHarmonic balance residual for constant force input to the system. See documentation of this function for a full list of HBM variants.
tmdsimpy.utils.harmonic.predict_harmonic_solutionFunction for generating initial guesses to HBM type problems.
Notes
The number of harmonic components is Nhc = tmdsimpy.utils.harmonic.Nhc(h)
- hbm_amp_phase_control_dA_res(UFcFsA, Fl, h, recov, w, order, Nt=128, aft_tol=1e-07, calc_grad=True)¶
Residual for harmonic balance method (HBM) with amplitude and phase control for continuation with respect to amplitude.
Control is applied exclusively to the 1st harmonic.
- Parameters:
- UFcFsA(N*Nhc+3,) numpy.ndarray
Global harmonic degrees of freedom, all DOFs for each harmonic component and then the next harmonic component in h. These are followed by the scaling for the cosine forcing terms, the scaling for the sine forcing terms, and the amplitude that the recovered DOF is controlled to (defined by recov and order) that is used in constraint equation.
- Fl(N*Nhc,) numpy.ndarray
Applied external forcing harmonic coefficients in the same ordering as displacements in Uw. Zeroth harmonic (static) forces are applied directly from this vector. Forcing of the first harmonic is of the form UFcFsw[-3]*Fl_cos1*cos(w*t) + UFcFsw[-2]*Fl_cos1*sin(w*t) with w = UFcFsw[-1] and Fl_cos1 is the first harmonic cosine terms in Fl. Forcing on all other harmonics is ignored. Forcing input for sine terms of the first harmonic is currently ignored.
- h1D np.array, sorted
List of included harmonics, sorted and without repeats. Harmonics should be positive integers or zero.
- recov(N,) numpy.ndarray
Recovery matrix to extract the DOF that has amplitude and phase control.
- wfloat
Frequency (rad/s) of first harmonic.
- orderint, positive or zero
Exponent on frequency to multiply the controlled displacement by. This allows for control of 0=displacement, 1=velocity, or 2=acceleration. Control does not consider sign changes due to derivatives when controlling order != 0.
- Ntint, power of 2, optional
Number of time steps for AFT. The default is 128.
- aft_tolfloat, optional
Tolerance for AFT. The default is 1e-7.
- calc_gradbool
Flag where True indicates that the gradients should be calculated and returned. If False, then returns only (R,) as a tuple. False should only be passed if all nonlinear forces have AFT methods that accept the calc_grad keyword. If True, the argument is not passed to nonlinear forces. The default is True.
- Returns:
- R(N*Nhc+2,) numpy.ndarray
Evaluated residual for HBM analysis with amplitude and phase control. -2 entry is amplitude constraint on cosine response, which should be equal to A = UFcFsA[-1]. -1 entry is phase constraint to be zero sine repsonse.
- dRdUFcFs(N*Nhc+2,N*Nhc+2) numpy.ndarray
Derivative of R with respect to UFcFs = UFcFsA[:-1].
- dRdA(N*Nhc+2,) numpy.ndarray
Derivative of R with respect to A = UFcFsA[-1].
See also
hbm_resHarmonic balance residual for constant force input to the system. See documentation of this function for a full list of HBM variants.
tmdsimpy.utils.harmonic.predict_harmonic_solutionFunction for generating initial guesses to HBM type problems.
Notes
The number of harmonic components is Nhc = tmdsimpy.utils.harmonic.Nhc(h)
- hbm_amp_phase_control_res(UFcFsw, Fl, h, recov, amp, order, Nt=128, aft_tol=1e-07, calc_grad=True)¶
Residual for harmonic balance method (HBM) with amplitude and phase control.
Control is applied exclusively to the 1st harmonic.
- Parameters:
- UFcFsw(N*Nhc+3,) numpy.ndarray
Global harmonic degrees of freedom, all DOFs for each harmonic component and then the next harmonic component in h. These are followed by the scaling for the cosine forcing terms, the scaling for the sine forcing terms, and the frequency in rad/s of first harmonic.
- Fl(N*Nhc,) numpy.ndarray
Applied external forcing harmonic coefficients in the same ordering as displacements in Uw. Zeroth harmonic (static) forces are applied directly from this vector. Forcing of the first harmonic is of the form UFcFsw[-3]*Fl_cos1*cos(w*t) + UFcFsw[-2]*Fl_cos1*sin(w*t) with w = UFcFsw[-1] and Fl_cos1 is the first harmonic cosine terms in Fl. Forcing on all other harmonics is ignored. Forcing input for sine terms of the first harmonic is currently ignored.
- h1D np.array, sorted
List of included harmonics, sorted and without repeats. Harmonics should be positive integers or zero.
- recov(N,) numpy.ndarray
Recovery matrix to extract the DOF that has amplitude and phase control.
- ampfloat
Amplitude that the recovered DOF is controlled to (defined by recov and order).
- orderint, positive or zero
Exponent on frequency to multiply the controlled displacement by. This allows for control of 0=displacement, 1=velocity, or 2=acceleration. Control does not consider sign changes due to derivatives when controlling order != 0.
- Ntint, power of 2, optional
Number of time steps for AFT. The default is 128.
- aft_tolfloat, optional
Tolerance for AFT. The default is 1e-7.
- calc_gradbool
Flag where True indicates that the gradients should be calculated and returned. If False, then returns only (R,) as a tuple. False should only be passed if all nonlinear forces have AFT methods that accept the calc_grad keyword. If True, the argument is not passed to nonlinear forces. The default is True.
- Returns:
- R(N*Nhc+2,) numpy.ndarray
Evaluated residual for HBM analysis with amplitude and phase control. -2 entry is amplitude constraint on cosine response. -1 entry is phase constraint to be zero sine repsonse.
- dRdUFcFs(N*Nhc+2,N*Nhc+2) numpy.ndarray
Derivative of R with respect to UFcFs = UFcFsw[:-1].
- dRdw(N*Nhc+2,) numpy.ndarray
Derivative of R with respect to w = UFcFsw[-1].
See also
hbm_resHarmonic balance residual for constant force input to the system. See documentation of this function for a full list of HBM variants.
tmdsimpy.utils.harmonic.predict_harmonic_solutionFunction for generating initial guesses to HBM type problems.
Notes
The number of harmonic components is Nhc = tmdsimpy.utils.harmonic.Nhc(h)
- hbm_base_res(Uw, Ub, base_flag, h, Nt=128, aft_tol=1e-07)¶
Residual for Harmonic Balance Method (HBM) with applied base excitation.
- Parameters:
- Uw(Nfree*Nhc+1,) numpy.ndarray
Global harmonic degrees of freedom, free DOFs for each harmonic component and then the next harmonic component in h. These are followed by the frequency in rad/s of first harmonic.
- Ub(Nbase*Nhc,) numpy.ndarray
Global harmonic degrees of freedom, base DOFs for each harmonic component and then the next harmonic component in h. These are the prescribed displacements for the base DOFs.
- base_flag(N,) numpy.ndarray of bool
Vector has True for DOFs that are the part of the base and get the prescribed base motion from Ub.
- h1D np.array, sorted
List of included harmonics, sorted and without repeats. Harmonics should be positive integers or zero.
- Ntint, power of 2, optional
Number of time steps for AFT. The default is 128.
- aft_tolfloat, optional
Tolerance for AFT. The default is 1e-7.
- Returns:
- R(Nfree*Nhc,) numpy.ndarray
Evaluated residual for HBM analysis at the free DOFs.
- dRdU(Nfree*Nhc,Nfree*Nhc) numpy.ndarray
Derivative of R with respect to U = Uw[:-1].
- dRdw(Nfree*Nhc,) numpy.ndarray
Derivative of R with respect to w = Uw[-1].
See also
hbm_resHarmonic balance residual for constant force input to the system. See documentation of this function for a full list of HBM variants
linear_frf_baseLinear frequency response calculation for base excitation.
Notes
The system has Nfree free DOFs, Nbase base excited DOFs, and N total DOFs.
No harmonic excitation is included other than the base excitation.
- hbm_res(Uw, Fl, h, Nt=128, aft_tol=1e-07, calc_grad=True)¶
Residual for the basic Harmonic Balance Method (HBM).
- Parameters:
- Uw(N*Nhc+1,) numpy.ndarray
Global harmonic degrees of freedom, all DOFs for each harmonic component and then the next harmonic component in h. These are followed by the frequency in rad/s of first harmonic.
- Fl(N*Nhc,) numpy.ndarray
Applied external forcing harmonic coefficients in the same ordering as displacements in Uw.
- h1D np.array, sorted
List of included harmonics, sorted and without repeats. Harmonics should be positive integers or zero.
- Ntint, power of 2, optional
Number of time steps for AFT. The default is 128.
- aft_tolfloat, optional
Tolerance for AFT. The default is 1e-7.
- calc_gradbool
Flag where True indicates that the gradients should be calculated and returned. If False, then returns only (R,) as a tuple. False should only be passed if all nonlinear forces have AFT methods that accept the calc_grad keyword. If True, the argument is not passed to nonlinear forces. The default is True.
- Returns:
- R(N*Nhc,) numpy.ndarray
Evaluated residual for HBM analysis.
- dRdU(N*Nhc,N*Nhc) numpy.ndarray
Derivative of R with respect to U = Uw[:-1].
- dRdw(N*Nhc,) numpy.ndarray
Derivative of R with respect to w = Uw[-1].
See also
tmdsimpy.utils.harmonic.predict_harmonic_solutionFunction for generating initial guesses to HBM type problems.
hbm_res_dFlHBM residual with a different input/third output that allows for continuation with respect to scaling of external force.
hbm_base_resHBM for base excited systems (prescribed displacement at DOFs)
hbm_amp_control_resHBM with one extra unknown / equation that constrains solution to constant amplitude, variable response phase, fixed forcing phase
hbm_amp_phase_control_resHBM with two extra equations and unknowns that allows for solutions along a constant response amplitude and phase.
hbm_amp_phase_control_dA_resHBM with amplitude and phase control for continuation with respect to amplitude.
Notes
The number of harmonic components is Nhc = tmdsimpy.utils.harmonic.Nhc(h)
- hbm_res_dFl(UF, w, Fl, h, Nt=128, aft_tol=1e-07, calc_grad=True)¶
Residual for Harmonic Balance Method (HBM) for continuation with respect to force scaling.
- Parameters:
- UF(N*Nhc+1,) numpy.ndarray
Global harmonic degrees of freedom, all DOFs for each harmonic component and then the next harmonic component in h. These are followed by a scaling factor for the external forces. All harmonics except the zeroth harmonic are scaled by this factor.
- wfloat
Frequency in rad/s of the 1st harmonic.
- Fl(N*Nhc,) numpy.ndarray
Applied forcing harmonic coefficients that will be scaled by UF[-1]. The zeroth harmonic of Fl is not scaled.
- h1D np.array, sorted
List of included harmonics, sorted and without repeats. Harmonics should be positive integers or zero.
- Ntint, power of 2, optional
Number of time steps for AFT. The default is 128.
- aft_tolfloat, optional
Tolerance for AFT. The default is 1e-7.
- calc_gradbool
Flag where True indicates that the gradients should be calculated and returned. If False, then returns only (R,) as a tuple. False should only be passed if all nonlinear forces have AFT methods that accept the calc_grad keyword. If True, the argument is not passed to nonlinear forces. The default is True.
- Returns:
- R(N*Nhc,) numpy.ndarray
Evaluated residual for HBM analysis.
- dRdU(N*Nhc,N*Nhc) numpy.ndarray
Derivative of R with respect to U = UF[:-1].
- dRdF(N*Nhc,) numpy.ndarray
Derivative of R with respect to F = UF[-1].
See also
hbm_resHarmonic balance residual with a different input/output that allows for continuation with respect to frequency. See documentation of this function for a full list of HBM variants.
tmdsimpy.utils.harmonic.predict_harmonic_solutionFunction for generating initial guesses to HBM type problems.
Notes
The number of harmonic components is Nhc = tmdsimpy.utils.harmonic.Nhc(h)
- init_force_history()¶
Initialize all hysteretic forces to have initial zero force states.
- Returns:
- None.
- linear_frf(w, Fl, solver, neigs=3, Flsin=None)¶
Calculates linear frequency response function (FRF) of system.
- Parameters:
- w(M,) numpy.ndarray
Forcing frequencies, single harmonic (rad/s). May also work for a single forcing frequency with a float input.
- Fl(N,) numpy.ndarray
Applied external forcing cosine coefficients applied to DOFs.
- solvertmdsimpy.NonlinearSolver or similar
Object with routines for linear and nonlinear solutions, specifically containing support for eigen-analysis.
- neigsint, optional
Number of modes to calculate for use in construction of the FRF. A warning is raised if this exceeds N, and N is used in that case. The default is 3.
- FlsinNone of (N,) numpy.ndarray, optional
Applied external forcing sine coefficients applied to DOFs. If None, then only the cosine forcing is applied. The default is None.
- Returns:
- Xw(M,2*N+1) numpy.ndarray
Row indices correspond to w forcing freuqencies. First N columns are the cosine response at the forcing frequency. Second N columns are the sine response at the forcing frequency. Final column is the forcing frequency.
Notes
This method requires that the vibration system be initialized with proportional damping.
This method does not consider any contributions of the nonlinear forces even if the linearized nonlinear forces would contribute to the stiffness. If that is of interest, one can calculate the linearized stiffness with static_res and then create a new purely linear vibration system with that stiffness to do linear FRF analysis on.
- linear_frf_base(w, Ub, base_flag, solver, neigs=3)¶
Calculates linear frequency response function (FRF) of system with base excitation.
- Parameters:
- w(M,) numpy.ndarray
Forcing frequencies, single harmonic (rad/s). May also work for a single forcing frequency with a float input.
- Ub(2,) numpy.ndarray
Prescribed motion for the base DOF of the system. The first entry is the cosine motion, the second entry is the sine motion.
- base_flag(N,) numpy.ndarray of bool
Vector has True for DOFs that are the part of the base and get the prescribed base motion from Ub.
- solvertmdsimpy.NonlinearSolver or similar
Object with routines for linear and nonlinear solutions, specifically containing support for eigen-analysis.
- neigsint, optional
Number of modes to calculate for use in construction of the FRF. A warning is raised if this exceeds Nfree, and Nfree is used in that case. The default is 3.
- Returns:
- Xw(M,2*Nfree+1) numpy.ndarray
Row indices correspond to w forcing freuqencies. First Nfree columns are the cosine response at the forcing frequency. Second Nfree columns are the sine response at the forcing frequency. These entries correspond to where base_flag is False. Final column is the forcing frequency.
Notes
While this is structured to allow multiple base DOFs, the analytical calculation implicitly assumes that all base DOFs move together. Therefore only one cosine and one sine input are allowed for the base motion.
This method requires that the vibration system be initialized with proportional damping, but may not throw an error if this is not the case.
This method does not consider any contributions of the nonlinear forces even if the linearized nonlinear forces would contribute to the stiffness. If that is of interest, one can calculate the linearized stiffness with static_res and then create a new purely linear vibration system with that stiffness to do linear FRF analysis on.
The system has Nfree free DOFs, Nbase base excited DOFs (moving together), and N total DOFs.
- reset_real_mu()¶
Reset the friction coefficient to the real value for analysis.
- Returns:
- None.
See also
set_prestress_muMethod for setting friction limit to prestress value (generally zero).
Notes
This method calls the reset_real_mu on all nonlinear forces that have that method defined. This generally is defined to return the friction coefficient or slip limit to the initialized value after prestress analysis. For prestress analysis, the slip limit is frequently set to zero.
- set_aft_initialize(U)¶
Set an initial position for friction model slides to be used during frequency domain analysis.
- Parameters:
- U(N,) numpy.ndarray
Global static displacements.
- Returns:
- None.
Notes
Frequency domain analyses utilize the alternating frequency time (AFT) method to evaluate nonlinear forces. For hysteretic models, solutions may not be unique depending on the choice of initial slider positions used to initialize the AFT force evaluations. This method allows for setting all friction model sliders based on a set of global static displacements.
- set_new_C(C=None, ab=None)¶
Set the damping matrix to a new value after initialization.
- Parameters:
- C(N,N) numpy.ndarray, optional
New damping matrix. If ab is not None, then ab is used instead. If neither C nor ab is provided, nothing is changed. The default is None.
- ablist of length 2, optional
If provided, the damping matrix is set to C = ab[0]*self.M + ab[1]*self.K. The default is None.
- Returns:
- None.
Notes
This method is useful if one wants to set the damping matrix to be mass and stiffness proportional around a prestressed state using the linearization of the nonlinear forces. In that case, one manually calculates C with the proportional coefficients and linearized stiffness and passes it here.
- set_prestress_mu()¶
Set friction coefficients to a prestress value for analysis.
- Returns:
- None.
See also
reset_real_muMethod for returning to the real value of the friction slip limit.
Notes
This method calls the set_prestress_mu method on nonlinear forces with that method defined. For hysteretic models, set_prestress_mu is generally defined to set the slip force or friction coefficient to zero. This is done for prestress analysis only to eliminate tangential forces.
- shooting_res(Uw, Fl, Nt=128, return_aux=False)¶
Residual for shooting calculations
- Parameters:
- Uw(2*N+1,) numpy.ndarray
Test solution point to the shooting residual. Has N displacements, then N velocities, then frequency in rad/s.
- Fl(2*N) numpy.ndarray
First N entries are cosine forcing at frequency XlamP_shoot[-1]. The second N are the sine forcing terms.
- Ntint, optional
Number of time steps to use in shooting calculations. The default is 128.
- return_auxbool, optional
Flag to return extra output variables (time series, Monodromy matrix etc.). The default is False.
- Returns:
- None.
See also
tmdsimpy.postprocess.shooting.time_stabilityFunction for post processing the time series and stability from a solution point to these equations.
Notes
For theory about shooting and stability analysis, see Section 3 of [1].
Implementation currently only supports instantaneous nonlinear forces, but does not support cubic damping.
Most instantaneous forces are tested focusing only on HBM/AFT rather than the instant force that is used here.
References
[1]Peeters, M., R. Viguie, G. Sérandour, G. Kerschen, and J. -C. Golinval. 2009. “Nonlinear Normal Modes, Part II: Toward a Practical Computation Using Numerical Continuation Techniques.” Mechanical Systems and Signal Processing, Special Issue: Non-linear Structural Dynamics, 23 (1): 195–216. https://doi.org/10.1016/j.ymssp.2008.04.003.
- static_res(U, Fstatic)¶
Residual function for static analysis.
- Parameters:
- U(N,) numpy.ndarray
Global static displacements to evaluate residual at.
- Fstatic(N,) numpy.ndarray
Externally applied static forces on global coordinates.
- Returns:
- R(N,) numpy.ndarray
Evaluated residual for static analysis.
- dRdU(N,N) numpy.ndarray
Derivative of R with respect to U.
See also
update_force_historyMethod for updating force history after a static analysis.
Notes
This method is generally used to solve for a prestress analysis. Additionally, dRdU gives the linearized stiffness around a state. For friction models, make sure the friction coefficient is set to the nonzero value with reset_real_mu and the history variables are correct prior to evaluating the linearized stiffness.
- total_aft(U, w, h, Nt=128, aft_tol=1e-07, calc_grad=True)¶
Apply Alternating Frequency Time (AFT) Method to calculate all nonlinear harmonic forces.
- Parameters:
- U(N*Nhc,) numpy.ndarray
Global harmonic degrees of freedom, all DOFs for each harmonic component and then the next harmonic component in h.
- wfloat
Frequency (rad/s) of first harmonic.
- h1D np.array, sorted
List of included harmonics, sorted and without repeats. Harmonics should be positive integers or zero.
- Ntint, power of 2, optional
Number of time steps for AFT. The default is 128.
- aft_tolfloat, optional
Tolerance for AFT. The default is 1e-7.
- calc_gradbool
Flag where True indicates that the gradients should be calculated and returned. If False, then returns only (Fnl,) as a tuple. False should only be passed if all nonlinear forces have AFT methods that accept the calc_grad keyword. If True, the argument is not passed to nonlinear forces. The default is True.
- Returns:
- Fnl(N*Nhc,) numpy.ndarray
Internal nonlinear force harmonic coefficients in global coordiantes.
- dFnldU(N*Nhc,N*Nhc) numpy.ndarray
Derivative of Fnl with respect to U.
- dFnldw(N*Nhc,) numpy.ndarray
Derivative of Fnl with respect to w.
Notes
The number of harmonic components is Nhc = tmdsimpy.utils.harmonic.Nhc(h)
- update_force_history(U)¶
Update internal nonlinear force history variables to reflect the current state.
This is generally called after a static analysis such as for prestress.
- Parameters:
- U(N,) numpy.ndarray
Displacements to set an update of the force history at. These are generally of prestressed state.
- Returns:
- None.
- vprnm_amp_phase_res(UFcFswA, Fl, h, rhi, recov, order, Nt=128, aft_tol=1e-07, calc_grad=True, superharmonic_filter=None, constraint_scale=1.0)¶
Residual for the Variable Phase Resonance Nonlinear Modes (VPRNM) with extra constraints.
Method adds a constraint to HBM to follow a superharmonic resonance and constraints on amplitude and phase of the response to make it easier to solve the set of equations.
- Parameters:
- UFcFswA(N*Nhc+4,) numpy.ndarray
Global harmonic degrees of freedom, all DOFs for each harmonic component and then the next harmonic component in h. These are followed by the force scaling for first harmonic cosine external force, the force scaling for first harmonic sine external force, the frequency in rad/s of first harmonic, and the amplitude level.
- Fl(N*Nhc,) numpy.ndarray
Applied external forcing harmonic coefficients in the same ordering as displacements in UFcFswA. The zeroth harmonic force is taken directly from this. The first harmonic cosine force coefficients are applied as cosine and sine forcing with the scaling of UFcFswA[-4] and UFcFswA[-3] respectively.
- h1D np.array, sorted
List of included harmonics, sorted and without repeats. Harmonics should be positive integers or zero.
- rhiint
Superharmonic resonance harmonic number of interest, must be included in h.
- recov(N,) numpy.ndarray
Recovery matrix to extract the DOF that has amplitude and phase control.
- orderint, positive or zero
Exponent on frequency to multiply the controlled displacement by. This allows for control of 0=displacement, 1=velocity, or 2=acceleration. Control does not consider sign changes due to derivatives when controlling order != 0.
- Ntint, power of 2, optional
Number of time steps for AFT. The default is 128.
- aft_tolfloat, optional
Tolerance for AFT. The default is 1e-7.
- calc_gradbool
Flag where True indicates that the gradients should be calculated and returned. If False, then returns only (R,) as a tuple. False should only be passed if all nonlinear forces have AFT methods that accept the calc_grad keyword. If True, the argument is not passed to nonlinear forces. The default is True.
- superharmonic_filterNone or (N,) numpy.ndarray, optional
If None, VPRNM is calculated without a modal filter. If a numpy.ndarray, then VPRNM is modally filtered with the array. The modal filter is applied to the superharmonic resonance to extract a specific mode. The default is None.
- constraint_scalefloat
Number to scale the residual of the constraint equation by. This is useful when a solver does not put sufficient weight on the constraint equation and just solves the HBM equations ignoring the constraint. It may need to be dynamically updated between solutions along continuation to avoid problems. The default is 1.0.
- Returns:
- R(N*Nhc+3,) numpy.ndarray
Evaluated residual for VPRNM analysis.
- dRdUFcFsw(N*Nhc+3,N*Nhc+3) numpy.ndarray
Derivative of R with respect to UFcFsw = UFcFswA[:-1].
- dRdA(N*Nhc+3,) numpy.ndarray
Derivative of R with respect to A = UFcFswA[-1].
See also
hbm_resHarmonic balance residual with a different input/output that allows for continuation with respect to frequency. See documentation of this function for a full list of HBM variants.
vprnm_resVPRNM implementation without additional amplitude and phase constraints (constant force excitation)
tmdsimpy.utils.harmonic.predict_harmonic_solutionFunction for generating initial guesses to HBM type problems.
Notes
The number of harmonic components is Nhc = tmdsimpy.utils.harmonic.Nhc(h).
Theory for VPRNM is developed in [1], [2], [3].
References
[1]Porter, J. H., and M. R. W. Brake. 2024. “Tracking Superharmonic Resonances for Nonlinear Vibration of Conservative and Hysteretic Single Degree of Freedom Systems.” Mechanical Systems and Signal Processing 215:111410. https://doi.org/10.1016/j.ymssp.2024.111410. arXiv:2401.08790
[2]Porter, J. H., and M. R. W. Brake. Under Review. “Efficient Model Reduction and Prediction of Superharmonic Resonances in Frictional and Hysteretic Systems.” Mechanical Systems and Signal Processing. arXiv:2405.15918.
[3]Porter, J. H. 2024. Modal Interactions and Jointed Structures. PhD Thesis. Rice University.
- vprnm_res(UwF, h, rhi, Fl, Nt=128, aft_tol=1e-07, calc_grad=True, superharmonic_filter=None, constraint_scale=1.0)¶
Residual for the basic Variable Phase Resonance Nonlinear Modes (VPRNM).
Method adds a constraint to HBM to follow a superharmonic resonance.
- Parameters:
- UwF(N*Nhc+2,) numpy.ndarray
Global harmonic degrees of freedom, all DOFs for each harmonic component and then the next harmonic component in h. These are followed by the frequency in rad/s of first harmonic and the force magnitude scalingn of Fl (zeroth harmonic is not scaled).
- h1D np.array, sorted
List of included harmonics, sorted and without repeats. Harmonics should be positive integers or zero.
- rhiint
Superharmonic resonance harmonic number of interest, must be included in h.
- Fl(N*Nhc,) numpy.ndarray
Applied external forcing harmonic coefficients in the same ordering as displacements in UwF. All harmonics except harmonic 0 are multiplied in this method by UwF[-1].
- Ntint, power of 2, optional
Number of time steps for AFT. The default is 128.
- aft_tolfloat, optional
Tolerance for AFT. The default is 1e-7.
- calc_gradbool
Flag where True indicates that the gradients should be calculated and returned. If False, then returns only (R,) as a tuple. False should only be passed if all nonlinear forces have AFT methods that accept the calc_grad keyword. If True, the argument is not passed to nonlinear forces. The default is True.
- superharmonic_filterNone or (N,) numpy.ndarray, optional
If None, VPRNM is calculated without a modal filter. If a numpy.ndarray, then VPRNM is modally filtered with the array. The modal filter is applied to the superharmonic resonance to extract a specific mode. The default is None.
- constraint_scalefloat
Number to scale the residual of the constraint equation by. This is useful when a solver does not put sufficient weight on the constraint equation and just solves the HBM equations ignoring the constraint. It may need to be dynamically updated between solutions along continuation to avoid problems. The default is 1.0.
- Returns:
- R(N*Nhc+1,) numpy.ndarray
Evaluated residual for VPRNM analysis.
- dRdUw(N*Nhc+1,N*Nhc+1) numpy.ndarray
Derivative of R with respect to Uw = UwF[:-1].
- dRdw(N*Nhc+1,) numpy.ndarray
Derivative of R with respect to F = UwF[-1].
See also
hbm_resHarmonic balance residual with a different input/output that allows for continuation with respect to frequency. See documentation of this function for a full list of HBM variants.
Notes
The number of harmonic components is Nhc = tmdsimpy.utils.harmonic.Nhc(h).
Theory for VPRNM is developed in [1], [2], [3].
References
[1]Porter, J. H., and M. R. W. Brake. 2024. “Tracking Superharmonic Resonances for Nonlinear Vibration of Conservative and Hysteretic Single Degree of Freedom Systems.” Mechanical Systems and Signal Processing 215:111410. https://doi.org/10.1016/j.ymssp.2024.111410. arXiv:2401.08790
[2]Porter, J. H., and M. R. W. Brake. Under Review. “Efficient Model Reduction and Prediction of Superharmonic Resonances in Frictional and Hysteretic Systems.” Mechanical Systems and Signal Processing. arXiv:2405.15918.
[3]Porter, J. H. 2024. Modal Interactions and Jointed Structures. PhD Thesis. Rice University.
- vprnm_single_eqn(U, w, h, rhi, Nt=128, aft_tol=1e-07, calc_grad=True, superharmonic_filter=None)¶
Single residual equation evaluation for Variable Phase Resonance Nonlinear Modes (VPRNM).
This equation in general needs to be added to a set of HBM equations to find HBM solutions along the superharmonic resonance.
- Parameters:
- U(N*Nhc+m,) numpy.ndarray
Global harmonic degrees of freedom, all DOFs for each harmonic component and then the next harmonic component in h. Only the first N*Nhc entries are directly indexed with positive numbers, so it is allowable to have extra values at the end of the array.
- wfloat
Frequency (rad/s) of first harmonic.
- h1D np.array, sorted
List of included harmonics, sorted and without repeats. Harmonics should be positive integers or zero.
- rhiint
Superharmonic resonance harmonic number of interest, must be included in h.
- Ntint, power of 2, optional
Number of time steps for AFT. The default is 128.
- aft_tolfloat, optional
Tolerance for AFT. The default is 1e-7.
- calc_gradbool
Flag where True indicates that the gradients should be calculated and returned. If False, then returns only (Fnl,) as a tuple. False should only be passed if all nonlinear forces have AFT methods that accept the calc_grad keyword. If True, the argument is not passed to nonlinear forces. The default is True.
- superharmonic_filterNone or (N,) numpy.ndarray, optional
If None, VPRNM is calculated without a modal filter. If a numpy.ndarray, then VPRNM is modally filtered with the array. The modal filter is applied to the superharmonic resonance to extract a specific mode. The default is None.
- Returns:
- Rfloat
Evaluated residual for VPRNM equation.
- dRdUw(N*Nhc+1,) numpy.ndarray
Derivative of R with respect to Uw = numpy.hstack((U, w)).
See also
vprnm_resFull implementation of VPRNM including the HBM residual equations.
Notes
The number of harmonic components is Nhc = tmdsimpy.utils.harmonic.Nhc(h)
Theory for VPRNM is developed in [1], [2], [3].
References
[1]Porter, J. H., and M. R. W. Brake. 2024. “Tracking Superharmonic Resonances for Nonlinear Vibration of Conservative and Hysteretic Single Degree of Freedom Systems.” Mechanical Systems and Signal Processing 215:111410. https://doi.org/10.1016/j.ymssp.2024.111410. arXiv:2401.08790
[2]Porter, J. H., and M. R. W. Brake. Under Review. “Efficient Model Reduction and Prediction of Superharmonic Resonances in Frictional and Hysteretic Systems.” Mechanical Systems and Signal Processing. arXiv:2405.15918.
[3]Porter, J. H. 2024. Modal Interactions and Jointed Structures. PhD Thesis. Rice University.