Test_Floor Test_Floor Icon

Test_Floor

Usage

PrimitiveComponents.Test_Floor()

Behavior

\[ \begin{equation} \left[ \begin{array}{c} \mathrm{connect}\left( sine_{+}y(t), floor_{+}u(t) \right) \\ \mathtt{floor.y}\left( t \right) = \left\lfloor \mathtt{floor.u}\left( t \right)\right\rfloor \\ \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) \\ \end{array} \right] \end{equation} \]

Source

component Test_Floor
  floor = PrimitiveComponents.Mathematical.Floor() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 330, "y1": 210, "x2": 430, "y2": 310, "rot": 0}
      }
    }
  }
  sine = BlockComponents.Sine(start_time = 5, offset = 0, amplitude = 5, frequency = 1 / 5) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 110, "y1": 210, "x2": 210, "y2": 310, "rot": 0}
      }
    }
  }
relations
  connect(sine.y, floor.u) {"Dyad": {"renderStyle": "standard", "edges": [{"S": 1, "E": 2, "M": []}]}}
metadata {
  "Dyad": {
    "experiments": {},
    "tests": {
      "case1": {
        "stop": 10,
        "abstol": 0.00001,
        "reltol": 0.00001,
        "expect": {"signals": ["sine.y", "floor.y"]}
      }
    },
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 1100,
        "rot": 0,
        "layer": "icon",
        "attrs": {}
      }
    ],
    "path": {},
    "doc": {"behavior": true}
  }
}
end
Flattened Source
component Test_Floor
  floor = PrimitiveComponents.Mathematical.Floor() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 330, "y1": 210, "x2": 430, "y2": 310, "rot": 0}
      }
    }
  }
  sine = BlockComponents.Sine(start_time = 5, offset = 0, amplitude = 5, frequency = 1 / 5) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 110, "y1": 210, "x2": 210, "y2": 310, "rot": 0}
      }
    }
  }
relations
  connect(sine.y, floor.u) {"Dyad": {"renderStyle": "standard", "edges": [{"S": 1, "E": 2, "M": []}]}}
metadata {
  "Dyad": {
    "experiments": {},
    "tests": {
      "case1": {
        "stop": 10,
        "abstol": 0.00001,
        "reltol": 0.00001,
        "expect": {"signals": ["sine.y", "floor.y"]}
      }
    },
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 1100,
        "rot": 0,
        "layer": "icon",
        "attrs": {}
      }
    ],
    "path": {},
    "doc": {"behavior": true}
  }
}
end


Test Cases

Test Case case1

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