ModelingToolkitStandardLibrary: Electrical Components
Index
ModelingToolkitStandardLibrary.Electrical.Capacitor
ModelingToolkitStandardLibrary.Electrical.Conductor
ModelingToolkitStandardLibrary.Electrical.Current
ModelingToolkitStandardLibrary.Electrical.CurrentSensor
ModelingToolkitStandardLibrary.Electrical.Diode
ModelingToolkitStandardLibrary.Electrical.Ground
ModelingToolkitStandardLibrary.Electrical.IdealOpAmp
ModelingToolkitStandardLibrary.Electrical.Inductor
ModelingToolkitStandardLibrary.Electrical.MultiSensor
ModelingToolkitStandardLibrary.Electrical.NPN
ModelingToolkitStandardLibrary.Electrical.OnePort
ModelingToolkitStandardLibrary.Electrical.PNP
ModelingToolkitStandardLibrary.Electrical.Pin
ModelingToolkitStandardLibrary.Electrical.PotentialSensor
ModelingToolkitStandardLibrary.Electrical.PowerSensor
ModelingToolkitStandardLibrary.Electrical.Resistor
ModelingToolkitStandardLibrary.Electrical.VariableResistor
ModelingToolkitStandardLibrary.Electrical.Voltage
ModelingToolkitStandardLibrary.Electrical.VoltageSensor
ModelingToolkitStandardLibrary.Electrical.DigitalPin
Electrical Utilities
ModelingToolkitStandardLibrary.Electrical.Pin
— ConstantPin(; name)
A pin in an analog circuit.
States:
v(t)
: [V
] The voltage at this pini(t)
: [A
] The current passing through this pin
ModelingToolkitStandardLibrary.Electrical.OnePort
— ConstantOnePort(; name, v = 0.0, i = 0.0)
Component with two electrical pins p
and n
and current i
flows from p
to n
.
States:
v(t)
: [V
] The voltage across componentp.v - n.v
i(t)
: [A
] The current passing through positive pin
Connectors:
p
Positive pinn
Negative pin
ModelingToolkitStandardLibrary.Electrical.DigitalPin
— FunctionDigitalPin(; name)
A pin in a digital circuit.
States:
v(t)
: [V
] The voltage at this pini(t)
: [A
] The current passing through this pinval(t)
: The binary value of the pin at this point. A voltage from0V
to0.8V
is a binary value of0
.
A voltage in the range 2.0V
to 5.0V
is 1
. Any other value is X
.
Analog Components
ModelingToolkitStandardLibrary.Electrical.Ground
— ConstantGround(; name)
Ground node with the potential of zero and connector g
. Every circuit must have one ground node.
Connectors:
g
ModelingToolkitStandardLibrary.Electrical.Resistor
— ConstantResistor(; name, R = 1.0, T_ref = 300.15, alpha = 0, T_dep = false)
Generic resistor with optional temperature dependency.
States:
- See OnePort
R(t)
: [Ω
] Resistance (temperature dependent ifT_dep = true
)
Connectors:
p
Positive pinn
Negative pinheat_port
HeatPort (only ifT_dep = true
) Heat port to model the temperature dependency
Parameters:
R
: [Ω
] Reference resistanceT_ref
: [K] Reference temperaturealpha
: [K⁻¹] Temperature coefficient of resistanceT_dep
: [bool] Temperature dependency
ModelingToolkitStandardLibrary.Electrical.Conductor
— ConstantConductor(; name, G)
Creates an ideal conductor.
States:
See OnePort
Connectors:
p
Positive pinn
Negative pin
Parameters:
G
: [S
] Conductance
ModelingToolkitStandardLibrary.Electrical.Capacitor
— ConstantCapacitor(; name, C, v)
Creates an ideal capacitor. Initial voltage of capacitor can be set with v
([V
])
States:
See OnePort
Connectors:
p
Positive pinn
Negative pin
Parameters:
C
: [F
] Capacitance
ModelingToolkitStandardLibrary.Electrical.Inductor
— ConstantInductor(; name, L, i)
Creates an ideal Inductor. Initial current through inductor can be set with i
([A
]).
States:
See OnePort
Connectors:
p
Positive pinn
Negative pin
Parameters:
L
: [H
] Inductance
ModelingToolkitStandardLibrary.Electrical.IdealOpAmp
— ConstantIdealOpAmp(; name)
Ideal operational amplifier (norator-nullator pair). The ideal OpAmp is a two-port. The left port is fixed to v1 = 0
and i1 = 0
(nullator). At the right port both any voltage v2
and any current i2
are possible (norator).
States:
See TwoPort
Connectors:
p1
Positive pin (left port)p2
Positive pin (right port)n1
Negative pin (left port)n2
Negative pin (right port)
ModelingToolkitStandardLibrary.Electrical.Diode
— ConstantDiode(; name, Is = 1e-6, n = 1, T = 300.15, T_dep = false)
Generic diode with optional temperature dependency.
States
- See [OnePort](@ref)
Connectors
- `p` Positive pin
- `n` Negative pin
- `port` [HeatPort](@ref) (only if `T_dep = true`) Heat port to model variable temperature dependency
Parameters:
- `Is`: [`A`] Saturation current
- `n`: Ideality factor
- `T`: [K] Constant ambient temperature - only used if T_dep=false
- `T_dep`: [bool] Temperature dependency
Missing docstring for HeatingDiode
. Check Documenter's build log for details.
ModelingToolkitStandardLibrary.Electrical.VariableResistor
— ConstantVariableResistor(; name, R_ref = 1.0, T_ref = 300.15, R_const = 1e-3, T_dep = false)
Variable resistor with optional temperature dependency.
The total resistance R ∈ [Rconst, Rconst + Rref], where pos is the position of the wiper and Rref is the variable resistance between p and n. The total resistance is then:
R = Rconst + pos * Rref
If T_dep is true, then R also depends on the temperature of the heat port with temperature coefficient alpha. The total resistance is then:
R = Rconst + pos * Rref * (1 + alpha * (port.T - T_ref))
States
- See [OnePort](@ref)
- `pos(t)`: Position of the wiper (normally 0-1)
- `R(t)`: Resistance
Connectors
- `p` Positive pin
- `n` Negative pin
- `position` RealInput to set the position of the wiper
- `port` [HeatPort](@ref) Heat port to model the temperature dependency
Parameters
- `R_ref`: [`Ω`] Resistance at temperature T_ref when fully closed (pos=1.0)
- `T_ref`: [K] Reference temperature
- `R_const`: [`Ω`] Constant resistance between p and n
- `T_dep`: Temperature dependency
- `alpha`: [K⁻¹] Temperature coefficient of resistance
- `enforce_bounds`: Enforce bounds for the position of the wiper (0-1)
ModelingToolkitStandardLibrary.Electrical.PNP
— ConstantPNP(;name, B_F, B_R, Is, V_T, V_A, phi_C, phi_E, Z_C, Z_E, Tau_f, Tau_r, C_jC0, C_jE0, C_CS, gamma_C, gamma_E, NF, NR)
Creates a PNP Bipolar Junction Transistor following a modified Ebers-Moll model. Includes an optional substrate pin and optional Early voltage effect.
# Structural Parameters
- `use_substrate`: If `true`, a substrate pin connector is available. If `false` it is
assumed the substrate is connected to the collector pin.
- `use_Early`: If `true`, the Early effect is modeled, which takes in to account the effect
collector-base voltage variations have on the collector-base depletion region. In many cases this
effectively means that the collector current has a dependency on the collector-emitter voltage.
- `use_advanced_continuation`: When false, the `C_jC` and `C_jE` non-linear capacitance curves use
a simplified linear continuation starting when `V_CB` and `V_EB` are 0, respectively. If `true`, the `Z_C` and `Z_E` parameters
are used to start the linear continuation at `Phi_C - Z_C` and `Phi_E - Z_E`.
# Connectors
- `b` Base Pin
- `c` Collector Pin
- `e` Emitter Pin
- `s` Substrate Pin, only available when `use_substrate = true`
# Parameters
- `B_F`: Forward beta
- `B_R`: Reverse beta
- `Is`: Saturation current
- `V_T`: Thermal voltage at 300K
- `V_A`: Inverse Early voltage
- `phi_C`: Collector junction exponent
- `phi_E`: Emitter junction exponent
- `Z_C`: Collector junction offset
- `Z_E`: Emitter junction offset
- `Tau_f`: Forward transit time
- `Tau_r`: Reverse transit time
- `C_jC0`: Collector junction capacitance coefficient
- `C_jE0`: Emitter junction capacitance coefficient
- `C_CS`: Collector-substrate capacitance
- `gamma_C`: Collector junction exponent
- `gamma_E`: Emitter junction exponent
- `NF`: Forward emission coefficient
- `NR`: Reverse emission coefficient
ModelingToolkitStandardLibrary.Electrical.NPN
— ConstantNPN(;name, B_F, B_R, Is, V_T, V_A, phi_C, phi_E, Z_C, Z_E, Tau_f, Tau_r, C_jC0, C_jE0, C_CS, gamma_C, gamma_E, NF, NR)
Creates an NPN Bipolar Junction Transistor following a modified Ebers-Moll model. Includes an optional substrate pin and optional Early voltage effect.
# Structural Parameters
- `use_substrate`: If `true`, a substrate pin connector is available. If `false` it is
assumed the substrate is connected to the collector pin.
- `use_Early`: If `true`, the Early effect is modeled, which takes in to account the effect
collector-base voltage variations have on the collector-base depletion region. In many cases this
effectively means that the collector current has a dependency on the collector-emitter voltage.
- `use_advanced_continuation`: When false, the `C_jC` and `C_jE` non-linear capacitance curves use
a simplified linear continuation starting when `V_BC` and `V_BE` are 0, respectively. If `true`, the `Z_C` and `Z_E` parameters
are used to start the linear continuation at `Phi_C - Z_C` and `Phi_E - Z_E`.
# Connectors
- `b` Base Pin
- `c` Collector Pin
- `e` Emitter Pin
- `s` Substrate Pin, only available when `use_substrate = true`
# Parameters
- `B_F`: Forward beta
- `B_R`: Reverse beta
- `Is`: Saturation current
- `V_T`: Thermal voltage at 300K
- `V_A`: Inverse Early voltage
- `phi_C`: Collector junction exponent
- `phi_E`: Emitter junction exponent
- `Z_C`: Collector junction offset
- `Z_E`: Emitter junction offset
- `Tau_f`: Forward transit time
- `Tau_r`: Reverse transit time
- `C_jC0`: Collector junction capacitance coefficient
- `C_jE0`: Emitter junction capacitance coefficient
- `C_CS`: Collector-substrate capacitance
- `gamma_C`: Collector junction exponent
- `gamma_E`: Emitter junction exponent
- `NF`: Forward emission coefficient
- `NR`: Reverse emission coefficient
Analog Sensors
ModelingToolkitStandardLibrary.Electrical.CurrentSensor
— ConstantCurrentSensor(; name)
Creates a circuit component that measures the current flowing through it. Analogous to an ideal ammeter.
States:
i(t)
: [A
] Current through the sensor
Connectors:
p
Positive pinn
Negative pin
ModelingToolkitStandardLibrary.Electrical.PotentialSensor
— ConstantPotentialSensor(; name)
Creates a circuit component which measures the potential at a pin.
States:
phi(t)
: [V
] The measured potential at this point
Connectors:
p
Pin at which potential is to be measured
ModelingToolkitStandardLibrary.Electrical.VoltageSensor
— ConstantVoltageSensor(; name)
Creates a circuit component that measures the voltage across it. Analogous to an ideal voltmeter.
States:
v(t)
: [V
] The voltage difference from positive to negative pinp.v - n.v
Connectors:
p
Positive pinn
Negative pin
ModelingToolkitStandardLibrary.Electrical.PowerSensor
— ConstantPowerSensor(; name)
Combines a VoltageSensor
and a CurrentSensor
to measure the power being consumed by a circuit.
States:
power(t)
: [W
] The power being consumed, given by the product of voltage and current- See VoltageSensor
- See CurrentSensor
Connectors:
pc
Corresponds to thep
pin of theCurrentSensor
nc
Corresponds to then
pin of theCurrentSensor
pv
Corresponds to thep
pin of theVoltageSensor
nv
Corresponds to then
pin of theVoltageSensor
ModelingToolkitStandardLibrary.Electrical.MultiSensor
— ConstantMultiSensor(; name)
Combines a VoltageSensor
and a CurrentSensor
.
States:
v(t)
: [V
] The voltage across theVoltageSensor
. Defaults to 1.0.i(t)
: [A
] The current across theCurrentSensor
. Defaults to 1.0.
Connectors:
pc
Corresponds to thep
pin of theCurrentSensor
nc
Corresponds to then
pin of theCurrentSensor
pv
Corresponds to thep
pin of theVoltageSensor
nv
Corresponds to then
pin of theVoltageSensor
Analog Sources
ModelingToolkitStandardLibrary.Electrical.Voltage
— ConstantVoltage(; name)
Acts as an ideal voltage source with no internal resistance.
States:
See OnePort
Connectors:
p
Positive pinn
Negative pinV
RealInput Input for the voltage control signal, i.e.V ~ p.v - n.v
ModelingToolkitStandardLibrary.Electrical.Current
— ConstantCurrent(; name)
Acts as an ideal current source with no internal resistance.
States:
See OnePort
Connectors:
p
Positive pinn
Negative pinI
RealInput Input for the current control signal, i.e. `I ~ p.i
Digital Gates
Missing docstring for Not
. Check Documenter's build log for details.
Missing docstring for And
. Check Documenter's build log for details.
Missing docstring for Nand
. Check Documenter's build log for details.
Missing docstring for Or
. Check Documenter's build log for details.
Missing docstring for Nor
. Check Documenter's build log for details.
Missing docstring for Xor
. Check Documenter's build log for details.
Missing docstring for Xnor
. Check Documenter's build log for details.
Digital Components
Missing docstring for HalfAdder
. Check Documenter's build log for details.
Missing docstring for FullAdder
. Check Documenter's build log for details.
Missing docstring for MUX
. Check Documenter's build log for details.
Missing docstring for DEMUX
. Check Documenter's build log for details.
Missing docstring for Encoder
. Check Documenter's build log for details.
Missing docstring for Decoder
. Check Documenter's build log for details.
Digital Sources
Missing docstring for PulseDiff
. Check Documenter's build log for details.
Missing docstring for Set
. Check Documenter's build log for details.
Missing docstring for Reset
. Check Documenter's build log for details.
Missing docstring for Pulse
. Check Documenter's build log for details.