VoltageSource
IconVoltageSource
Ideal voltage source whose output voltage is determined by a real input signal and a scaling parameter.
This component models an ideal voltage source. The voltage v
across its positive and negative pins (inherited from the TwoPin
base component) is determined by an external real input signal connected to its V
input port, and a unit parameter uV
. The signal at input V
is treated as a dimensionless value, which is then multiplied by the parameter uV
(which has units of Voltage) to produce the actual output voltage v
across the pins. The relationship is given by:
\[v = V uV\]
Where V
is the value of the signal at the RealInput
port.
Usage
VoltageSource(uV=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
)V
- This connector represents a real signal as an input to a component (RealInput
)
Variables
Name | Description | Units |
---|---|---|
v | Voltage across the component (between pin p and pin n). | V |
i | Current flowing through the component (from pin p to pin n). | A |
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 \\ v\left( t \right) &= \mathtt{uV} V\left( t \right) \end{align} \]
Source
# Ideal voltage source whose output voltage is determined by a real input signal and a scaling parameter.
#
# This component models an ideal voltage source. The voltage `v` across its positive and
# negative pins (inherited from the `TwoPin` base component) is determined by an
# external real input signal connected to its `V` input port, and a unit
# parameter `uV`. The signal at input `V` is treated as a dimensionless value,
# which is then multiplied by the parameter `uV` (which has units of Voltage)
# to produce the actual output voltage `v` across the pins.
# The relationship is given by:
# ```math
# v = V uV
# ```
# Where `V` is the value of the signal at the `RealInput` port.
component VoltageSource
extends OnePort
# External real input signal that provides the base value for the source voltage.
V = RealInput() [{
"Dyad": {"placement": {"icon": {"x1": 450, "y1": -50, "x2": 550, "y2": 50, "rot": 90}}}
}]
# Unit parameter to balance units in voltage relation.
final parameter uV::Voltage = 1.0
relations
v = V*uV
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
"icons": {"default": "dyad://ElectricalComponents/Voltage.svg"}
}
}
end
Flattened Source
# Ideal voltage source whose output voltage is determined by a real input signal and a scaling parameter.
#
# This component models an ideal voltage source. The voltage `v` across its positive and
# negative pins (inherited from the `TwoPin` base component) is determined by an
# external real input signal connected to its `V` input port, and a unit
# parameter `uV`. The signal at input `V` is treated as a dimensionless value,
# which is then multiplied by the parameter `uV` (which has units of Voltage)
# to produce the actual output voltage `v` across the pins.
# The relationship is given by:
# ```math
# v = V uV
# ```
# Where `V` is the value of the signal at the `RealInput` port.
component VoltageSource
# 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 provides the base value for the source voltage.
V = RealInput() [{
"Dyad": {"placement": {"icon": {"x1": 450, "y1": -50, "x2": 550, "y2": 50, "rot": 90}}}
}]
# Unit parameter to balance units in voltage relation.
final parameter uV::Voltage = 1.0
relations
v = p.v-n.v
i = p.i
p.i+n.i = 0
v = V*uV
metadata {
"Dyad": {
"labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
"icons": {"default": "dyad://ElectricalComponents/Voltage.svg"}
}
}
end
Test Cases
No test cases defined.
Related
- Examples
- Experiments
- Analyses
- Tests