ModelingToolkitStandardLibrary: Electrical Components

Index

Electrical Utilities

ModelingToolkitStandardLibrary.Electrical.OnePortConstant
OnePort(; 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 component p.v - n.v
  • i(t): [A] The current passing through positive pin

Connectors:

  • p Positive pin
  • n Negative pin
source
ModelingToolkitStandardLibrary.Electrical.DigitalPinFunction
DigitalPin(; name)

A pin in a digital circuit.

States:

  • v(t): [V] The voltage at this pin
  • i(t): [A] The current passing through this pin
  • val(t): The binary value of the pin at this point. A voltage from 0V to 0.8V is a binary value of 0.

A voltage in the range 2.0V to 5.0V is 1. Any other value is X.

source

Analog Components

ModelingToolkitStandardLibrary.Electrical.ResistorConstant
Resistor(; 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 if T_dep = true)

Connectors:

  • p Positive pin
  • n Negative pin
  • heat_portHeatPort (only if T_dep = true) Heat port to model the temperature dependency

Parameters:

  • R: [Ω] Reference resistance
  • T_ref: [K] Reference temperature
  • alpha: [K⁻¹] Temperature coefficient of resistance
  • T_dep: [bool] Temperature dependency
source
ModelingToolkitStandardLibrary.Electrical.IdealOpAmpConstant
IdealOpAmp(; 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)
source
ModelingToolkitStandardLibrary.Electrical.DiodeConstant
Diode(; 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
source
Missing docstring.

Missing docstring for HeatingDiode. Check Documenter's build log for details.

ModelingToolkitStandardLibrary.Electrical.VariableResistorConstant
VariableResistor(; 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)
source
ModelingToolkitStandardLibrary.Electrical.PNPConstant
PNP(;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
source
ModelingToolkitStandardLibrary.Electrical.NPNConstant
NPN(;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
source

Analog Sensors

ModelingToolkitStandardLibrary.Electrical.VoltageSensorConstant

VoltageSensor(; 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 pin p.v - n.v

Connectors:

  • p Positive pin
  • n Negative pin
source
ModelingToolkitStandardLibrary.Electrical.PowerSensorConstant

PowerSensor(; name)

Combines a VoltageSensor and a CurrentSensor to measure the power being consumed by a circuit.

States:

Connectors:

source

Analog Sources

Digital Gates

Missing docstring.

Missing docstring for Not. Check Documenter's build log for details.

Missing docstring.

Missing docstring for And. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Nand. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Or. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Nor. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Xor. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Xnor. Check Documenter's build log for details.

Digital Components

Missing docstring.

Missing docstring for HalfAdder. Check Documenter's build log for details.

Missing docstring.

Missing docstring for FullAdder. Check Documenter's build log for details.

Missing docstring.

Missing docstring for MUX. Check Documenter's build log for details.

Missing docstring.

Missing docstring for DEMUX. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Encoder. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Decoder. Check Documenter's build log for details.

Digital Sources

Missing docstring.

Missing docstring for PulseDiff. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Set. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Reset. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Pulse. Check Documenter's build log for details.