Python Linear Analog Circuit Caclulator
from pylacc.circuit import *
- Voltage Source:
e(voltage, frequency, **)
- Current Source:
i(amperage, frequency, **)
- Resistor:
r(resistance, frequency, **)
- Capacitor:
c(capacitance, **)xc(reactance, **)
- Inductor:
l(inductance, **)xl(reactance, **)
**EVoltage (complex, phasor)ICurrent (complex, phasor)ZImpedence (complex, phasor) (aliasR)CCapacitance (positive, real)LInductance (positive, real)XCCapacitive Reactance (positive, real)XLInductive Reactance (positive, real)FFrequency (positive, real)PTTrue Power (positive, real) (aliasP)PRReactive Power (positive, real)PAApparent Power (positive, real)
1.0 + 1.0j (complex)
(radius, angle) (tuple)
k10^3M10^6G10^9T10^12m10^-3u10^-6n10^-9p10^-12
e(12) + r(100) + r(300)
+(12V 30mA)
+-S[12V](30mA 360mW)
+-R[100Ω](3V 30mA)
+-R[300Ω](9V 30mA)
e(12, 60) + xl(100) / xc(200) / r(300)
+(12V 72.1∠-56.3°mA)
+-S[12V 60Hz](72.1∠-56.3°mA 865mVA)
+-/(12V 72.1∠-56.3°mA)
+ /-L[100Ω](12V 120∠-90°mA 265mH)
+ /-C[200Ω](12V 60∠90°mA 13.3μF)
+ /-R[300Ω](12V 40mA)
Components can be grouped to prevent further concatenation.
FILTER = (l(1e-3) + c(0.0022e-6)).g
C = e(10, 107e3) + FILTER + r(100)
C.solve()
FILTER
+(380∠-87.8°mV 99.9∠2.18°mA)
+-L[1mH](67.2∠92.2°V 99.9∠2.18°mA 672Ω)
+-C[2.2nF](67.6∠-87.8°V 99.9∠2.18°mA 676Ω)
- Support multiple sources