I$(instance)CurrentSource Icon

CurrentSource

The input signal I is provided as the current flowing from the positive to the negative pins.

This component extends from TwoPin

Usage

CurrentSource(uI=1.0)

Parameters:

NameDescriptionUnitsDefault value
uISpecifies the unit of IA1

Connectors

  • p - (Pin)
  • n - (Pin)
  • I - This connector represents a real signal as an input to a component (RealInput)

Variables

NameDescriptionUnits
vV
iA

Behavior

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

Source

# The input signal `I` is provided as the current flowing from the positive to
# the negative pins.
component CurrentSource
  extends TwoPin
  I = RealInput() [{
    "JuliaSim": {"placement": {"icon": {"x1": 450, "y1": -50, "x2": 550, "y2": 50, "rot": 90}}}
  }]
  # Specifies the unit of `I`
  parameter uI::Current = 1.0
relations
  i = I*uI
metadata {
  "JuliaSim": {"labels": [{"label": "$(instance)", "x": 500, "y": 1000, "rot": 0}]}
}
end
Flattened Source
# The input signal `I` is provided as the current flowing from the positive to
# the negative pins.
component CurrentSource
  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}}
    }
  }]
  variable v::Voltage
  variable i::Current
  I = RealInput() [{
    "JuliaSim": {"placement": {"icon": {"x1": 450, "y1": -50, "x2": 550, "y2": 50, "rot": 90}}}
  }]
  # Specifies the unit of `I`
  parameter uI::Current = 1.0
relations
  v = p.v-n.v
  i = p.i
  p.i+n.i = 0
  i = I*uI
metadata {
  "JuliaSim": {"labels": [{"label": "$(instance)", "x": 500, "y": 1000, "rot": 0}]}
}
end

Test Cases

  • Examples
  • Experiments
  • Analyses