Skip to content

Stochastic Processes (Spectral Representation)

Stochastic process generation based on the Spectral Representation Method which utilizes Power Spectral Density Functions. Correpsonding theory and literature can be found here Stochastic-Process-Generation.

Index

Types and Spectral Representation functions

UncertaintyQuantification.SpectralRepresentation Method
julia
SpectralRepresentation(psd::AbstractPowerSpectralDensity, time::AbstractVector{<:Real}, name::Symbol) -> SpectralRepresentation

Constructs a SpectralRepresentation instance representing a stochastic process generated using the spectral representation method.

Arguments

  • psd::AbstractPowerSpectralDensity: An instance of a power spectral density model.

  • time::AbstractVector{<:Real}: A vector of time points.

  • name::Symbol: A symbol representing the name of the process.

Returns

A SpectralRepresentation instance with the given arguments (parameters).

Example

julia
w = 0:0.1:10
S_0 = 1.0
ω_f = 2.0
ζ_f = 0.05
ω_g = 3.0
ζ_g = 0.1
psd = CloughPenzien(w, S_0, ω_f, ζ_f, ω_g, ζ_g)
t = 0:0.1:10
name = :process1
sr = SpectralRepresentation(psd, t, name)

source

UncertaintyQuantification.sample Function
julia
sample(sr::SpectralRepresentation, n::Integer=1) -> DataFrame

Generates samples of random phase angles for a given SpectralRepresentation instance.

Arguments

  • sr::SpectralRepresentation: An instance of the SpectralRepresentation struct.

  • n::Integer=1: The number of samples to generate (default is 1).

Returns

A DataFrame containing the generated samples of random phase angles.

Example

julia
w = 0:0.1:10
psd = CloughPenzien(w, 1.0, 2.0, 0.05, 3.0, 0.1)
t = 0:0.1:10
name = :process1
sr = SpectralRepresentation(psd, t, name)
samples = sample(sr, 5)

source

UncertaintyQuantification.evaluate Method
julia
evaluate(sr::SpectralRepresentation, ϕ::AbstractVector{<:Real}) -> AbstractVector{<:Real}

Evaluates the stochastic process for a given SpectralRepresentation instance and a vector of random phase angles.

Arguments

  • sr::SpectralRepresentation: An instance of the SpectralRepresentation struct.

  • ϕ::AbstractVector{<:Real}: A vector of random phase angles.

Returns

A vector of real numbers representing the evaluated stochastic process.

Example

julia
w = 0:0.1:10
psd = CloughPenzien(w, 1.0, 2.0, 0.05, 3.0, 0.1)
t = 0:0.1:10
name = :process1
sr = SpectralRepresentation(psd, t, name)
ϕ = rand(Uniform(0, ), length(psd.ω))
process_values = evaluate(sr, ϕ)

source

UncertaintyQuantification.to_standard_normal_space! Method
julia
to_standard_normal_space!(sr::SpectralRepresentation, df::DataFrame) -> Nothing

Transforms the random phase angles in the given DataFrame from a uniform distribution to a standard normal distribution.

Arguments

  • sr::SpectralRepresentation: An instance of the SpectralRepresentation struct.

  • df::DataFrame: A DataFrame containing the random phase angles to be transformed.

Returns

Nothing. The DataFrame is modified in place.

Example

julia
w = 0:0.1:10
psd = CloughPenzien(w, 1.0, 2.0, 0.05, 3.0, 0.1)
t = 0:0.1:10
name = :process1
sr = SpectralRepresentation(psd, t, name)
samples = sample(sr, 5)
to_standard_normal_space!(sr, samples)

source

UncertaintyQuantification.to_physical_space! Method
julia
to_physical_space!(sr::SpectralRepresentation, df::DataFrame) -> Nothing

Transforms the random phase angles in the given DataFrame from a standard normal distribution to a uniform distribution.

Arguments

  • sr::SpectralRepresentation: An instance of the SpectralRepresentation struct.

  • df::DataFrame: A DataFrame containing the random phase angles to be transformed.

Returns

Nothing. The DataFrame is modified in place.

Example

julia
w = 0:0.1:10
psd = CloughPenzien(w, 1.0, 2.0, 0.05, 3.0, 0.1)
t = 0:0.1:10
name = :process1
sr = SpectralRepresentation(psd, t, name)
samples = sample(sr, 5)
to_standard_normal_space!(sr, samples)  # Transform to standard normal space
to_physical_space!(sr, samples)         # Transform back to physical space

source

UncertaintyQuantification.dimensions Method
julia
dimensions(sr::SpectralRepresentation) -> Int

Returns the number of dimensions (frequencies) in the given SpectralRepresentation instance.

Arguments

  • sr::SpectralRepresentation: An instance of the SpectralRepresentation struct.

Returns

An integer representing the number of dimensions (frequencies).

Example

julia
w = 0:0.1:10
psd = CloughPenzien(w, 1.0, 2.0, 0.05, 3.0, 0.1)
t = 0:0.1:10
name = :process1
sr = SpectralRepresentation(psd, t, name)
num_dimensions = dimensions(sr)

source

Base.names Method
julia
names(sr::SpectralRepresentation) -> Vector{Symbol}

Returns the names of the random phase angles for a given SpectralRepresentation instance.

Arguments

  • sr::SpectralRepresentation: An instance of the SpectralRepresentation struct.

Returns

A vector of symbols representing the names of the random phase angles.

Example

julia
w = 0:0.1:10
psd = CloughPenzien(w, 1.0, 2.0, 0.05, 3.0, 0.1)
t = 0:0.1:10
name = :process1
sr = SpectralRepresentation(psd, t, name)
phase_angle_names = names(sr)

source