Single Degree of Freedom Oscillator Parameters
Definition of the custom type, Oscillator to represent a single degree of freedom (SDOF) oscillator. Type simply stores the oscillator frequency and damping ratio.
StochasticGroundMotionSimulation.Oscillator — Type
Oscillator{T<:Float64}Custom type to represent a SDOF oscillator. The type has two fields:
f_nis the natural frequency of the oscillatorζ_nis the damping ratio
Examples
sdof = Oscillator( 1.0, 0.05 )source## Functionality
The main methods that are used to interact with Oscillator instances are:
StochasticGroundMotionSimulation.period — Function
StochasticGroundMotionSimulation.transfer — Function
transfer(f::T, sdof::Oscillator) where {T<:Real}Compute the modulus of the transfer function for a SDOF system.
The transfer function is defined as:
\[|H(f,f_n,\zeta_n)| = \frac{1}{\sqrt{ \left(1 - \beta^2 \right)^2 + \left(2\zeta_n\beta\right)^2 }}\]
where $\beta$ is the tuning ratio defined by $f/f_n$.
Examples
f = 2.0
sdof = Oscillator(1.0, 0.05)
Hf = transfer(f, sdof)See also: squared_transfer
transfer(f::Vector{T}, sdof::Oscillator) where T<:RealComputes the modulus of the transfer function of a SDOF for a vector of frequencies
f::Vectoris the vector of frequenciessdof::Oscillatoris the oscillator instance
Examples
f = collect(range(0.1, stop=10.0, step=0.01))
sdof = Oscillator(1.0)
Hf = transfer(f, sdof)sourceStochasticGroundMotionSimulation.transfer! — Function
transfer!(Hf::Vector{T}, f::Vector{T}, sdof::Oscillator) where T<:RealComputes the modulus of the transfer function of a SDOF for a vector of frequencies in place - Hf::Vector is the pre-allocated vector into which the results are stored - f::Vector is the vector of frequencies - sdof::Oscillator is the oscillator instance
Examples
f = collect(range(0.1, stop=10.0, step=0.01))
sdof = Oscillator(1.0)
Hf = similar(f)
transfer!(Hf, f, sdof)sourceStochasticGroundMotionSimulation.squared_transfer! — Function
squared_transfer!(Hf2::Vector{T}, f::Vector{T}, sdof::Oscillator) where T<:RealComputes the square of the modulus of the transfer function of a SDOF for a vector of frequencies in place: - Hf2::Vector is the pre-allocated vector into which the results are stored - f::Vector is the vector of frequencies - sdof::Oscillator is the oscillator instance Inputs derive from the Real type and so are differentiable.
Examples
f = collect(range(0.1, stop=10.0, step=0.01))
sdof = Oscillator(1.0)
Hf2 = similar(f)
squared_transfer!(Hf2, f, sdof)source