PowerHeptagonBug PowerHeptagonBug Icon

Examples.PowerHeptagonBug

This errors because Heptagon does not like the character ^ in a function name, apparently.

Usage

DiscreteComponents.Examples.PowerHeptagonBug()

Connectors

  • x - This connector represents a real signal as an input to a component (RealInput)
  • p - This connector represents a real signal as an input to a component (RealInput)
  • y - This connector represents a real signal as an output from a component (RealOutput)

Behavior

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

Source

"""
This errors because Heptagon does not like the character `^` in a function name, 
apparently.
"""
example component PowerHeptagonBug
  x = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 405, "y1": 20, "x2": 505, "y2": 120, "rot": 0}
      },
      "tags": []
    }
  }
  p = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 660, "y1": 420, "x2": 760, "y2": 520, "rot": 0}
      },
      "tags": []
    }
  }
  y = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 120, "y2": 120, "rot": 0}
      },
      "tags": []
    }
  }
  sine = BlockComponents.Sine(amplitude = 1, frequency = 1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 140, "y1": 20, "x2": 240, "y2": 120, "rot": 0}
      },
      "tags": []
    }
  }
  cosine = BlockComponents.Cosine(frequency = 1, amplitude = 1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 400, "y1": 420, "x2": 500, "y2": 520, "rot": 0}
      },
      "tags": []
    }
  }
  sampler = DiscreteComponents.Sampler() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 274, "y1": 20, "x2": 374, "y2": 120, "rot": 0}
      },
      "tags": []
    }
  }
  sampler1 = DiscreteComponents.Sampler() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 534, "y1": 420, "x2": 634, "y2": 520, "rot": 0}
      },
      "tags": []
    }
  }
  periodicclock = DiscreteComponents.PeriodicClock(dt = 0.05) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 535, "y1": 120, "x2": 635, "y2": 220, "rot": 0}
      },
      "tags": []
    }
  }
  clockpropagator = DiscreteComponents.ClockPropagator() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 405, "y1": 220, "x2": 505, "y2": 320, "rot": 0}
      },
      "tags": []
    }
  }
relations
  connect(sine.y, sampler.u) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(cosine.y, sampler1.u) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(periodicclock.y, clockpropagator.u) {
    "Dyad": {
      "edges": [{"S": 1, "M": [], "E": -1}, {"S": -1, "M": [{"x": 390, "y": 235}], "E": 2}],
      "junctions": [{"x": 390, "y": 170}],
      "renderStyle": "standard"
    }
  }
  connect(clockpropagator.y, sampler1.y) {
    "Dyad": {
      "edges": [
        {
          "S": 1,
          "M": [{"x": 390, "y": 305}, {"x": 390, "y": 370}, {"x": 650, "y": 370}],
          "E": -1
        },
        {"S": -1, "M": [], "E": 2}
      ],
      "junctions": [{"x": 650, "y": 470}],
      "renderStyle": "standard"
    }
  }
  connect(sampler.y, clockpropagator.u) {
    "Dyad": {
      "edges": [{"S": 1, "M": [], "E": -1}, {"S": -1, "M": [{"x": 390, "y": 235}], "E": 2}],
      "junctions": [{"x": 390, "y": 70}],
      "renderStyle": "standard"
    }
  }
  connect(sampler1.y, p) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(sampler.y, x) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  y = x ^ p
metadata {"Dyad": {"doc": {"behavior": false}}}
end
Flattened Source
"""
This errors because Heptagon does not like the character `^` in a function name, 
apparently.
"""
example component PowerHeptagonBug
  x = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 405, "y1": 20, "x2": 505, "y2": 120, "rot": 0}
      },
      "tags": []
    }
  }
  p = RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 660, "y1": 420, "x2": 760, "y2": 520, "rot": 0}
      },
      "tags": []
    }
  }
  y = RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 120, "y2": 120, "rot": 0}
      },
      "tags": []
    }
  }
  sine = BlockComponents.Sine(amplitude = 1, frequency = 1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 140, "y1": 20, "x2": 240, "y2": 120, "rot": 0}
      },
      "tags": []
    }
  }
  cosine = BlockComponents.Cosine(frequency = 1, amplitude = 1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 400, "y1": 420, "x2": 500, "y2": 520, "rot": 0}
      },
      "tags": []
    }
  }
  sampler = DiscreteComponents.Sampler() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 274, "y1": 20, "x2": 374, "y2": 120, "rot": 0}
      },
      "tags": []
    }
  }
  sampler1 = DiscreteComponents.Sampler() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 534, "y1": 420, "x2": 634, "y2": 520, "rot": 0}
      },
      "tags": []
    }
  }
  periodicclock = DiscreteComponents.PeriodicClock(dt = 0.05) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 535, "y1": 120, "x2": 635, "y2": 220, "rot": 0}
      },
      "tags": []
    }
  }
  clockpropagator = DiscreteComponents.ClockPropagator() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 405, "y1": 220, "x2": 505, "y2": 320, "rot": 0}
      },
      "tags": []
    }
  }
relations
  connect(sine.y, sampler.u) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(cosine.y, sampler1.u) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(periodicclock.y, clockpropagator.u) {
    "Dyad": {
      "edges": [{"S": 1, "M": [], "E": -1}, {"S": -1, "M": [{"x": 390, "y": 235}], "E": 2}],
      "junctions": [{"x": 390, "y": 170}],
      "renderStyle": "standard"
    }
  }
  connect(clockpropagator.y, sampler1.y) {
    "Dyad": {
      "edges": [
        {
          "S": 1,
          "M": [{"x": 390, "y": 305}, {"x": 390, "y": 370}, {"x": 650, "y": 370}],
          "E": -1
        },
        {"S": -1, "M": [], "E": 2}
      ],
      "junctions": [{"x": 650, "y": 470}],
      "renderStyle": "standard"
    }
  }
  connect(sampler.y, clockpropagator.u) {
    "Dyad": {
      "edges": [{"S": 1, "M": [], "E": -1}, {"S": -1, "M": [{"x": 390, "y": 235}], "E": 2}],
      "junctions": [{"x": 390, "y": 70}],
      "renderStyle": "standard"
    }
  }
  connect(sampler1.y, p) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(sampler.y, x) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  y = x ^ p
metadata {"Dyad": {"doc": {"behavior": false}}}
end


Test Cases

No test cases defined.

  • Examples
  • Experiments
  • Analyses