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

[connect(pv,voltageSensor+p)connect(voltageSensor+n,nv)connect(pc,currentSensor+p)connect(currentSensor+n,nc)connect(currentSensor+i(t),product+u2(t))connect(voltageSensor+v(t),product+u1(t))connect(product+y(t),power(t))voltageSensor.p.i(t)=0voltageSensor.n.i(t)=0voltageSensor.v(t)=voltageSensor.n.v(t)+voltageSensor.p.v(t)currentSensor.p.v(t)=currentSensor.n.v(t)currentSensor.p.i(t)=currentSensor.i(t)currentSensor.n.i(t)=currentSensor.i(t)product.y(t)=product.u2(t)product.u1(t)]

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