Pulse
Single pulse generator with configurable amplitude, duration, and start time.
Generates a single rectangular pulse that starts at start_time and lasts for duty_cycle × period duration. The signal stays at amplitude value during the pulse duration and at offset value otherwise. Unlike a periodic pulse train, this component generates only one pulse.
This component extends from Signal
Usage
BlockComponents.Pulse(start_time=0.0, offset=0.0, amplitude, duty_cycle, period)
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 value of the pulse signal | – | |
duty_cycle | Fraction of the period during which output equals amplitude (between 0 and 1) | – | |
period | Duration parameter used with duty_cycle to determine pulse width | s |
Connectors
y- This connector represents a real signal as an output from a component (RealOutput)
Behavior
Source
dyad
# Single pulse generator with configurable amplitude, duration, and start time.
#
# Generates a single rectangular pulse that starts at start_time and lasts for duty_cycle × period duration.
# The signal stays at amplitude value during the pulse duration and at offset value otherwise.
# Unlike a periodic pulse train, this component generates only one pulse.
#
# ```math
# y(t) = \begin{cases}
# \text{amplitude}, & \text{if } t > \text{start\_time} \text{ and } t \leq \text{start\_time} + \text{duty\_cycle} \times \text{period} \\
# \text{offset}, & \text{otherwise}
# \end{cases}
# ```
component Pulse
extends Signal
# Maximum value of the pulse signal
parameter amplitude::Real
# Fraction of the period during which output equals amplitude (between 0 and 1)
parameter duty_cycle::Real
# Duration parameter used with duty_cycle to determine pulse width
parameter period::Time
relations
y = ifelse(time > start_time, ifelse(time <= start_time + duty_cycle * period, amplitude, offset), offset)
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
"icons": {"default": "dyad://BlockComponents/Pulse.svg"}
}
}
endFlattened Source
dyad
# Single pulse generator with configurable amplitude, duration, and start time.
#
# Generates a single rectangular pulse that starts at start_time and lasts for duty_cycle × period duration.
# The signal stays at amplitude value during the pulse duration and at offset value otherwise.
# Unlike a periodic pulse train, this component generates only one pulse.
#
# ```math
# y(t) = \begin{cases}
# \text{amplitude}, & \text{if } t > \text{start\_time} \text{ and } t \leq \text{start\_time} + \text{duty\_cycle} \times \text{period} \\
# \text{offset}, & \text{otherwise}
# \end{cases}
# ```
component Pulse
# 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 value of the pulse signal
parameter amplitude::Real
# Fraction of the period during which output equals amplitude (between 0 and 1)
parameter duty_cycle::Real
# Duration parameter used with duty_cycle to determine pulse width
parameter period::Time
relations
y = ifelse(time > start_time, ifelse(time <= start_time + duty_cycle * period, amplitude, offset), offset)
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
"icons": {"default": "dyad://BlockComponents/Pulse.svg"}
}
}
endTest Cases
No test cases defined.
Related
Examples
Experiments
Analyses
Tests