ExpSineTest
Test component that connects an exponentially damped sine wave to an integrator for validation.
This component instantiates an ExpSine signal generator with configurable parameters and connects its output to an Integrator block to test the integration of a damped sinusoidal signal. The ExpSine generates a signal according to:
Usage
ExpSineTest()
Behavior
Source
# Test component that connects an exponentially damped sine wave to an integrator for validation.
#
# This component instantiates an ExpSine signal generator with configurable parameters and connects
# its output to an Integrator block to test the integration of a damped sinusoidal signal. The ExpSine
# generates a signal according to:
#
# ```math
# y = offset + amplitude \cdot e^{-damping \cdot (t-start\_time)} \cdot \sin(frequency \cdot (t-start\_time) + phase)
# ```
test component ExpSineTest
# Integrator block that accumulates the input signal
integrator = Integrator()
# Exponentially damped sine wave generator with specified parameters
signal = ExpSine(amplitude = 1, damping = 0.5, frequency = 2, start_time = 0.5, offset = 0.5, phase = 3.14)
relations
# Connects the exponentially damped sine output to the integrator input
connect(signal.y, integrator.u)
metadata {
"Dyad": {
"tests": {
"case1": {
"stop": 7,
"atol": {"signal.y": 0.001, "integrator.x": 0.001},
"expect": {
"initial": {"signal.y": 0.5},
"signals": ["signal.y", "integrator.x"],
"final": {"signal.y": 0.50006, "integrator.x": 3.42361}
}
}
}
}
}
endFlattened Source
# Test component that connects an exponentially damped sine wave to an integrator for validation.
#
# This component instantiates an ExpSine signal generator with configurable parameters and connects
# its output to an Integrator block to test the integration of a damped sinusoidal signal. The ExpSine
# generates a signal according to:
#
# ```math
# y = offset + amplitude \cdot e^{-damping \cdot (t-start\_time)} \cdot \sin(frequency \cdot (t-start\_time) + phase)
# ```
test component ExpSineTest
# Integrator block that accumulates the input signal
integrator = Integrator()
# Exponentially damped sine wave generator with specified parameters
signal = ExpSine(amplitude = 1, damping = 0.5, frequency = 2, start_time = 0.5, offset = 0.5, phase = 3.14)
relations
# Connects the exponentially damped sine output to the integrator input
connect(signal.y, integrator.u)
metadata {
"Dyad": {
"tests": {
"case1": {
"stop": 7,
"atol": {"signal.y": 0.001, "integrator.x": 0.001},
"expect": {
"initial": {"signal.y": 0.5},
"signals": ["signal.y", "integrator.x"],
"final": {"signal.y": 0.50006, "integrator.x": 3.42361}
}
}
}
}
}
endTest Cases
Test Case case1
julia
pltjulia
pltRelated
Examples
Experiments
Analyses
Tests