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
— TypeOscillator{T<:Float64}
Custom type to represent a SDOF oscillator. The type has two fields:
f_n
is the natural frequency of the oscillatorζ_n
is the damping ratio
Examples
sdof = Oscillator( 1.0, 0.05 )
## Functionality
The main methods that are used to interact with Oscillator
instances are:
StochasticGroundMotionSimulation.period
— Functionperiod(sdof::Oscillator)
Natural period (s) of the sdof Oscillator.
StochasticGroundMotionSimulation.transfer
— Functiontransfer(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<:Real
Computes the modulus of the transfer function of a SDOF for a vector of frequencies
f::Vector
is the vector of frequenciessdof::Oscillator
is the oscillator instance
Examples
f = collect(range(0.1, stop=10.0, step=0.01))
sdof = Oscillator(1.0)
Hf = transfer(f, sdof)
StochasticGroundMotionSimulation.transfer!
— Functiontransfer!(Hf::Vector{T}, f::Vector{T}, sdof::Oscillator) where T<:Real
Computes 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)
StochasticGroundMotionSimulation.squared_transfer
— Functionsquared_transfer(f, sdof::Oscillator)
Compute the square of the transfer function for a SDOF system, sdof
, at frequency f
.
Examples
f = 2.0
# create sdof with natural frequency f_n=1.0 and damping ζ=0.05
sdof = Oscillator( 1.0, 0.05 )
Hf2 = squared_transfer( f, sdof )
See also: transfer
StochasticGroundMotionSimulation.squared_transfer!
— Functionsquared_transfer!(Hf2::Vector{T}, f::Vector{T}, sdof::Oscillator) where T<:Real
Computes 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)