Skip to content
CurrentSource.md

CurrentSource

Ideal current source driven by an external signal.

This component models an ideal current source where the current i flowing from its positive pin (p) to its negative pin (n) is directly determined by an external real input signal I. The component inherits the electrical pins p and n, the through-variable current i, and the across-variable voltage v from the TwoPin base component. The input signal I is a causal signal, typically provided by a control system or another signal source.

OnePort

Usage

CurrentSource(uI=1.0)

Connectors

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

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

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

Variables

NameDescriptionUnits
vVoltage across the component (between pin p and pin n).V
iCurrent flowing through the component (from pin p to pin n).A

Behavior

v(t)=p.v(t)n.v(t)i(t)=p.i(t)n.i(t)+p.i(t)=0i(t)=uII(t)

Source

dyad
# Ideal current source driven by an external signal.
#
# This component models an ideal current source where the current `i` flowing
# from its positive pin (`p`) to its negative pin (`n`) is directly determined
# by an external real input signal `I`. The component inherits the electrical
# pins `p` and `n`, the through-variable current `i`, and the across-variable
# voltage `v` from the `TwoPin` base component. The input signal `I` is a
# causal signal, typically provided by a control system or another signal source.
component CurrentSource
  extends OnePort
  # External real input signal that controls the magnitude of the current source.
  I = RealInput() [{
    "Dyad": {"placement": {"icon": {"x1": 450, "y1": -50, "x2": 550, "y2": 50, "rot": 90}}}
  }]
  # Unit parameter to balance units in current relation.
  final parameter uI::Current = 1.0
relations
  i = I*uI
metadata {"Dyad": {"labels": [{"label": "$(instance)", "x": 500, "y": 1000, "rot": 0}]}}
end
Flattened Source
dyad
# Ideal current source driven by an external signal.
#
# This component models an ideal current source where the current `i` flowing
# from its positive pin (`p`) to its negative pin (`n`) is directly determined
# by an external real input signal `I`. The component inherits the electrical
# pins `p` and `n`, the through-variable current `i`, and the across-variable
# voltage `v` from the `TwoPin` base component. The input signal `I` is a
# causal signal, typically provided by a control system or another signal source.
component CurrentSource
  # Positive electrical pin.
  p = Pin() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "pos", "x1": -50, "y1": 450, "x2": 50, "y2": 550}}
    }
  }]
  # Negative electrical pin.
  n = Pin() [{
    "Dyad": {
      "placement": {"icon": {"iconName": "neg", "x1": 950, "y1": 450, "x2": 1050, "y2": 550}}
    }
  }]
  # Voltage across the component (between pin p and pin n).
  variable v::Voltage
  # Current flowing through the component (from pin p to pin n).
  variable i::Current
  # External real input signal that controls the magnitude of the current source.
  I = RealInput() [{
    "Dyad": {"placement": {"icon": {"x1": 450, "y1": -50, "x2": 550, "y2": 50, "rot": 90}}}
  }]
  # Unit parameter to balance units in current relation.
  final parameter uI::Current = 1.0
relations
  v = p.v-n.v
  i = p.i
  p.i+n.i = 0
  i = I*uI
metadata {"Dyad": {"labels": [{"label": "$(instance)", "x": 500, "y": 1000, "rot": 0}]}}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses

Layout Switch

Adjust the layout style of VitePress to adapt to different reading needs and screens.

Expand all
The sidebar and content area occupy the entire width of the screen.
Expand sidebar with adjustable values
Expand sidebar width and add a new slider for user to choose and customize their desired width of the maximum width of sidebar can go, but the content area width will remain the same.
Expand all with adjustable values
Expand sidebar width and add a new slider for user to choose and customize their desired width of the maximum width of sidebar can go, but the content area width will remain the same.
Original width
The original layout width of VitePress

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.

Spotlight

Highlight the line where the mouse is currently hovering in the content to optimize for users who may have reading and focusing difficulties.

ONOn
Turn on Spotlight.
OFFOff
Turn off Spotlight.