Skip to content
Analog.PowerSensor.md

Analog.PowerSensor ​

Usage ​

TranslatedComponents.Analog.PowerSensor()

Connectors ​

  • pc - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

  • nc - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

  • pv - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

  • nv - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

  • power - This connector represents a real signal as an output from a component (RealOutput)

Behavior ​

julia
using TranslatedComponents #hide
using ModelingToolkit #hide
@named sys = TranslatedComponents.Analog.PowerSensor() #hide
full_equations(sys) #hide
<< @example-block not executed in draft mode >>

Source ​

dyad
component PowerSensor
  pc = Pin()
  nc = Pin()
  pv = Pin()
  nv = Pin()
  power = RealOutput()
  voltageSensor = VoltageSensor()
  currentSensor = CurrentSensor()
  product = BlockComponents.Product()
relations
  connect(pv, voltageSensor.p)
  connect(voltageSensor.n, nv)
  connect(pc, currentSensor.p)
  connect(currentSensor.n, nc)
  connect(currentSensor.i, product.u2)
  connect(voltageSensor.v, product.u1)
  connect(product.y, power)
end
Flattened Source
dyad
component PowerSensor
  pc = Pin()
  nc = Pin()
  pv = Pin()
  nv = Pin()
  power = RealOutput()
  voltageSensor = VoltageSensor()
  currentSensor = CurrentSensor()
  product = BlockComponents.Product()
relations
  connect(pv, voltageSensor.p)
  connect(voltageSensor.n, nv)
  connect(pc, currentSensor.p)
  connect(currentSensor.n, nc)
  connect(currentSensor.i, product.u2)
  connect(voltageSensor.v, product.u1)
  connect(product.y, power)
metadata {}
end


Test Cases ​

No test cases defined.

  • Examples

  • Experiments

  • Analyses