Test_Terminator Test_Terminator Icon

Test_Terminator

Usage

PrimitiveComponents.Test_Terminator()

Behavior

\[ \begin{equation} \left[ \begin{array}{c} \mathrm{connect}\left( sine_{+}y(t), terminator_{+}u(t) \right) \\ \mathrm{connect}\left( constant_{int\_output_{+}y(t)}, terminator_{intger\_input_{+}u(t)} \right) \\ \mathtt{sine.y}\left( t \right) = \mathtt{sine.offset} + \mathtt{sine.amplitude} ifelse\left( t \geq \mathtt{sine.start\_time}, \sin\left( \mathtt{sine.phase} + 6.2832 \mathtt{sine.frequency} \left( - \mathtt{sine.start\_time} + t \right) \right), \sin\left( \mathtt{sine.phase} \right) \right) \\ \mathtt{constant\_int\_output.y}\left( t \right) = \mathtt{constant\_int\_output.k} \\ \end{array} \right] \end{equation} \]

Source

component Test_Terminator
  terminator = PrimitiveComponents.Sinks.Terminator() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 750, "y1": 280, "x2": 850, "y2": 380, "rot": 0}
      }
    }
  }
  sine = BlockComponents.Sine(amplitude = 1, frequency = 1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 170, "y1": 280, "x2": 270, "y2": 380, "rot": 0}
      }
    }
  }
  terminator_intger_input = PrimitiveComponents.Sinks.Terminator_IntegerInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 760, "y1": 600, "x2": 860, "y2": 700, "rot": 0}
      }
    }
  }
  constant_int_output = PrimitiveComponents.Sources.ConstantIntegerOutput(k = 10) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 190, "y1": 600, "x2": 290, "y2": 700, "rot": 0}
      }
    }
  }
relations
  connect(terminator.u, sine.y) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}]}}
  connect(constant_int_output.y, terminator_intger_input.u) {"Dyad": {"edges": [{"S": 1, "E": 2, "M": []}]}}
metadata {
  "Dyad": {
    "experiments": {"Test_Terminator_": {"stop": 10}},
    "tests": {
      "case1": {
        "stop": 3,
        "abstol": 0.00001,
        "reltol": 0.00001,
        "expect": {"signals": ["terminator.u", "terminator_intger_input.u"]}
      }
    }
  }
}
end
Flattened Source
component Test_Terminator
  terminator = PrimitiveComponents.Sinks.Terminator() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 750, "y1": 280, "x2": 850, "y2": 380, "rot": 0}
      }
    }
  }
  sine = BlockComponents.Sine(amplitude = 1, frequency = 1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 170, "y1": 280, "x2": 270, "y2": 380, "rot": 0}
      }
    }
  }
  terminator_intger_input = PrimitiveComponents.Sinks.Terminator_IntegerInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 760, "y1": 600, "x2": 860, "y2": 700, "rot": 0}
      }
    }
  }
  constant_int_output = PrimitiveComponents.Sources.ConstantIntegerOutput(k = 10) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 190, "y1": 600, "x2": 290, "y2": 700, "rot": 0}
      }
    }
  }
relations
  connect(terminator.u, sine.y) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}]}}
  connect(constant_int_output.y, terminator_intger_input.u) {"Dyad": {"edges": [{"S": 1, "E": 2, "M": []}]}}
metadata {
  "Dyad": {
    "experiments": {"Test_Terminator_": {"stop": 10}},
    "tests": {
      "case1": {
        "stop": 3,
        "abstol": 0.00001,
        "reltol": 0.00001,
        "expect": {"signals": ["terminator.u", "terminator_intger_input.u"]}
      }
    }
  }
}
end


Test Cases

Test Case case1

plt
Example block output
plt
Example block output
  • Examples
  • Experiments
  • Analyses