ExpSine
Exponentially damped sine wave with configurable amplitude, frequency, and damping.
Generates a sinusoidal signal that exponentially decays over time based on the damping coefficient. The signal remains at the offset value until the start time is reached, after which it follows the equation:
This component extends from Signal
Usage
BlockComponents.ExpSine(start_time=0.0, offset=0.0, amplitude, damping, frequency, phase)
Parameters:
| Name | Description | Units | Default value |
|---|---|---|---|
start_time | Time at which the signal starts changing from its offset value | s | 0 |
offset | Constant value added to the signal output | – | 0 |
amplitude | Maximum amplitude of the sine wave | – | |
damping | Coefficient controlling how quickly the sine wave decays | s-1 | |
frequency | Frequency of the sine wave oscillation | Hz | |
phase | Phase angle offset of the sine wave in radians | rad |
Connectors
y- This connector represents a real signal as an output from a component (RealOutput)
Behavior
Source
"""
Exponentially damped sine wave with configurable amplitude, frequency, and damping.
Generates a sinusoidal signal that exponentially decays over time based on the damping coefficient.
The signal remains at the offset value until the start time is reached, after which it follows the
equation:math y(t) = \text{offset} + \text{amplitude} \cdot e^{-\text{damping}\cdot(t-t_{\text{start}})} \cdot \sin(2\pi \cdot \text{frequency} \cdot (t-t_{\text{start}}) + \text{phase})
"""
component ExpSine
extends Signal
"Maximum amplitude of the sine wave"
parameter amplitude::Real
"Coefficient controlling how quickly the sine wave decays"
parameter damping::DampingCoefficient
"Frequency of the sine wave oscillation"
parameter frequency::Frequency
"Phase angle offset of the sine wave in radians"
parameter phase::Angle
relations
y = offset + amplitude * ifelse(time >= start_time, exp(-damping * (time - start_time)) * sin(2 * π * frequency * (time - start_time) + phase), sin(phase))
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
"icons": {"default": "dyad://BlockComponents/ExpSine.svg"}
}
}
endFlattened Source
"""
Exponentially damped sine wave with configurable amplitude, frequency, and damping.
Generates a sinusoidal signal that exponentially decays over time based on the damping coefficient.
The signal remains at the offset value until the start time is reached, after which it follows the
equation:math y(t) = \text{offset} + \text{amplitude} \cdot e^{-\text{damping}\cdot(t-t_{\text{start}})} \cdot \sin(2\pi \cdot \text{frequency} \cdot (t-t_{\text{start}}) + \text{phase})
"""
component ExpSine
"Real-valued output connector for the component"
y = RealOutput() {
"Dyad": {
"placement": {
"icon": {"iconName": "default", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0},
"diagram": {"iconName": "default", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0}
}
}
}
"Time at which the signal starts changing from its offset value"
parameter start_time::Time = 0.0
"Constant value added to the signal output"
parameter offset::Real = 0.0
"Maximum amplitude of the sine wave"
parameter amplitude::Real
"Coefficient controlling how quickly the sine wave decays"
parameter damping::DampingCoefficient
"Frequency of the sine wave oscillation"
parameter frequency::Frequency
"Phase angle offset of the sine wave in radians"
parameter phase::Angle
relations
y = offset + amplitude * ifelse(time >= start_time, exp(-damping * (time - start_time)) * sin(2 * π * frequency * (time - start_time) + phase), sin(phase))
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
"icons": {"default": "dyad://BlockComponents/ExpSine.svg"}
}
}
endTest Cases
No test cases defined.
Related
Examples
Experiments
Analyses
Tests