ZOHBug ZOHBug Icon

Examples.ZOHBug

The output of the ZeroOrderHold block looks flat but it is actually not. This is an MTK bug with hold being on the wrong clock partition and will be fixed in the next DyadEcosystemDependencies v0.10.7.

Once that happens this should be renamed to TestZeroOrderHold instead.

Usage

DiscreteComponents.Examples.ZOHBug()

Behavior

Behavior of this component cannot be rendered because it includes path variables.

Source

"""
The output of the ZeroOrderHold block looks flat but it is actually not.
This is an MTK bug with hold being on the wrong clock partition and will 
be fixed in the next DyadEcosystemDependencies v0.10.7.

Once that happens this should be renamed to `TestZeroOrderHold` instead.
"""
example component ZOHBug
  sine = BlockComponents.Sine(amplitude = 1, frequency = 1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 70, "y1": 450, "x2": 170, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  zeroorderhold = DiscreteComponents.ZeroOrderHold() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 430, "y1": 450, "x2": 530, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  periodicsampler = DiscreteComponents.PeriodicSampler(dt = 0.1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 250, "y1": 450, "x2": 350, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  integrator = BlockComponents.Integrator() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 610, "y1": 450, "x2": 710, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
relations
  connect(sine.y, periodicsampler.u) {"Dyad": {"renderStyle": "standard", "edges": [{"S": 1, "E": 2, "M": []}]}}
  connect(periodicsampler.y, zeroorderhold.u) {"Dyad": {"renderStyle": "standard", "edges": [{"S": 1, "E": 2, "M": []}]}}
  connect(zeroorderhold.y, integrator.u) {"Dyad": {"renderStyle": "standard", "edges": [{"S": 1, "E": 2, "M": []}]}}
metadata {"Dyad": {"doc": {"behavior": false}}}
end
Flattened Source
"""
The output of the ZeroOrderHold block looks flat but it is actually not.
This is an MTK bug with hold being on the wrong clock partition and will 
be fixed in the next DyadEcosystemDependencies v0.10.7.

Once that happens this should be renamed to `TestZeroOrderHold` instead.
"""
example component ZOHBug
  sine = BlockComponents.Sine(amplitude = 1, frequency = 1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 70, "y1": 450, "x2": 170, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  zeroorderhold = DiscreteComponents.ZeroOrderHold() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 430, "y1": 450, "x2": 530, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  periodicsampler = DiscreteComponents.PeriodicSampler(dt = 0.1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 250, "y1": 450, "x2": 350, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  integrator = BlockComponents.Integrator() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 610, "y1": 450, "x2": 710, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
relations
  connect(sine.y, periodicsampler.u) {"Dyad": {"renderStyle": "standard", "edges": [{"S": 1, "E": 2, "M": []}]}}
  connect(periodicsampler.y, zeroorderhold.u) {"Dyad": {"renderStyle": "standard", "edges": [{"S": 1, "E": 2, "M": []}]}}
  connect(zeroorderhold.y, integrator.u) {"Dyad": {"renderStyle": "standard", "edges": [{"S": 1, "E": 2, "M": []}]}}
metadata {"Dyad": {"doc": {"behavior": false}}}
end


Test Cases

No test cases defined.

  • Examples
  • Experiments
  • Analyses