v$(instance)VVoltageSensor Icon

VoltageSensor

Creates a circuit component that measures the voltage across it. Analogous to an ideal voltmeter.

Usage

VoltageSensor()

Connectors

  • p - (Pin)
  • n - (Pin)
  • v - This connector represents a real signal as an output from a component (RealOutput)

Behavior

\[ \begin{align} \mathtt{p.i}\left( t \right) &= 0 \\ \mathtt{n.i}\left( t \right) &= 0 \\ v\left( t \right) &= \mathtt{p.v}\left( t \right) - \mathtt{n.v}\left( t \right) \end{align} \]

Source

# Creates a circuit component that measures the voltage across it. Analogous to an ideal voltmeter.
component VoltageSensor
  p = Pin() [{
    "JuliaSim": {
      "placement": {"icon": {"iconName": "pos", "x1": -50, "y1": 450, "x2": 50, "y2": 550}}
    }
  }]
  n = Pin() [{
    "JuliaSim": {
      "placement": {"icon": {"iconName": "neg", "x1": 950, "y1": 450, "x2": 1050, "y2": 550}}
    }
  }]
  v = RealOutput() [{
    "JuliaSim": {
      "placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050, "rot": 90}}
    }
  }]
relations
  p.i = 0
  n.i = 0
  v = p.v-n.v
metadata {
  "JuliaSim": {
    "labels": [
      {"label": "$(instance)", "x": 500, "y": 1100, "rot": 0},
      {"label": "V", "x": 500, "y": 713, "rot": 0}
    ],
    "icons": {"default": "jsml://ElectricalComponents/TwoPinSensor.svg"}
  }
}
end
Flattened Source
# Creates a circuit component that measures the voltage across it. Analogous to an ideal voltmeter.
component VoltageSensor
  p = Pin() [{
    "JuliaSim": {
      "placement": {"icon": {"iconName": "pos", "x1": -50, "y1": 450, "x2": 50, "y2": 550}}
    }
  }]
  n = Pin() [{
    "JuliaSim": {
      "placement": {"icon": {"iconName": "neg", "x1": 950, "y1": 450, "x2": 1050, "y2": 550}}
    }
  }]
  v = RealOutput() [{
    "JuliaSim": {
      "placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050, "rot": 90}}
    }
  }]
relations
  p.i = 0
  n.i = 0
  v = p.v-n.v
metadata {
  "JuliaSim": {
    "labels": [
      {"label": "$(instance)", "x": 500, "y": 1100, "rot": 0},
      {"label": "V", "x": 500, "y": 713, "rot": 0}
    ],
    "icons": {"default": "jsml://ElectricalComponents/TwoPinSensor.svg"}
  }
}
end

Test Cases