Test_OffDelay Test_OffDelay Icon

Test_OffDelay

Usage

PrimitiveComponents.Test_OffDelay()

Behavior

\[ \begin{equation} \left[ \begin{array}{c} \mathrm{connect}\left( step_{1_{+}y(t)}, delay_{block\_1_{+}u(t)} \right) \\ \mathrm{connect}\left( step_{2_{+}y(t)}, delay_{block\_2_{+}u(t)} \right) \\ \mathtt{step\_1.y}\left( t \right) = ifelse\left( t \geq \mathtt{step\_1.start\_time}, \mathtt{step\_1.height} + \mathtt{step\_1.offset}, \mathtt{step\_1.offset} \right) \\ \frac{\mathrm{d} \mathtt{delay\_block\_1.l}\left( t \right)}{\mathrm{d}t} = 0 \\ \mathtt{delay\_block\_1.y}\left( t \right) = ifelse\left( \left( \mathtt{delay\_block\_1.u}\left( t \right) < 1 \right) \wedge \left( Shift(t, -1)\left( \mathtt{delay\_block\_1.u}\left( t \right) \right) < 1 \right), 0, 1 \right) \\ \mathtt{step\_2.y}\left( t \right) = ifelse\left( t \geq \mathtt{step\_2.start\_time}, \mathtt{step\_2.height} + \mathtt{step\_2.offset}, \mathtt{step\_2.offset} \right) \\ \frac{\mathrm{d} \mathtt{delay\_block\_2.l}\left( t \right)}{\mathrm{d}t} = 0 \\ \mathtt{delay\_block\_2.y}\left( t \right) = ifelse\left( \left( \mathtt{delay\_block\_2.u}\left( t \right) < 1 \right) \wedge \left( Shift(t, -1)\left( \mathtt{delay\_block\_2.u}\left( t \right) \right) < 1 \right), 0, 1 \right) \\ \end{array} \right] \end{equation} \]

Source

component Test_OffDelay
  step_1 = BlockComponents.Step(start_time = 5, offset = 0, height = 1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 210, "y1": 450, "x2": 310, "y2": 550, "rot": 0}
      }
    }
  }
  delay_block_1 = PrimitiveComponents.DiscretePrimitives.OffDelay() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 420, "y1": 450, "x2": 520, "y2": 550, "rot": 0}
      }
    }
  }
  step_2 = BlockComponents.Step(start_time = 5, offset = 1, height = -1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 230, "y1": 680, "x2": 330, "y2": 780, "rot": 0}
      }
    }
  }
  delay_block_2 = PrimitiveComponents.DiscretePrimitives.OffDelay() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 430, "y1": 680, "x2": 530, "y2": 780, "rot": 0}
      }
    }
  }
relations
  connect(delay_block_1.u, step_1.y) {"Dyad": {"edges": [{"S": 1, "E": 2, "M": []}]}}
  connect(delay_block_2.u, step_2.y) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}]}}
metadata {
  "Dyad": {"labels": [{"label": "$(instance)", "x": 500, "y": 1100}]},
  "tests": {
    "case1": {
      "stop": 3,
      "abstol": 0.00001,
      "reltol": 0.00001,
      "expect": {
        "signals": ["delay_block_1.u", "delay_block_1.y", "delay_block_2.u", "delay_block_2.y"]
      }
    }
  }
}
end
Flattened Source
component Test_OffDelay
  step_1 = BlockComponents.Step(start_time = 5, offset = 0, height = 1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 210, "y1": 450, "x2": 310, "y2": 550, "rot": 0}
      }
    }
  }
  delay_block_1 = PrimitiveComponents.DiscretePrimitives.OffDelay() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 420, "y1": 450, "x2": 520, "y2": 550, "rot": 0}
      }
    }
  }
  step_2 = BlockComponents.Step(start_time = 5, offset = 1, height = -1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 230, "y1": 680, "x2": 330, "y2": 780, "rot": 0}
      }
    }
  }
  delay_block_2 = PrimitiveComponents.DiscretePrimitives.OffDelay() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 430, "y1": 680, "x2": 530, "y2": 780, "rot": 0}
      }
    }
  }
relations
  connect(delay_block_1.u, step_1.y) {"Dyad": {"edges": [{"S": 1, "E": 2, "M": []}]}}
  connect(delay_block_2.u, step_2.y) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}]}}
metadata {
  "Dyad": {"labels": [{"label": "$(instance)", "x": 500, "y": 1100}]},
  "tests": {
    "case1": {
      "stop": 3,
      "abstol": 0.00001,
      "reltol": 0.00001,
      "expect": {
        "signals": ["delay_block_1.u", "delay_block_1.y", "delay_block_2.u", "delay_block_2.y"]
      }
    }
  }
}
end


Test Cases

No test cases defined.

  • Examples
  • Experiments
  • Analyses