electronic
¤
Electronic components.
Functions:
| Name | Description |
|---|---|
BJT_NPN |
NPN BJT using the transport form of the Ebers-Moll DC model. |
BJT_NPN_Dynamic |
NPN BJT with the Ebers-Moll DC model and first-order junction charge dynamics. |
CCCS |
Current Controlled Current Source (Current Gain). |
CCVS |
Current Controlled Voltage Source (Transresistance). |
Capacitor |
Q = C * V. |
CurrentSource |
Constant current source. |
Diode |
Ideal diode using the Shockley equation |
IdealOpAmp |
Ideal Op Amp. |
Inductor |
V = L * di/dt -> di_L/dt = V / L. |
NMOS |
N-channel MOSFET with square-law DC model and channel-length modulation. |
NMOSDynamic |
NMOS with square-law DC model and Meyer gate capacitance model. |
PMOS |
P-channel MOSFET with square-law DC model, formulated in terms of |
Resistor |
Ohm's Law: I = V/R. |
SmoothPulse |
Sigmoid-smoothed pulse. |
VCCS |
Voltage Controlled Current Source. |
VCVS |
Voltage Controlled Voltage Source. |
VoltageControlledSwitch |
Voltage Controlled Switch. |
VoltageSource |
Step voltage source. |
VoltageSourceAC |
Sinusoidal voltage source. |
ZenerDiode |
Zener diode with forward Shockley conduction and reverse breakdown. |
BJT_NPN
¤
BJT_NPN(
signals: Signals,
s: States,
Is: float = 1e-12,
BetaF: float = 100.0,
BetaR: float = 1.0,
Vt: float = 0.02585,
) -> PhysicsReturn
NPN BJT using the transport form of the Ebers-Moll DC model.
Junction voltages are clipped to [-5, 2] V before exponentiation.
For transient simulations with junction charge dynamics use
:func:BJT_NPN_Dynamic instead.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signals
|
Signals
|
Port voltages at collector ( |
required |
s
|
States
|
Unused. |
required |
Is
|
float
|
Saturation current in amperes. Defaults to |
1e-12
|
BetaF
|
float
|
Forward common-emitter current gain. Defaults to |
100.0
|
BetaR
|
float
|
Reverse common-emitter current gain. Defaults to |
1.0
|
Vt
|
float
|
Thermal voltage in volts. Defaults to |
0.02585
|
Source code in circulax/components/electronic.py
BJT_NPN_Dynamic
¤
BJT_NPN_Dynamic(
signals: Signals,
s: States,
Is: float = 1e-12,
BetaF: float = 100.0,
BetaR: float = 1.0,
Vt: float = 0.02585,
Cje: float = 1e-12,
Cjc: float = 1e-12,
Vje: float = 0.75,
Vjc: float = 0.75,
Mje: float = 0.33,
Mjc: float = 0.33,
Tf: float = 0.0,
Tr: float = 0.0,
) -> PhysicsReturn
NPN BJT with the Ebers-Moll DC model and first-order junction charge dynamics.
DC currents follow the transport form of the Ebers-Moll equations. Junction
voltages are clipped to [-5, 2] V before exponentiation to prevent
overflow during transient solver iterations.
Charge dynamics combine two contributions at each junction:
- Depletion charge — modelled as a nonlinear junction capacitance via
:func:
_junction_charge, using the standard abrupt/graded junction formula with ideality parametersVjandMj. - Diffusion charge — proportional to the junction current scaled by the
transit time (
Tffor BE,Trfor BC``), representing minority carrier storage in the base.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signals
|
Signals
|
Port voltages at collector ( |
required |
s
|
States
|
Unused; present to satisfy the component protocol. |
required |
Is
|
float
|
Saturation current in amperes. Defaults to |
1e-12
|
BetaF
|
float
|
Forward common-emitter current gain. Defaults to |
100.0
|
BetaR
|
float
|
Reverse common-emitter current gain. Defaults to |
1.0
|
Vt
|
float
|
Thermal voltage in volts. Defaults to |
0.02585
|
Cje
|
float
|
Zero-bias BE junction capacitance in farads. Defaults to |
1e-12
|
Cjc
|
float
|
Zero-bias BC junction capacitance in farads. Defaults to |
1e-12
|
Vje
|
float
|
BE built-in junction potential in volts. Defaults to |
0.75
|
Vjc
|
float
|
BC built-in junction potential in volts. Defaults to |
0.75
|
Mje
|
float
|
BE junction grading coefficient. Defaults to |
0.33
|
Mjc
|
float
|
BC junction grading coefficient. Defaults to |
0.33
|
Tf
|
float
|
Forward transit time in seconds. Defaults to |
0.0
|
Tr
|
float
|
Reverse transit time in seconds. Defaults to |
0.0
|
Returns:
| Type | Description |
|---|---|
PhysicsReturn
|
A two-tuple |
PhysicsReturn
|
|
PhysicsReturn
|
|
Source code in circulax/components/electronic.py
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 | |
CCCS
¤
Current Controlled Current Source (Current Gain).
Physics: 1. Input side (in_p, in_m) acts as a short circuit to measure 'i_ctrl'. 2. Output side pushes current I_out = alpha * i_ctrl.
Source code in circulax/components/electronic.py
CCVS
¤
Current Controlled Voltage Source (Transresistance).
Physics: 1. Input side (in_p, in_m) acts as a short circuit (0V drop) to measure current 'i_ctrl'. 2. Output side (out_p, out_m) acts as a voltage source V = R * i_ctrl.
Source code in circulax/components/electronic.py
Capacitor
¤
Q = C * V. Returns Charge (q) so the solver computes I = dq/dt.
Source code in circulax/components/electronic.py
CurrentSource
¤
Diode
¤
Diode(
signals: Signals, s: States, Is: float = 1e-12, n: float = 1.0, Vt: float = 0.02585
) -> PhysicsReturn
Ideal diode using the Shockley equation I = Is * (exp(Vd / n*Vt) - 1).
Junction voltage is clipped to [-5, 5] V for numerical stability.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signals
|
Signals
|
Port voltages at anode ( |
required |
s
|
States
|
Unused. |
required |
Is
|
float
|
Saturation current in amperes. Defaults to |
1e-12
|
n
|
float
|
Ideality factor. Defaults to |
1.0
|
Vt
|
float
|
Thermal voltage in volts. Defaults to |
0.02585
|
Source code in circulax/components/electronic.py
IdealOpAmp
¤
Ideal Op Amp.
Source code in circulax/components/electronic.py
Inductor
¤
V = L * di/dt -> di_L/dt = V / L.
We treat Flux (phi) = L * i_L.
Source code in circulax/components/electronic.py
NMOS
¤
NMOS(
signals: Signals,
s: States,
Kp: float = 2e-05,
W: float = 1e-05,
L: float = 1e-06,
Vth: float = 1.0,
lam: float = 0.0,
) -> PhysicsReturn
N-channel MOSFET with square-law DC model and channel-length modulation.
Gate current is zero (infinite input impedance).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signals
|
Signals
|
Port voltages at drain ( |
required |
s
|
States
|
Unused. |
required |
Kp
|
float
|
Process transconductance parameter in A/V². Defaults to |
2e-05
|
W
|
float
|
Gate width in metres. Defaults to |
1e-05
|
L
|
float
|
Gate length in metres. Defaults to |
1e-06
|
Vth
|
float
|
Threshold voltage in volts. Defaults to |
1.0
|
lam
|
float
|
Channel-length modulation coefficient in V⁻¹. Defaults to |
0.0
|
Source code in circulax/components/electronic.py
NMOSDynamic
¤
NMOSDynamic(
signals: Signals,
s: States,
Kp: float = 2e-05,
W: float = 1e-05,
L: float = 1e-06,
Vth: float = 1.0,
lam: float = 0.0,
Cox: float = 0.001,
Cgd_ov: float = 1e-15,
Cgs_ov: float = 1e-15,
) -> PhysicsReturn
NMOS with square-law DC model and Meyer gate capacitance model.
Gate charge is split into bias-dependent intrinsic charge (Meyer) and linear overlap contributions at the drain and source.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signals
|
Signals
|
Port voltages at drain ( |
required |
s
|
States
|
Unused. |
required |
Kp
|
float
|
Process transconductance parameter in A/V². Defaults to |
2e-05
|
W
|
float
|
Gate width in metres. Defaults to |
1e-05
|
L
|
float
|
Gate length in metres. Defaults to |
1e-06
|
Vth
|
float
|
Threshold voltage in volts. Defaults to |
1.0
|
lam
|
float
|
Channel-length modulation coefficient in V⁻¹. Defaults to |
0.0
|
Cox
|
float
|
Gate oxide capacitance per unit area in F/m². Defaults to |
0.001
|
Cgd_ov
|
float
|
Gate-drain overlap capacitance in farads. Defaults to |
1e-15
|
Cgs_ov
|
float
|
Gate-source overlap capacitance in farads. Defaults to |
1e-15
|
Source code in circulax/components/electronic.py
PMOS
¤
PMOS(
signals: Signals,
s: States,
Kp: float = 1e-05,
W: float = 2e-05,
L: float = 1e-06,
Vth: float = -1.0,
lam: float = 0.0,
) -> PhysicsReturn
P-channel MOSFET with square-law DC model, formulated in terms of Vsg and Vsd.
Gate current is zero (infinite input impedance).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signals
|
Signals
|
Port voltages at drain ( |
required |
s
|
States
|
Unused. |
required |
Kp
|
float
|
Process transconductance parameter in A/V². Defaults to |
1e-05
|
W
|
float
|
Gate width in metres. Defaults to |
2e-05
|
L
|
float
|
Gate length in metres. Defaults to |
1e-06
|
Vth
|
float
|
Threshold voltage in volts (negative for PMOS). Defaults to |
-1.0
|
lam
|
float
|
Channel-length modulation coefficient in V⁻¹. Defaults to |
0.0
|
Source code in circulax/components/electronic.py
Resistor
¤
SmoothPulse
¤
SmoothPulse(
signals: Signals,
s: States,
t: float,
V: float = 1.0,
delay: float = 1e-09,
tr: float = 1e-10,
) -> PhysicsReturn
Sigmoid-smoothed pulse.
Source code in circulax/components/electronic.py
VCCS
¤
Voltage Controlled Current Source.
Source code in circulax/components/electronic.py
VCVS
¤
Voltage Controlled Voltage Source.
Source code in circulax/components/electronic.py
VoltageControlledSwitch
¤
VoltageControlledSwitch(
signals: Signals,
s: States,
Ron: float = 1.0,
Roff: float = 1000000.0,
Vt: float = 0.0,
) -> PhysicsReturn
Voltage Controlled Switch.
Source code in circulax/components/electronic.py
VoltageSource
¤
VoltageSource(
signals: Signals, s: States, t: float, V: float = 0.0, delay: float = 0.0
) -> PhysicsReturn
Step voltage source.
Source code in circulax/components/electronic.py
VoltageSourceAC
¤
VoltageSourceAC(
signals: Signals,
s: States,
t: float,
V: float = 0.0,
freq: float = 1000000.0,
phase: float = 0.0,
delay: float = 0.0,
) -> PhysicsReturn
Sinusoidal voltage source.
Source code in circulax/components/electronic.py
ZenerDiode
¤
ZenerDiode(
signals: Signals,
s: States,
Vz: float = 5.0,
Is: float = 1e-12,
n: float = 1.0,
Vt: float = 0.02585,
) -> PhysicsReturn
Zener diode with forward Shockley conduction and reverse breakdown.
Breakdown is modelled as a reverse exponential that activates when
Vd < -Vz.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signals
|
Signals
|
Port voltages at anode ( |
required |
s
|
States
|
Unused. |
required |
Vz
|
float
|
Zener breakdown voltage in volts. Defaults to |
5.0
|
Is
|
float
|
Saturation current in amperes. Defaults to |
1e-12
|
n
|
float
|
Ideality factor. Defaults to |
1.0
|
Vt
|
float
|
Thermal voltage in volts. Defaults to |
0.02585
|