Test_Hypot Test_Hypot Icon

Test_Hypot

Usage

PrimitiveComponents.Test_Hypot()

Behavior

\[ \begin{equation} \left[ \begin{array}{c} \mathrm{connect}\left( sine_{1_{+}y(t)}, hypot_{+}u1(t) \right) \\ \mathrm{connect}\left( sine_{2_{+}y(t)}, hypot_{+}u2(t) \right) \\ \mathtt{hypot.y}\left( t \right) = hypot\left( \mathtt{hypot.u1}\left( t \right), \mathtt{hypot.u2}\left( t \right) \right) \\ \mathtt{sine\_1.y}\left( t \right) = \mathtt{sine\_1.offset} + \mathtt{sine\_1.amplitude} ifelse\left( t \geq \mathtt{sine\_1.start\_time}, \sin\left( \mathtt{sine\_1.phase} + 6.2832 \mathtt{sine\_1.frequency} \left( - \mathtt{sine\_1.start\_time} + t \right) \right), \sin\left( \mathtt{sine\_1.phase} \right) \right) \\ \mathtt{sine\_2.y}\left( t \right) = \mathtt{sine\_2.offset} + \mathtt{sine\_2.amplitude} ifelse\left( t \geq \mathtt{sine\_2.start\_time}, \sin\left( \mathtt{sine\_2.phase} + 6.2832 \mathtt{sine\_2.frequency} \left( - \mathtt{sine\_2.start\_time} + t \right) \right), \sin\left( \mathtt{sine\_2.phase} \right) \right) \\ \end{array} \right] \end{equation} \]

Source

component Test_Hypot
  hypot = PrimitiveComponents.Mathematical.Hypot() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 340, "y1": 260, "x2": 440, "y2": 360, "rot": 0}
      }
    }
  }
  sine_1 = BlockComponents.Sine(start_time = 3, offset = 0, amplitude = 1, frequency = 1 / 5) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 60, "y1": 100, "x2": 160, "y2": 200, "rot": 0}
      }
    }
  }
  sine_2 = BlockComponents.Sine(start_time = 5, offset = 0, amplitude = 1, frequency = 1 / 5) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 70, "y1": 350, "x2": 170, "y2": 450, "rot": 0}
      }
    }
  }
relations
  connect(sine_1.y, hypot.u1) {
    "Dyad": {
      "renderStyle": "standard",
      "edges": [{"S": 1, "M": [{"x": 250, "y": 150}, {"x": 250, "y": 280}], "E": 2}]
    }
  }
  connect(hypot.u2, sine_2.y) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 265, "y": 340}, {"x": 265, "y": 400}], "E": 2}],
      "renderStyle": "standard"
    }
  }
metadata {
  "Dyad": {
    "experiments": {},
    "tests": {
      "case1": {
        "stop": 10,
        "abstol": 0.00001,
        "reltol": 0.00001,
        "expect": {"signals": ["hypot.y", "hypot.u1", "hypot.u2"]}
      }
    },
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 1100,
        "rot": 0,
        "layer": "icon",
        "attrs": {}
      }
    ],
    "path": {},
    "doc": {"behavior": true}
  }
}
end
Flattened Source
component Test_Hypot
  hypot = PrimitiveComponents.Mathematical.Hypot() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 340, "y1": 260, "x2": 440, "y2": 360, "rot": 0}
      }
    }
  }
  sine_1 = BlockComponents.Sine(start_time = 3, offset = 0, amplitude = 1, frequency = 1 / 5) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 60, "y1": 100, "x2": 160, "y2": 200, "rot": 0}
      }
    }
  }
  sine_2 = BlockComponents.Sine(start_time = 5, offset = 0, amplitude = 1, frequency = 1 / 5) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 70, "y1": 350, "x2": 170, "y2": 450, "rot": 0}
      }
    }
  }
relations
  connect(sine_1.y, hypot.u1) {
    "Dyad": {
      "renderStyle": "standard",
      "edges": [{"S": 1, "M": [{"x": 250, "y": 150}, {"x": 250, "y": 280}], "E": 2}]
    }
  }
  connect(hypot.u2, sine_2.y) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 265, "y": 340}, {"x": 265, "y": 400}], "E": 2}],
      "renderStyle": "standard"
    }
  }
metadata {
  "Dyad": {
    "experiments": {},
    "tests": {
      "case1": {
        "stop": 10,
        "abstol": 0.00001,
        "reltol": 0.00001,
        "expect": {"signals": ["hypot.y", "hypot.u1", "hypot.u2"]}
      }
    },
    "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
plt
Example block output
  • Examples
  • Experiments
  • Analyses