The package provides a set of solvers to compute the time response of a single-degree-of-freedom (sdof) system.
1.1 Free response
The free response of a sdof system is the response of the system when it is subjected to initial conditions only. This means that the displacement of the mass is solution of the following ordinary differential equation: \[
\begin{cases}
\ddot x(t) + 2 \xi\omega_0\dot x(t) + \omega_0^2 x(t) = 0 \\
x(0) = x_0 \\
\dot x(0) = v_0
\end{cases}.
\]
Depending on the value of the damping ratio \(\xi\) and \(\omega_0 > 0\), the system can have 4 different types of free response:
an undamped motion when \(\xi = 0\). In this case, the free response is: \[
x(t) = x_0\cos\omega_0 t + \frac{v_0}{\omega_0}\sin\omega_0 t
\]
an underdamped motion when \(0 < \xi < 1\). In this case, the free response is: \[
x(t) = \left[x_0\cos\Omega_0 t + \frac{v_0 + \xi\Omega_0 x_0}{\Omega_0}\sin\Omega_0 t\right]e^{-\xi\omega_0 t}
\] where \(\Omega_0 = \omega_0\sqrt{1 - \xi^2}\).
a critically damped motion when \(\xi = 1\). In this case, the free response is: \[
x(t) = \left[x_0 + (v_0 + \omega_0 x_0)t\right]e^{-\omega_0 t}
\]
an overdamped motion when \(\xi > 1\). In this case, the free response is: \[
x(t) = \left[x_0\text{cosh}(\beta t) + \frac{v_0 + \xi\omega_0 x_0}{\beta}\text{sinh}\beta t\right]e^{-\xi\omega_0 t},
\] where \(\beta = \omega_0\sqrt{\xi^2 - 1}\).
Finally, if \(\omega = 0\), the mass is free from constraints and the free response is: \[
x(t) = x_0 + v_0 t.
\]
1.1.1 API
Data type
SdofFreeTimeProblem
SdofFreeTimeProblem(sdof, u0, t)
Structure containing the data of a time problem for a sdof system
Fields
sdof::Sdof: Sdof structure
u0::AbstractVector: Initial conditions
x0: Initial displacement [m]
v0: Initial velocity [m/s]
t::AbstractRange: Time points at which to evaluate the response
Related function
solve
solve(prob::SdofFreeTimeProblem)
Compute the free response of a single degree of freedom (Sdof) system.
Input
prob: Structure containing the parameters of the Sdof problem
Output
sol: The response of the system at the given time points
The forced response of a sdof system is the response of the system is the solution of the following ordinary differential equation: \[
\begin{cases}
\ddot x(t) + 2 \xi\omega_0\dot x(t) + \omega_0^2 x(t) = \displaystyle\frac{\text{rhs}(t)}{m} \\
x(0) = x_0 \\
\dot x(0) = v_0
\end{cases},
\] where \(\text{rhs}(t)\) is the right-hand side of the equation and its expression depends on the type of excitation: \[
\text{rhs}(t) = \begin{cases}
f(t) & \text{for an external force excitation} \\
m\omega_0^2 x_b(t) + 2\xi\omega_0m\dot x_b(t) & \text{for a base excitation}
\end{cases}.
\]
Finally, the solution of the forced response is expressed as the sum of two terms, since: \[
x(t) = x_h(t) + x_p(t),
\] where \(x_h(t)\) is the homogeneous solution of the equation and \(x_p(t)\) is the particular solution of the equation.
1.2.1 Harmonic excitation
When the excitation is harmonic, the resolution process is the following:
Compute the particular solution of the equation. The particular solution is a harmonic function of the same frequency as the excitation.
Express the general solution of the homogeneous equation.
Compute the remaining constants using the initial conditions. These constants depends on \(x_p(0)\) and \(\dot x_p(0)\).
Structure containing the data of a time problem for a sdof system subject to a harmonic excitation
Constructor parameters
sdof::Sdof: Sdof structure
F: Amplitude of the force excitation [N] or base motion [m]
f: Frequency of the excitation [Hz]
u0::AbstractVector: Initial conditions
x0: Initial displacement [m]
v0: Initial velocity [m/s]
t::AbstractRange: Time points at which to evaluate the response
type_exc::Symbol: Type of excitation
:force: External force (default)
:base: Base motion
Fields
sdof::Sdof: Sdof structure
F: Amplitude of the force excitation [N] or base motion [m]
ω: Frequency of the excitation [rad/s]
u0::AbstractVector: Initial conditions
x0: Initial displacement [m]
v0: Initial velocity [m/s]
t::AbstractRange: Time points at which to evaluate the response
type_exc::Symbol: Type of excitation
:force: External force (default)
:base: Base motion
Related function
solve
solve(prob::SdofHarmonicTimeProblem)
Computes the forced response of a single degree of freedom (Sdof) system due to an harmonic external force or base motion
Inputs
prob: Structure containing the parameters of the Sdof harmonic problem
Output
sol: The response of the system at the given time points
u: Displacement solution
du: Velocity solution
ddu: Acceleration solution
1.2.1.2 Example
# Structural parametersm =1.f0 =1.ξ =0.1# Instantiation of the Sdof objectsdof =Sdof(m, f0, ξ)# Harmonic excitation - Force amplitude + excitation frequencyF0 =10.f =2.# Instantiation of the problemt =0.:0.01:10.u0 = [1., -2.]prob =SdofHarmonicTimeProblem(sdof, F0, f, u0, t, :force)# Solve the problemx_harmo =solve(prob).u
1.2.2 Arbitrary excitation
For an arbitrary excitation, the solution is given by: \[
x(t) = x_\text{free}(t) + \int_0^t rhs(t - τ)h(τ)dτ,
\] where \(x_\text{free}(t)\) is the free response of the system and \(h(t)\) is the impulse response of the system.
Structure containing the data of a time problem for a sdof system subject to an arbitrary excitation
Fields
sdof::Sdof: Sdof structure
F::AbstractVector: Amplitude of the force excitation [N] or base motion [m]
u0::AbstractVector: Initial conditions
x0: Initial displacement [m]
v0: Initial velocity [m/s]
t::AbstractRange: Time points at which to evaluate the response
type_exc::Symbol: Type of excitation
:force: External force (default)
:base: Base motion
Related function
solve
solve(prob::SdofForcedTimeProblem)
Computes the forced response of a single degree of freedom (Sdof) system due to an arbitrary external force or base motion
Inputs
prob: Structure containing the parameters of the Sdof forced problem
method: Method to compute the Duhamel's integral
:filt: Filtering using the Z-transform of the impulse response (default)
:interp: Interpolation + Gaussian quadrature
:conv: Convolution product
Output
sol: The response of the system at the given time points
u: Displacement solution
du: Velocity solution
ddu: Acceleration solution
1.2.2.2 Example
# Structural parametersm =1.f0 =1.ξ =0.1# Instantiation of the Sdof objectsdof =Sdof(m, f0, ξ)# Haversine excitation signalF0 =10.tstart =0.5duration =2.haversine =HaverSine(F0, tstart, duration)t =0.:0.01:10.F =excitation(haversine, t)# Instantiation of the problemu0 = [1, -2]prob =SdofForcedTimeProblem(sdof, F, u0, t, :force)# Solve the problemx_arb_filt =solve(prob, method =:filt).ux_arb_interp =solve(prob, method =:interp).ux_arb_conv =solve(prob, method =:conv).u;
1.3 Additional functions
1.3.1 Impulse response
The impulse response of a sdof system is the response of the system when it is subjected to an impulse excitation. The impulse response is the solution of the following ordinary differential equation: \[
\overset{..}{h}(t) + 2\xi\omega_0\overset{.}{h}(t) + \omega_0^2 h(t) = \frac{\delta(t)}{m}.
\]
It can be shown that the impulse response can be computed by solving the following problem: \[
\begin{cases}
\overset{..}{h}(t) + 2\xi\omega_0\overset{.}{h}(t) + \omega_0^2 h(t) = 0 & \forall t > 0 \\
h(t) = 0 & \text{at } t = 0 \\
\overset{.}{h}(t) = \displaystyle\frac{1}{m} & \text{at } t = 0
\end{cases}.
\]
impulse_response
impulse_response(sdof, t)
Compute the impulse response of a single degree of freedom (Sdof) system
Inputs
sdof: Sdof structure
t: Time points at which to evaluate the response
Output
h: Impulse response
# Structural parametersm =1.f0 =1.ξ =0.1t =0.:0.01:10.# Instantiation of the Sdof objectsdof =Sdof(m, f0, ξ)h =impulse_response(sdof, t)
1.3.2 Shock response spectrum
The shock response spectrum (SRS) is a graph of the peak acceleration response of a sdof system subjected to a base acceleration with respect to the frequency. The SRS is computed by solving the following problem: \[
\ddot z(t) + 2\xi\omega_0\dot z(t) + \omega_0^2 z(t) = -\ddot x_b(t),
\] where \(z(t) = x(t) - x_b(t)\) is the relative displacement of the system with respect to the base.
To compute the SRS, the following steps are performed at a given frequency \(f\):
Instantiate a Sdof type
sdof =Sdof(1., f, ξ)
Compute the time response of the relative displacement \(z(t)\) due to a base acceleration for \(z(0) = 0\) and \(\dot z(0) = 0\).
Compute the acceleration \(\ddot x(t)\) of the system: \[
x(t) = -2\xi\omega_0\dot z(t) - \omega_0^2 z(t)
\]
Extract the primary or secondary part of the acceleration (i.e. until or after the end of the excitation signal).
Compute either:
The peak acceleration of the system such that: \[
SRS(f) = \max\left(|\ddot x(t)|\right)
\]
The maximum positive acceleration of the system such that: \[
SRS(f) = \max\left(\max(\ddot x(t), 0)\right)
\]
The maximum negative acceleration of the system such that: \[
SRS(f) = \max\left(\max(-\ddot x(t), 0)\right)
\]
Several algorithms are available to compute the SRS:
:Basic: the SRS is computed by following the steps mentioned above. It is not the most efficient algorithm but it is the most versatile.
:RecursiveInt: the SRS is computed using a recursive integration algorithm.
:RecursiveFilt: the SRS is computed using a recursive filtering algorithm.
:Smallwood: the SRS is computed using the Smallwood algorithm.
base_acc::ArbitraryExc: Base acceleration type - see excitation function for detatils
freq: Vector of frequencies [Hz]
t: Time points at which to evaluate the response
ξ: Damping ratio (default = 0.05)
type: Type of SRS
instance: Instance of the SRS
:primary: Primary instance (default)
:secondary: Secondary instance
amplitude: Amplitude used of the computing SRS
:abs: Maximum absolute amplitude (default)
:pos: Maximum positive amplitude
:neg: Maximum negative amplitude
alg: Algorithm to compute the SRS
:Basic: Basic algorithm
:RecursiveInt: Recursive integration algorithm
:RecursiveFilt: Recursive filtering algorithm
:Smallwood: Smallwood algorithm (default)
Output
srs: Vector of the SRS values
Note
Primary instance - response of the system during the application of the base acceleration
Secondary instance - response of the system after the application of the base acceleration
# Definition of the base accelerationt =0.:1e-5:0.5base_acc =HalfSine(10., 0., 1e-3)# Compute the SRSf =50.:25:1e3srs_basic =srs(base_acc, f, t)srs_rec_int =srs(base_acc, f, t, alg =:RecursiveInt)srs_rec_filt =srs(base_acc, f, t, alg =:RecursiveFilt)srs_smallwood =srs(base_acc, f, t, alg =:Smallwood)
2 Frequency domain solvers
The package provides solvers for computing the Frequency Response Function (FRF) and the response spectrum of a sdof system.
2.1 Frequency Response Function
The Frequency Response Function (FRF) of a sdof system is the ratio of the steady-state response \(X(\omega)\) of the system to an external excitation \(F(\omega)\) or an external base motion \(X_b(\omega)\). The FRF is computed from the following equation: \[
H(\omega) = \begin{cases}
\displaystyle\frac{1}{m(\omega_0^2 - \omega^2 + 2j\xi\omega\omega_0)} & \text{for a force excitation} \\
\displaystyle\frac{\omega_0^2 + 2j\xi\omega\omega_0}{\omega_0^2 - \omega^2 + 2j\xi\omega\omega_0} & \text{for a base excitation}
\end{cases},
\] where \(j\) is the imaginary unit.
2.1.1 API
Data type
SdofFRFProblem
SdofFRFProblem(sdof, freq, type_exc, type_resp)
Structure containing the data for computing the FRF a sdof system
Fields
sdof::Sdof: Sdof structure
freq::AbstractRange: Vector of frequencies [Hz]
type_exc::Symbol: Type of excitation
:force: External force (default)
:base: Base motion
type_resp::Symbol: Type of response
:dis: Admittance (default)
:vel: Mobility
:acc: Accelerance
Related function
solve
solve(prob::SdofFRFProblem)
Compute the FRF of a single degree of freedom (Sdof) system
Inputs
prob: Structure containing the parameters of the Sdof FRF problem
Output
sol: Solution of the FRF problem
u: FRF of the system
2.1.2 Example
# Structural parametersm =1.f0 =10.ξ =0.01# Instantiation of the Sdof objectsdof =Sdof(m, f0, ξ)# Definition of the frequency rangef =1.:0.1:30.# Instantiation of the problem - Force excitationprob =SdofFRFProblem(sdof, f)# Solve the problemH =solve(prob).u
2.2 Response spectrum
The response spectrum of a sdof system is the frequency response of the system to an external force \(F(\omega)\) or a base motion \(X_b(\omega)\) with respect to the frequency. The response spectrum \(Y(\omega)\) is computed from the following equation: \[
Y(\omega) = \begin{cases}
\displaystyle\frac{F(\omega)}{m(\omega_0^2 - \omega^2 + 2j\xi\omega\omega_0)} & \text{for a force excitation} \\
\displaystyle\frac{(\omega_0^2 + 2j\xi\omega\omega_0) X_b(\omega)}{\omega_0^2 - \omega^2 + 2j\xi\omega\omega_0} & \text{for a base excitation}
\end{cases}.
\]
Structure containing the data for computing the frequency response of a sdof system
Fields
sdof::Sdof: Sdof structure
F::AbstractVector: Vector of the force excitation [N] or base motion [m]
freq::AbstractRange: Vector of frequencies [Hz]
type_exc::Symbol: Type of excitation
:force: External force (default)
:base: Base motion
type_resp::Symbol: Type of response
:dis: Displacement spectrum(default)
:vel: Velocity spectrum
:acc: Acceleration spectrum
Related function
solve
solve(prob::SdofFRFProblem)
Compute the FRF of a single degree of freedom (Sdof) system
Inputs
prob: Structure containing the parameters of the Sdof FRF problem
Output
sol: Solution of the FRF problem
u: FRF of the system
2.2.2 Example
# Structural parametersm =1.f0 =10.ξ =0.01# Instantiation of the Sdof objectsdof =Sdof(m, f0, ξ)# Definition of the frequency rangef =1.:0.1:30.# Instantiation of the problem - Force excitationF =fill(10., length(f))prob =SdofFrequencyProblem(sdof, F, f)# Solve the problemy =solve(prob).u