Longitudinal bars, torsional rods and strings are governed by the wave equation, which can be written under the following form: \[
m \ddot y(x, t) - D \frac{\partial^2 y(x,t)}{\partial x^2} = p(x, t),
\] where:
\(y(x, t)\): Kinematic data at location \(x\) and time \(t\)
\(p(x, t)\): External excitation term
\(m\): Linear inertia of the type
\(D\): Stiffness of the type
For a longitudinal bar:
\(y(x, t) = u(x, t)\)
\(u(x, t)\): Longitudinal displacement [m]
\(p(x, t)\): Distributed longitudinal force [N/m]
\(m = \rho S\): Linear mass density [kg/m2]
\(\rho\): Mass density [kg/m3]
\(S\): Cross-section area [m2]
\(D = E S\): Longitudinal stiffness [N]
\(E\): Young’s modulus [Pa]
For a torsional rod:
\(y(x, t) = \theta(x, t)\)
\(\theta\): Torsion angle [rad]
\(p(x, t)\): Distributed moment [N.m/m]
\(m = \rho I_G\): Linear rotational inertia [kg.m4]
\(I_G\): Polar moment of area [m4]
\(D = G J_T\): Rotational stiffness [N.m2]
\(G\): Shear modulus [Pa]
\(J_T\): Torsion constant [m4]
For a string:
\(y(x, y)\): Transverse displacement [m]
\(m\): Linear mass density [kg/m]
\(D\): Tension force [N]
1.1.2 Euler-Bernoulli beams
Euler-Bernoulli beams are governed by the following equation of motion: \[
m\ddot v(x, t) + D\frac{\partial^4 v(x, t)}{\partial x^4} = p(x, t),
\] where:
\(v(x, t)\): Transverse displacement [m]
\(p(x, t)\): External excitation term [N/m]
\(m = \rho S\): Linear mass density [kg/m]
\(D = E I_z\): Bending stiffness [N.m2]
\(I_z\): Second moment of area [m4]
1.1.3 API
Data types
All the following data types are a subtype of the super type OneDtype.
Bar
Bar(L, S, E, ρ)
Structure containing the data of a homogeneous and isotropic longitudinal bar
Constructor parameters
L: Length [m]
S: Cross-section area [m²]
E: Young's modulus [Pa]
ρ: Mass density [kg/m³]
Fields
L: Length [m]
m: Line mass [kg/m]
D: Stiffness coefficient [Pa]
Rod
Rod(L, I, J, G, ρ)
Structure containing the data of a homogeneous and isotropic torsional bar
Constructor parameters
L: Length [m]
I: Second-moment of area [m⁴]
J: Torsion constant [m⁴]
G: Shear modulus [Pa]
ρ: Mass density [kg/m³]
Fields
L: Length [m]
m: Line mass [kg/m]
D: Stiffness coefficient [Pa]
Strings
Strings(L, S, D, ρ)
Structure containing the data of a homogeneous and isotropic string
Constructor parameters
L: Length [m]
S: Cross-section area [m²]
D: Tension [N]
ρ: Mass density [kg/m³]
Fields
L: Length [m]
m: Linear mass density [kg/m]
D: Tension [N]
Beam
Beam(L, S, I, E, ρ)
Structure containing the data of a homogeneous and isotropic bending beam
Constructor parameters
L: Length [m]
S: Cross-section area [m²]
I: Second moment of area [m⁴]
E: Young's modulus [Pa]
ρ: Density [kg/m³]
Fields
L: Length [m]
M: Linear mass density [kg/m]
D: Bending stiffness [N.m²]
Related functions
modefreq
modefreq(model::Bar, fmax, bc = :CC)
modefreq(model::Rod, fmax, bc = :CC)
modefreq(model::Strings, fmax, bc = :CC)
modefreq(model::Beam, fmax, bc = :SS)
Computes the natural frequencies of a longitudinal or torsional bar up to fmax
Inputs
model: Structure containing the bar data
fmax: Maximum frequency for calculating the mode shapes [Hz]
bc: Boundary conditions
For all OneDStructure
:CC: Clamped - Clamped
:CF: Clamped - Free
:FF: Free - Free
For beams
:SS: Simply Supported - Simply Supported
:SC: Simply Supported - Clamped
:SF: Simply Supported - Free
Outputs
ωn: Natural frequencies calculated up to ωmax = 2π*fmax [Hz]
kn: Vector of modal wavenumbers
modeshape
modeshape(model::Bar, kn, x, bc = :CC)
modeshape(model::Rod, kn, x, bc = :CC)
modeshape(model::Strings, kn, x, bc = :CC)
modeshape(model::Beam, kn, x, bc = :SS)
Computes the mass-normalized mode shapes of a longitudinal or torsional bar
Inputs
model: Structure containing the bar data
kn: Array of modal wavenumbers
x: Coordinates of calculation points of the mode shapes
bc: Boundary conditions
For all OneDStructure
:CC: Clamped - Clamped
:CF: Clamped - Free
:FF: Free - Free
For beams
:SS: Simply Supported - Simply Supported
:SC: Simply Supported - Clamped
:SF: Simply Supported - Free
Output
ϕ: Mass-normalized mode shapes
1.1.4 Example
# DimensionsL =1.d =3e-2# Section featuresS =π*d^2/4Iz =π*d^4/64IG =2IzJ = IG# Tension for stringT =100.# MaterialE =2.1e11ν =0.33G = E/(1-2*ν)ρ =7800.# Computation parametersfmax =2000.x = [0.1, 0.9]# Initialization of the data typesbar =Bar(L, S, E, ρ)rod =Rod(L, IG, J, G, ρ)strings =Strings(L, S, T, ρ)beam =Beam(L, S, Iz, E, ρ)# Computation of the natural frequenciesωn, kn =modefreq(bar, fmax)# Computation of the corresponding mode shapesϕn =modeshape(bar, kn, x, :CC)
1.2 2D models
1.2.1 Rectangular membranes
Rectangular membranes are governed by the following equation of motion: \[
m \ddot w(x, y ,t) + D\Delta w(x, y, t) = p(x, y, t),
\] where:
\(w(x, y, t)\): Transverse displacement [m] at point \((x, y)\) and time \(t\)
Rectangular Kirchhoff-Love plates are governed by the following equation of motion: \[
m \ddot w(x, y, t) + D \Delta^2 w(x, y, t) = p(x, y, t),
\] where:
\(w(x, y, t)\): Transverse displacement [m] at point \((x, y)\) and time \(t\)
Computes the mass-normalized mode shapes of a simply supported rectangular plate or a clamped rectangular membrane
Inputs
model: Structure containing the data related to the structure
kmn: Matrix of modal wave numbers
(x, y): Coordinates of the points where the mode shapes are calculated
Output
ϕ: Mass-normalized mode shapes
1.2.4 Example
# DimensionsLp =0.6bp =0.4hp =1e-3# Material parametersE =2.1e11ρ =7800.ν =0.33# Computation parametersfmax =1000.xp = [0.1, 0.5]yp = [0.1, 0.3]# Initialization of the data typesplate =Plate(Lp, bp, hp, E, ρ, ν)# Computation of the natural frequenciesωn, kn =modefreq(plate, fmax)# Computation of the corresponding mode shapesϕn =modeshape(plate, kn, xp, yp)
2 Discrete models
2.1 Sdof systems
Single degree of freedom (Sdof) systems are classically composed of a mass \(m\), a stiffness \(k\) and a viscous damper \(c\) (see Figure 1).
Figure 1: Classical representation of an Sdof system
Mathematically, their dynamic behavior is governed by the following normalized equation of motion : \[
\ddot x(t) + 2\xi\,\omega_0\, \dot x(t) + \omega_0^2 x(t) = \frac{F(t)}{m}.
\] where \(F(t)\) can be either a base or an external excitation applied to the system.
The Sdof system can thus be defined by:
its mass \(m\)
its natural angular frequency \(\omega_0\) (or its natural frequency \(f_0\))
its damping ratio \(\xi\)
2.1.1 API
Sdof
Sdof(m, ω0, ξ)
Structure containing the data of a sdof system
Constructor
m: Mass [kg]
f0: Natural frequency [Hz]
ξ: Damping ratio
Fields
m: Mass [kg]
ω0: Natural frequency [rad/s]
ξ: Damping ratio
2.1.2 Example
# Definition of the structural parametersm =1.f₀ =10.ξ =0.01# Initialization of Sdofsdof =Sdof(m, f₀, ξ)
2.2 Mdof systems
StructuralVibration.jl considers Multi-degrees of freedom (Mdof) systems, which topology is presented in Figure 2. This choice has been made, because it allows modeling a large variety of possible configurations.
Figure 2: General topology of an Mdof system
The dynamic behavior of such a system is governed by the following matrix system: \[
\mathbf{M} \ddot{\mathbf{x}}(t) + \mathbf{K}\mathbf{x}(t) = \mathbf{f}(t),
\] where:
\(\mathbf{M} = \text{diag}(m_1, \dots, m_j, \dots, m_N)\) is the mass matrix.
# DimensionsL =1.d =3e-2# Section featuresS =π*d^2/4Iz =π*d^4/64# MaterialE =2.1e11ρ =7800.# Computation parametersfmax =2000.# Initialization of the data typesbeam =Beam(L, S, Iz, E, ρ)# Mesh definitiononed_mesh =OneDMesh(beam, 0., 20, :SS)# Construction of K and MKfe, Mfe =assembly(beam, oned_mesh)# Application of the BCsKbc =apply_bc(Kfe, oned_mesh)Mbc =apply_bc(Mfe, oned_mesh)# Computation ofthe eigenmodes of the structureωfe, Φfe =eigenmode(Kbc, Mbc)# Calculation of the damping matrixCray =rayleigh_damping_matrix(Kbc, Mbc, 1., 1.)Cmodal =modal_damping_matrix(Mbc, ωfe, 0.01, Φfe)
3 State space representation
The state space representation of a mechanical system is expressed as: \[
\dot{\mathbf{z}}(t) = \mathbf{A}_c \mathbf{z}(t) + \mathbf{B}_c \mathbf{u}(t),
\] where:
\(\mathbf{z}(t)\): State vector
\(\mathbf{u}(t)\): Input vector
\(\mathbf{A}_c\): System matrix
\(\mathbf{B}_c\): Input matrix
3.1 Continuous-time models
For a mechanical system, whose equation of motion is: \[
\mathbf{M}\ddot{\mathbf{x}}(t) + \mathbf{C}\dot{\mathbf{x}}(t) + \mathbf{K x}(t) = \mathbf{u}(t),
\] the corresponding continuous-time state equation is given by: \[
\begin{bmatrix}
\dot{\mathbf{x}}(t) \\
\ddot{\mathbf{x}}(t)
\end{bmatrix} = \begin{bmatrix}
\mathbf{0} & \mathbf{I} \\
-\mathbf{M}^{-1}\mathbf{K} & -\mathbf{M}^{-1}\mathbf{C}
\end{bmatrix}\begin{bmatrix}
\mathbf{x}(t) \\
\dot{\mathbf{x}}(t)
\end{bmatrix}+ \begin{bmatrix}
\mathbf{0} \\
\mathbf{M}^{-1}
\end{bmatrix}\mathbf{u}(t).
\]
When using a modal expansion such that \[
\mathbf{x}(t) = \mathbf{\Phi}\mathbf{q}(t),
\] where \(\mathbf{\Phi}\) is the mode shapes matrix and \(\mathbf{q}(t)\) is the modal coordinate vector, a modal state space equation can be obtained. The latter is written: \[
\begin{bmatrix}
\dot{\mathbf{q}}(t) \\
\ddot{\mathbf{q}}(t)
\end{bmatrix} = \begin{bmatrix}
\mathbf{0} & \mathbf{I} \\
-\mathbf{\Omega}^2 & -\mathbf{\Xi}
\end{bmatrix}\begin{bmatrix}
\mathbf{q}(t) \\
\dot{\mathbf{q}}(t)
\end{bmatrix}+ \begin{bmatrix}
\mathbf{0} \\
\mathbf{\Phi}^\mathsf{T}
\end{bmatrix}\mathbf{u}(t),
\] where \(\mathbf{\Omega}^2 = \text{diag}(\omega_1^2, \dots, \omega_N^2)\) and \(\mathbf{\Xi} = \text{diag}(2\xi_1\omega_1, \dots, 2\xi_N\omega_N)\).
3.1.1 API
Data type
ContinuousStateSpace
ContinuousStateSpace(Ac, Bc)
Continuous-time state-space model
Fields
Ac: Continuous-time state matrix A
Bc: Continuous-time input matrix B
Related functions
ss_model
ss_model(K, M, C)
Generates a continuous-time state-space model from the mass, damping, and stiffness matrices
Inputs
K: Stiffness matrix
M: Mass matrix
C: Damping matrix
Output
css: ContinuousStateSpace
ss_modal_model
ss_modal_model(ωn, ξn, ϕn)
Generates a continuous-time state-space model from the mass, damping, and stiffness matrices
Inputs
ωn: Natural angular frequencies
ξn: Damping ratios
ϕn: Mass-normalized mode shapes
Output
css: ContinuousStateSpace
eigenmode
eigenmode(K, M, n = size(K, 1))
Computes the eigenmodes of a system defined by its mass and stiffness matrices.
Inputs
K: Stiffness matrix
M: Mass matrix
n: Number of modes to be keep in the modal basis
Outputs
ω: Vector of natural frequencies
Φ: Mass-normalized mode shapes
modal_parameters
modal_parameters(λ)
Computes the natural angular frequencies and damping ratios from the complex eigenvalues
Input
λ: Complex eigenvalues
Outputs
ωn: Natural angular frequencies
ξn: Damping ratios
c2r_modeshape
c2r_modeshape(Ψ)
Converts the complex modes to real modes
Input
Ψ: Complex modes
Output
ϕn: Real modes
3.1.2 Example
# System matricesm_ss =Diagonal([2., 1.])k_ss = [6. -2.; -2. 4.]c_ss = [0.67-0.11; -0.110.39]# Continuous-time state space from system matricescss =ss_model(k_ss, m_ss, c_ss)λ, Ψ =eigenmode(css.Ac)ω, ξ =modal_parameters(λss)Ψr =c2r_modeshape(Ψ)# Continuous-time state space from modal informationωn, ϕn =eigenmode(k_ss, m_ss)css_modal =ss_modal_model(ωn, 0.01, ϕn)
3.2 Discrete-time models
Discrete-time models can be either be obtained using sampled strategies from direct-time integration methods (e.g. Newmark’s scheme). However, both approaches lead to a discrete-time state equation of the form: \[
\mathbf{z}_{k+1} = \mathbf{A}\, \mathbf{z}_k + \mathbf{B}_f\, \mathbf{u}_k + \mathbf{B}_g\, \mathbf{u}_{k+1},
\]
The previous formulation is rather non-standard, since the state vector at frequency step \(k + 1\) requires the knowledge of the input vector at time steps \(k\) and \(k + 1\). To reduce the state-space representation to its standard form, a reduced state \(\mathbf{\overline{z}}_{k+1}\) is introduced: \[
\mathbf{z}_{k+1} = \mathbf{A}\, \mathbf{x}_k + \mathbf{B}_f\, \mathbf{u}_k,
\]
In doing so, the discretized state equation becomes: \[
\mathbf{\overline{z}}_{k+1} = \mathbf{A}\, \mathbf{\overline{z}}_k + \mathbf{B}\, \mathbf{u}_k
\] where \(\mathbf{B} = \mathbf{B}_f + \mathbf{A\, B}_g\).
3.2.1 Sampling methods
Sampling methods are based on the discretization of the solution of the continuous-time state equation. Once discretized, the state equation can be written as: \[
\mathbf{z}_{k+1} = \mathbf{A} \, \mathbf{z}_k + \mathbf{A}\, \int_{0}^{h} e^{-\mathbf{A_c}\tau}\, \mathbf{B_c}\,\mathbf{u}(\tau + kh)\, d\tau,
\] where \(\mathbf{A} = e^{\mathbf{A_c} h}\) is the the discretized system matrix and \(h\) is the discretization timestep.
To cover a wide range of situations, the input vector is assumed to be parameterized as follows: \[
\mathbf{u}(\tau + kh) = f(\tau)\, \mathbf{u}_k + g(\tau)\, \mathbf{u}_{k+1},
\] where the basis function \(f(\tau)\) and \(g(\tau)\) control the evolution of the input vector between two time steps.
Introducing the parameterization of the input vector into the convolution integral, one obtains the following state equation: \[
\mathbf{z}_{k+1} = \mathbf{A}\, \mathbf{z}_k + \mathbf{B}_f\, \mathbf{u}_k + \mathbf{B}_g\, \mathbf{u}_{k+1},
\] where \(\mathbf{B}_f\) and \(\mathbf{B}_g\) are the discretized input matrices defined such that: \[
\mathbf{B}_f = \mathbf{A}\, \int_{0}^{h} e^{-\mathbf{A_c}\tau}\, \mathbf{B_c}\,f(\tau)\, d\tau \; \text{ and } \; \mathbf{B}_g = \mathbf{A}\, \int_{0}^{h} e^{-\mathbf{A_c}\tau}\, \mathbf{B_c}\,g(\tau)\, d\tau.
\]
In the literature, the most commonly used sampling methods are the following1:
The Zero-Order Hold (ZOH) strategy, which assumes that the input vector is constant between two samples. This assumption is satisfied for \(f(\tau) = 1\) and \(g(\tau) = 0\) and leads to: \[
\mathbf{B} = \mathbf{B}_f = (\mathbf{A} - \mathbf{I})\, \mathbf{A}_\mathbf{c}^{-1}\, \mathbf{B_c}.
\]
The First-Order Hold (FOH) sampling method, which assumes that the input vector varies linearly between two samples. This assumption is satisfied for \(f(\tau) = 1 - \tau/h\) and \(g(\tau) = \tau/h\) and leads to: \[
\begin{split}
&\mathbf{B}_f + \mathbf{B}_g = (\mathbf{A} - \mathbf{I})\, \mathbf{A}_\mathbf{c}^{-1}\, \mathbf{B_c}, \\
&\mathbf{B}_g = (\mathbf{A} - \mathbf{A_c}h - \mathbf{I})\mathbf{A}_\mathbf{c}^{-2}\, \mathbf{B_c}/h.
\end{split}
\]
The Band-Limited Hold (BLH) sampling method, which assumes that the input signal can be approximated as a band-limited signal (i.e. the energy of the signal is concentrated in a defined frequency range). This assumption is satisfied for \(f(\tau) = h\, \delta(\tau)\) and \(g(\tau) = 0\), where \(\delta(\tau)\) is the Dirac delta function and leads to: \[
\mathbf{B} = \mathbf{B}_f = \mathbf{A}\, \mathbf{B_c}\, h.
\]
3.2.2 Direct-time integration based methods
Despite several methods can be found in the literature, such as the Newmark’s family schemes, this package only provides the Runge-Kutta approach, because it is an explicit method (i.e. does not require any matrix inversion). After some calculation not detailed here2, the discrete system and input matrices are expressed as: \[
\begin{split}
&\mathbf{A} = \frac{1}{24}\left[24\,(\mathbf{I} + \mathbf{A_c}\, h) + 12\, \mathbf{A}_\mathbf{c}^2\, h^2 + 4\, \mathbf{A}_\mathbf{c}^3\, h^3 + \mathbf{A}_\mathbf{c}^4\, h^4\right], \\
&\mathbf{B}_f = \frac{h}{24}\left[12\, \mathbf{I} + 8\, \mathbf{A_c}\, h + 3 \mathbf{A}_\mathbf{c}^2\, h^2 + \mathbf{A}_\mathbf{c}^3\, h^3\right]\mathbf{B_c}, \\
&\mathbf{B}_g = \frac{h}{24}\left[12\, \mathbf{I} + 4\, \mathbf{A_c}\, h + \mathbf{A}_\mathbf{c}^2\, h^2\right]\mathbf{B_c}.
\end{split}
\]
3.2.3 API
Data type
DiscreteStateSpace
DiscreteStateSpace(Ad, Bd, Bdp)
Discrete-time state-space model
Fields
Ad: Discrete-time state matrix A
Bd: Discrete-time input matrix B
Bdp: Discrete-time input matrix Bp (only for :foh method)
Converts a continuous-time state-space model to a discrete-time state-space model.
Inputs
css: Continuous-time state-space model
h: Sampling time.
method: Discretization method
:zoh: Zero-order Hold method
:foh: First-order Hold method
:blh: Band-limited Hold method
:rk4: 4th order Runge-Kutta method
Output
DiscreteStateSpace: Discrete-time state-space model
Ad: Discrete-time state-space matrix A
Bd: Discrete-time state-space matrix B
Bdp: Discrete-time state-space matrix Bp (only for :foh and :rk4 methods)
3.2.4 Example
dss =c2d(css, 0.01, :zoh)
Footnotes
D. Bernal. “Optimal discrete to continuous transfer for band limited inputs”, Journal of Engineering Mechanics, vol. 133 (12), pp. 1370-1377, 2007.↩︎
For further details, see: J. Ghibaudo. “Inverse estimation of sparse mechanical excitation sources by Bayesian filtering”, PhD thesis, Conservatoire national des arts et métiers, 2024.↩︎