tmdsimpy.nlforces.VectorIwan4¶
- class tmdsimpy.nlforces.VectorIwan4(Q, T, kt, Fs, chi, beta, Nsliders=100, alphasliders=1.0)¶
Bases:
Iwan4Force4-Parameter Iwan Element Nonlinearity with vectorized force calculations.
- Parameters:
- Q(Nnl, N) numpy.ndarray
Matrix tranform from the N degrees of freedom (DOFs) of the system to the Nnl local nonlinear DOFs.
- T(N, Nnl) numpy.ndarray
Matrix tranform from the local Nnl forces to the N global DOFs.
- ktfloat
Tangential stiffness coefficient.
- Fsfloat
Slip force.
- chifloat
Controls microslip damping slope. Recommended to have chi > -1. Smaller values of chi may not work.
- betafloat, positive
Controls discontinuity at beginning of macroslip (zero is smooth).
- Nslidersint, optional
Number of discrete sliders for the Iwan element. Note that this does not include 1 additional slider for the delta function at phimax. Default is 100 (commonly used in literature).
- alphaslidersfloat, optional
Determines the non-uniform discretization (see [1]). For midpoint rule, using anything other than 1.0 has significantly higher error. The default is 1.0.
See also
Iwan4ForceStandard implementation of the Iwan element, generally a slower implementation than the present class.
Notes
This class exploits the fact that only reversal points need to be calculated to reach steady-state. After that, all intermediate times can be calculated in parallel (vectorized here), to be faster. This does not change the results.
This implementation is only tested for Nnl == 1.
local_force_history implementation is the only difference relative to Iwan4Force for standard functions. This also adds a new function to help in calculations of local_force_history_crit, but that function should not be needed for must public calls.
Iwan nonlinearity is based on [1].
References
- __init__(Q, T, kt, Fs, chi, beta, Nsliders=100, alphasliders=1.0)¶
Methods
__init__(Q, T, kt, Fs, chi, beta[, ...])aft(U, w, h[, Nt, tol, max_repeats, atol, rtol])Implementation of the alternating frequency-time method to extract harmonic nonlinear force coefficients (hysteretic forces).
force(X[, update_hist])Calculate global nonlinear forces for some global displacement vector.
Method to initialize history variables for the hysteretic model.
init_history_harmonic(unlth0[, h])Initialize history variables for harmonic (AFT) analysis.
instant_force(unl, unldot[, update_prev])Calculates local force based on local nonlinear displacements.
instant_force_harmonic(unl, unldot, h, cst)Evaluates the force at a instantaneous set of displacement and velocity along with harmonic derivatives.
local_force_history(unlt, unltdot, h, cst, ...)Evaluate the local forces for steady-state harmonic motion used in AFT.
local_force_history_crit(unlt, unltdot, h, ...)Modified local_force_history to pass out slider states as well as other returns.
Method to identify the force type as hysteretic.
Not implemented for Iwan element.
- aft(U, w, h, Nt=128, tol=1e-07, max_repeats=2, atol=1e-10, rtol=1e-10)¶
Implementation of the alternating frequency-time method to extract harmonic nonlinear force coefficients (hysteretic forces).
- Parameters:
- U(N*Nhc,) numpy.ndarray
Displacement harmonic DOFs (global)
- wfloat
Frequency in rad/s. Needed in case there is velocity dependency.
- hnumpy.ndarray, sorted
List of harmonics. The list corresponds to Nhc harmonic components.
- Ntint power of 2, optional
Number of time steps used in evaluation. The default is 128.
- tolfloat, optional
This argument is ignored for hysteretic forces. It is included for compatability of interface. The default is 1e-7.
- max_repeatsint, optional
Number of times to repeat the time series to converge the initial state with local_force_history. Two is sufficient for slider models. The default is 2.
- atolfloat, optional
Absolute tolerance on local_force_history force convergence to steady-state (final state of cycle). The default is 1e-10.
- rtolfloat, optional
Relative tolerance on local_force_history force convergence to steady-state (final state of cycle). The default is 1e-10.
- Returns:
- Fnl(N*Nhc,) numpy.ndarray
Nonlinear hamonic force coefficients
- dFnldU(N*Nhc,N*Nhc) numpy.ndarray
Jacobian of Fnl with respect to U
- dFnldw(N*Nhc,) numpy.ndarray
Jacobian of Fnl with respect to w
Notes
A calc_grad optional argument should be added in the future to allow for compatibility with other functions/methods/classes.
WARNING: Needs further verification for cases using multiple nonlinear displacements and or nonlinear output forces.
WARNING: Does not support velocity dependencies in gradient calculation
- force(X, update_hist=False)¶
Calculate global nonlinear forces for some global displacement vector.
- Parameters:
- X(N,) numpy.ndarray
Global displacements
- update_histbool, optional
Flag to save displacement and force from the evaluation as history variables for subsequent calls to this function. The default is False.
- Returns:
- F(N,) numpy.ndarray
Global nonlinear force
- dFdX(N,N) numpy.ndarray
Derivative of F with respect to X.
- init_history()¶
Method to initialize history variables for the hysteretic model.
This consists of setting previous displacements and forces to be zero.
- Returns:
- None.
- init_history_harmonic(unlth0, h=array([0]))¶
Initialize history variables for harmonic (AFT) analysis.
- Parameters:
- unlth0(Nnl,) numpy.ndarray
Zeroth harmonic contributions to a time series of displacements. History displacements are initialized at this value.
- hnumpy.ndarray, sorted
List of harmonics used in subsequent analysis. The default is numpy.array([0]).
- Returns:
- None.
- instant_force(unl, unldot, update_prev=False)¶
Calculates local force based on local nonlinear displacements.
- Parameters:
- unl(Nnl,) numpy.ndarray
Local nonlinear displacements to evaluate force at.
- unldot(Nnl,) numpy.ndarray
Local nonlinear velocities to evaluate force at.
- update_prevbool, optional
Flag to store the results of the evaluation for the start of the subsequent step. The default is False.
- Returns:
- fnlfloat
Evaluated local nonlinear forces.
- dfnldunlfloat
Derivative of fnl with respect to unl.
- dfnlsliders_dunl(Nsliders+1,) numpy.ndarray
Derivative of fnl at each slider with respect to unl.
Notes
Implementation only allows for a single nonlinear element, thus shapes of first two outputs are reduced to scalar.
- instant_force_harmonic(unl, unldot, h, cst, update_prev=False)¶
Evaluates the force at a instantaneous set of displacement and velocity along with harmonic derivatives.
- Parameters:
- unl(Nnl,) numpy.ndarray
Local nonlinear displacements to evaluate force at.
- unldot(Nnl,) numpy.ndarray
Local nonlinear velocities to evaluate force at.
- h1D numpy.ndarray, sorted
List of harmonics used in subsequent analysis. Corresponds to Nhc harmonic components.
- cst(Nhc,) numpy.ndarray
Evaluation of harmonics without coefficients at the given instant in time. If zeroth harmonic is included, the first entry is 1.0. Beyond that, it is cosine and then sine at the appropriate harmonic for the given instant in time then the next harmonic etc.
- update_prevbool, optional
Flag to store the results of the evaluation for the start of the subsequent step. The default is False.
- Returns:
- fnl(1,) numpy.ndarray
Local nonlinear forces
- dfduh(1, 1, Nhc) numpy.ndarray
Derivative of fnl with respect to displacement harmonic coefficients.
- dfdudh(1, 1, Nhc) numpy.ndarray
Derivative of fnl with respect to velocities harmonic coefficients.
Notes
Starts calculation based on init_history_harmonic.
Only implemented for a single nonlinear element or Nnl == 1.
- local_force_history(unlt, unltdot, h, cst, unlth0, max_repeats=2, atol=1e-10, rtol=1e-10)¶
Evaluate the local forces for steady-state harmonic motion used in AFT.
- Parameters:
- unlt(Nt,Nnl) numpy.ndarray
Local displacements, rows are different time instants and columns are different displacement DOFs.
- unldot(Nt,Nnl) numpy.ndarray
Local velocities, rows are different time instants and columns are different displacement DOFs.
- h1D numpy.ndarray, sorted
List of harmonics used in subsequent analysis. Corresponds to Nhc harmonic components.
- cst(Nt,Nhc) numpy.ndarray
Evaluation of each harmonic component (columns) at a given instant in time (row = instant in time). These are without any harmonic coefficients, so are just cosine and sine evaluations.
- unlth0(Nnl,) numpy.ndarray
Zeroth harmonic contributions to a time series of displacements. This is passed to init_history_harmonic to initialize model.
- max_repeatsint, optional
This is included for compatibility, but is ignored. Two repeats of the hysteresis loop are used by default to ensure convergence since this is a slider model that converges with two repeats. The default is 2.
- atolfloat, optional
Absolute tolerance on force time series convergence to steady-state (final state of cycle). The default is 1e-10.
- rtolfloat, optional
Relative tolerance on force time series convergence to steady-state (final state of cycle). The default is 1e-10.
- Returns:
- ft(Nt,Nnl) numpy.ndarray
Local nonlinear forces. First index is time instants, second index is which local nonlinear force DOF.
- dfduh(Nt,Nnl,Nnl,Nhc) numpy.ndarray
Derivative of forces with respect to displacement harmonic coefficients. First two indices correspond to ft. Third index corresponds to which local nonlinear displacement. Fourth index corresponds to which of the Nhc harmonic components.
- dfdudh(Nt,Nnl,Nnl,Nhc) numpy.ndarray
Derivative of forces with respect to velocities harmonic coefficients. First two indices correspond to ft. Third index corresponds to which local nonlinear displacement. Fourth index corresponds to which of the Nhc harmonic components.
Notes
Convergence criteria is atol or rtol passes. To require a choice, pass in -1 for the other. Convergence should be exact within two cycles since this is a slider based model.
This function is reimplemented from Iwan4Force with the more efficient vectorized algorithm.
- local_force_history_crit(unlt, unltdot, h, cst, unlth0, max_repeats=2, atol=1e-10, rtol=1e-10)¶
Modified local_force_history to pass out slider states as well as other returns.
- Parameters:
- unlt(Nt,Nnl) numpy.ndarray
Local displacements, rows are different time instants and columns are different displacement DOFs.
- unltdot(Nt,Nnl) numpy.ndarray
Local velocities, rows are different time instants and columns are different displacement DOFs.
- h1D numpy.ndarray, sorted
List of harmonics used in subsequent analysis. Corresponds to Nhc harmonic components.
- cst(Nt,Nhc) numpy.ndarray
Evaluation of each harmonic component (columns) at a given instant in time (row = instant in time). These are without any harmonic coefficients, so are just cosine and sine evaluations.
- unlth0(Nnl,) numpy.ndarray
Zeroth harmonic contributions to a time series of displacements. This is passed to init_history_harmonic to initialize model.
- max_repeatsint, optional
Number of times to repeat the time series to converge the initial state with local_force_history. Two is sufficient for slider models. The default is 2.
- atolfloat, optional
Absolute tolerance on force time series convergence to steady-state (final state of cycle). The default is 1e-10.
- rtolfloat, optional
Relative tolerance on force time series convergence to steady-state (final state of cycle). The default is 1e-10.
- Returns:
- ft(Nt,Nnl) numpy.ndarray
Local nonlinear forces. First index is time instants, second index is which local nonlinear force DOF.
- dfduh(Nt,Nnl,Nnl,Nhc) numpy.ndarray
Derivative of forces with respect to displacement harmonic coefficients. First two indices correspond to ft. Third index corresponds to which local nonlinear displacement. Fourth index corresponds to which of the Nhc harmonic components.
- dfdudh(Nt,Nnl,Nnl,Nhc) numpy.ndarray
Derivative of forces with respect to velocities harmonic coefficients. First two indices correspond to ft. Third index corresponds to which local nonlinear displacement. Fourth index corresponds to which of the Nhc harmonic components.
- fsliders(Nt, Nsliders+1) numpy.ndarray
For each instant in time (row), the columns are the force of each slider in integrating the Iwan nonlinearity force.
- dfslidersduh(Nt, Nsliders+1, Nhc) numpy.ndarray
The derivative of fsliders with respect to the harmonic coefficients of the displacement unlt.
Notes
Function is intended to be called for only a subset of the full times of a cycle. These times should just be the velocity reversal points. This allows to the calculation of those points more directly to improve the efficiency of local_force_history.
Shapes of outputs rely on having Nnl == 1.
- nl_force_type()¶
Method to identify the force type as hysteretic.
- Returns:
- int
1, indicating hysteretic force type.
- set_prestress_mu()¶
Not implemented for Iwan element.
- Returns:
- None
Notes
Intention is to set friction coefficient to zero while saving initial value in a different variable. Useful for prestress analysis.
This is non-trivial for the Iwan implementation, so it is not yet implemented. One can simply not include the nonlinear force to get the same effect with the Iwan element.