poweriv$(instance)MMultiSensor Icon

MultiSensor

Combines a VoltageSensor and a CurrentSensor. n pin of the VoltageSensor

This component extends from PowerSensor

Usage

MultiSensor()

Connectors

  • pc - (Pin)
  • nc - (Pin)
  • pv - (Pin)
  • nv - (Pin)
  • power - This connector represents a real signal as an output from a component (RealOutput)
  • i - This connector represents a real signal as an output from a component (RealOutput)
  • v - This connector represents a real signal as an output from a component (RealOutput)

Behavior

\[ \begin{equation} \left[ \begin{array}{c} \mathtt{power}\left( t \right) = \mathtt{current\_sensor.i}\left( t \right) \mathtt{voltage\_sensor.v}\left( t \right) \\ i\left( t \right) = \mathtt{current\_sensor.i}\left( t \right) \\ v\left( t \right) = \mathtt{voltage\_sensor.v}\left( t \right) \\ \mathrm{connect}\left( pv, voltage_{sensor_{+}p} \right) \\ \mathrm{connect}\left( voltage_{sensor_{+}n}, nv \right) \\ \mathrm{connect}\left( pc, current_{sensor_{+}p} \right) \\ \mathrm{connect}\left( current_{sensor_{+}n}, nc \right) \\ \mathtt{voltage\_sensor.p.i}\left( t \right) = 0 \\ \mathtt{voltage\_sensor.n.i}\left( t \right) = 0 \\ \mathtt{voltage\_sensor.v}\left( t \right) = \mathtt{voltage\_sensor.p.v}\left( t \right) - \mathtt{voltage\_sensor.n.v}\left( t \right) \\ \mathtt{current\_sensor.p.v}\left( t \right) = \mathtt{current\_sensor.n.v}\left( t \right) \\ \mathtt{current\_sensor.p.i}\left( t \right) = \mathtt{current\_sensor.i}\left( t \right) \\ \mathtt{current\_sensor.n.i}\left( t \right) = - \mathtt{current\_sensor.i}\left( t \right) \\ \end{array} \right] \end{equation} \]

Source

# Combines a `VoltageSensor` and a `CurrentSensor`. `n` pin of the `VoltageSensor`
component MultiSensor
  extends PowerSensor
  i = RealOutput() [{
    "JuliaSim": {
      "placement": {"icon": {"x1": 650, "y1": 950, "x2": 750, "y2": 1050, "rot": 90}}
    }
  }]
  v = RealOutput() [{
    "JuliaSim": {
      "placement": {"icon": {"x1": 850, "y1": 950, "x2": 950, "y2": 1050, "rot": 90}}
    }
  }]
relations
  i = current_sensor.i
  v = voltage_sensor.v
metadata {
  "JuliaSim": {
    "labels": [
      {"label": "$(instance)", "x": 500, "y": 1100, "rot": 0},
      {"label": "M", "x": 500, "y": 713, "rot": 0}
    ],
    "icons": {"default": "jsml://ElectricalComponents/FourPinSensor.svg"}
  }
}
end
Flattened Source
# Combines a `VoltageSensor` and a `CurrentSensor`. `n` pin of the `VoltageSensor`
component MultiSensor
  pc = Pin() [{
    "JuliaSim": {
      "placement": {"icon": {"iconName": "pos", "x1": -50, "y1": 450, "x2": 50, "y2": 550}}
    }
  }]
  nc = Pin() [{
    "JuliaSim": {
      "placement": {"icon": {"iconName": "neg", "x1": 950, "y1": 450, "x2": 1050, "y2": 550}}
    }
  }]
  pv = Pin() [{
    "JuliaSim": {
      "placement": {"icon": {"iconName": "pos", "x1": 450, "y1": -50, "x2": 550, "y2": 50}}
    }
  }]
  nv = Pin() [{
    "JuliaSim": {
      "placement": {"icon": {"iconName": "neg", "x1": 450, "y1": 950, "x2": 550, "y2": 1050}}
    }
  }]
  voltage_sensor = VoltageSensor()
  current_sensor = CurrentSensor()
  # Instantaneous power
  power = RealOutput() [{
    "JuliaSim": {
      "placement": {"icon": {"x1": 150, "y1": 950, "x2": 250, "y2": 1050, "rot": 90}}
    }
  }]
  i = RealOutput() [{
    "JuliaSim": {
      "placement": {"icon": {"x1": 650, "y1": 950, "x2": 750, "y2": 1050, "rot": 90}}
    }
  }]
  v = RealOutput() [{
    "JuliaSim": {
      "placement": {"icon": {"x1": 850, "y1": 950, "x2": 950, "y2": 1050, "rot": 90}}
    }
  }]
relations
  connect(pv, voltage_sensor.p)
  connect(voltage_sensor.n, nv)
  connect(pc, current_sensor.p)
  connect(current_sensor.n, nc)
  power = voltage_sensor.v*current_sensor.i
  i = current_sensor.i
  v = voltage_sensor.v
metadata {
  "JuliaSim": {
    "labels": [
      {"label": "$(instance)", "x": 500, "y": 1100, "rot": 0},
      {"label": "M", "x": 500, "y": 713, "rot": 0}
    ],
    "icons": {"default": "jsml://ElectricalComponents/FourPinSensor.svg"}
  }
}
end

Test Cases