---
url: /dyad/stable/stdlib/BlockComponents/components/Sources.Pulse.md
description: >-
  Dyad Sources.Pulse docs.  Single pulse generator with configurable amplitude,
  duration, and start time.
---

# `Sources.Pulse` {#Sources.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.

$$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}$$

This component extends from [`BlockComponents.Interfaces.Signal`](../types/Interfaces.Signal.md)

## Usage {#Usage}

`BlockComponents.Sources.Pulse(start_time=0.0, offset=0.0, amplitude, duty_cycle, period)`

## Parameters: {#Parameters:}

|         Name |                                                                   Description | Units | Default value |
| ------------:| -----------------------------------------------------------------------------:| -----:| -------------:|
| `start_time` |                Time at which the signal starts changing from its offset value |     s |           0.0 |
|     `offset` |                                     Constant value added to the signal output |     – |           0.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 {#Connectors}

* `y` - This connector represents a real signal as an output from a component ([`RealOutput`](/stdlib/Dyad/connectors/RealOutput#RealOutput))

## Behavior {#Behavior}

$$ \begin{align}
y\left( t \right) &= ifelse\left( \mathtt{start_time} < t, ifelse\left( t \leq \mathtt{start_time} + \mathtt{duty_cycle} ~ \mathtt{period}, \mathtt{amplitude}, \mathtt{offset} \right), \mathtt{offset} \right)
\end{align}
$$

## Source {#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 BlockComponents.Interfaces.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"}
  }
}
end
````

````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"}
  }
}
end
````

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`Integrator`](Sources.Pulse.md)

  * [`Pulse`](Sources.Pulse.md)

  * [`Pulse`](Sources.Pulse.md)
