Test_SampleDelay Test_SampleDelay Icon

Test_SampleDelay

Usage

PrimitiveComponents.Test_SampleDelay()

Variables

NameDescriptionUnits
x

Behavior

\[ \begin{equation} \left[ \begin{array}{c} \frac{\mathrm{d} x\left( t \right)}{\mathrm{d}t} = 0 \\ \mathrm{connect}\left( sin_{+}y(t), sd_{+}u(t) \right) \\ \frac{\mathrm{d} \mathtt{sd.l}\left( t \right)}{\mathrm{d}t} = 0 \\ \mathtt{sd.y}\left( t \right) = Shift(t, -5)\left( \mathtt{sd.u}\left( t \right) \right) \\ \mathtt{sin.y}\left( t \right) = \mathtt{sin.offset} + \mathtt{sin.amplitude} ifelse\left( t \geq \mathtt{sin.start\_time}, \sin\left( \mathtt{sin.phase} + 6.2832 \mathtt{sin.frequency} \left( - \mathtt{sin.start\_time} + t \right) \right), \sin\left( \mathtt{sin.phase} \right) \right) \\ \end{array} \right] \end{equation} \]

Source

test component Test_SampleDelay
  sd = PrimitiveComponents.DiscretePrimitives.SampleDelay(dt = 0.1, n = 5, ic = 0.1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 149, "y1": 20, "x2": 249, "y2": 120, "rot": 0}
      }
    }
  }
  sin = BlockComponents.Sine(start_time = 1.0, offset = 0.0, amplitude = 10, frequency = 0.1, phase = 0.0) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 120, "y2": 120, "rot": 0}
      }
    }
  }
  variable x::Real
relations
  initial x = 0.0
  der(x) = 0.0
  connect(sin.y, sd.u) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
end
Flattened Source
test component Test_SampleDelay
  sd = PrimitiveComponents.DiscretePrimitives.SampleDelay(dt = 0.1, n = 5, ic = 0.1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 149, "y1": 20, "x2": 249, "y2": 120, "rot": 0}
      }
    }
  }
  sin = BlockComponents.Sine(start_time = 1.0, offset = 0.0, amplitude = 10, frequency = 0.1, phase = 0.0) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 120, "y2": 120, "rot": 0}
      }
    }
  }
  variable x::Real
relations
  initial x = 0.0
  der(x) = 0.0
  connect(sin.y, sd.u) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
metadata {}
end


Test Cases

No test cases defined.