Skip to content
Signal.md

Signal

Base component for signal generators that output time-varying signals.

Provides common parameters for time-based signals including when the signal should start and the baseline offset value from which the signal varies. All signal generators should extend this component to maintain consistent interface and behavior across the signal library.

This component extends from SO

Usage

Signal(start_time=0.0, offset=0.0)

Parameters:

NameDescriptionUnitsDefault value
start_timeTime at which the signal starts changing from its offset values0
offsetConstant value added to the signal output0

Connectors

  • y - This connector represents a real signal as an output from a component (RealOutput)

Source

dyad
# Base component for signal generators that output time-varying signals.
#
# Provides common parameters for time-based signals including when the signal should start
# and the baseline offset value from which the signal varies. All signal generators should
# extend this component to maintain consistent interface and behavior across the signal library.
partial component Signal
  extends SO
  # 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
end
Flattened Source
dyad
# Base component for signal generators that output time-varying signals.
#
# Provides common parameters for time-based signals including when the signal should start
# and the baseline offset value from which the signal varies. All signal generators should
# extend this component to maintain consistent interface and behavior across the signal library.
partial component Signal
  # Real-valued output connector for the component
  y = RealOutput() [{"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}]
  # 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
metadata {}
end


Test Cases

This is setup code, that must be run before each test case.

julia
using BlockComponents
using ModelingToolkit, OrdinaryDiffEqDefault
using Plots
using CSV, DataFrames

snapshotsdir = joinpath(dirname(dirname(pathof(BlockComponents))), "test", "snapshots")
"/home/actions-runner-10/.julia/packages/BlockComponents/77kIK/test/snapshots"
  • Examples

  • Experiments

  • Analyses