Electrical Engineering (electrical-engineering-ai999x)

Electrical Engineering covers DC and AC circuits, transients, phasors and power, operational amplifiers, diodes and transistors, digital logic, and control systems (transfer functions, stability, Bode): 92 calculations in 17 topics, each with its formula, its steps and its units, and a plain reason instead of a number when an input is missing or out of range. One compiled engine, four ways to use it: the desktop app, the command line, the browser and Python. Everything runs on your own computer, offline.

The Electrical Engineering desktop app: Thevenin equivalent of a DC circuit between two nodes, with its worked example and live scene

Four ways to use it

Desktop app (Windows, Linux) Windows · Linux
Command line electrical-engineering (Windows, Linux) Windows · Linux
Browser (any device) Try it on the model page
Python 3.10+ pip install electrical-engineering-ai999x: on Windows and Linux (x86-64) pip installs the same compiled engine; on other systems (macOS, ARM) it installs a pure-Python build that gives the same answers

See it

From the Electrical Engineering desktop app: every scene and chart is drawn from the computed answer.

Electrical Engineering desktop app: a slider moves an input and the answer, the scene and the charts follow

Watch the full clip (MP4)

Thevenin equivalent of a DC circuit between two nodes: the live scene in the Electrical Engineering desktop app
Thevenin equivalent of a DC circuit between two nodes
Gain margin and phase-crossover frequency: the live scene in the Electrical Engineering desktop app
Gain margin and phase-crossover frequency
Minimal sum of products from minterms (with don't-cares): the live scene in the Electrical Engineering desktop app
Minimal sum of products from minterms (with don't-cares)
Power-factor correction capacitor: the live scene in the Electrical Engineering desktop app
Power-factor correction capacitor
Time at which a sinusoid first reaches a value: the live scene in the Electrical Engineering desktop app
Time at which a sinusoid first reaches a value
Cells with internal resistance: series and parallel batteries on a load: the live scene in the Electrical Engineering desktop app
Cells with internal resistance: series and parallel batteries on a load
Parallel-plate capacitor: capacitance, charge, field, flux density and energy: the live scene in the Electrical Engineering desktop app
Parallel-plate capacitor: capacitance, charge, field, flux density and energy
D.C. shunt generator: field and armature currents, generated emf and powers: the live scene in the Electrical Engineering desktop app
D.C. shunt generator: field and armature currents, generated emf and powers

Charts:

Thevenin equivalent of a DC circuit between two nodes: a chart in the Electrical Engineering desktop app
Thevenin equivalent of a DC circuit between two nodes
Gain margin and phase-crossover frequency: a chart in the Electrical Engineering desktop app
Gain margin and phase-crossover frequency
Minimal sum of products from minterms (with don't-cares): a chart in the Electrical Engineering desktop app
Minimal sum of products from minterms (with don't-cares)
Power-factor correction capacitor: a chart in the Electrical Engineering desktop app
Power-factor correction capacitor

Ask in words: 15 examples

Each question below was asked on this release; the comment under it is the line it printed.

import electrical_engineering_ai999x as electrical_engineering

a = electrical_engineering.ask(
    "Find the branch currents of a current divider with I = 6 A, R1 = "
    "4 ohm, R2 = 2 ohm."
)
print(a.outcome, a.values)
# SOLVED {'I1': 2.0, 'I2': 4.0}

a = electrical_engineering.ask(
    "A difference amplifier has R1 = 10 kohm, R2 = 100 kohm, R3 = 10 "
    "kohm, R4 = 100 kohm, V1 = 1 V and V2 = 1.5 V. Find the output "
    "voltage."
)
print(a.outcome, a.values)
# SOLVED {'Vout': 5.0, 'gain_inverting': -10.0, 'gain_noninverting': 10.0}

a = electrical_engineering.ask(
    "Find the first-order transient value with V0 = 0 V, Vf = 10 V, "
    "tau = 1 ms, t = 2 ms."
)
print(a.outcome, a.values)
# SOLVED {'v': 8.646647167633873, 'fraction_complete': 0.8646647167633873}

a = electrical_engineering.ask(
    "Find the energy cost with P = 2 kW, t = 5 h, tariff = 0.15 per "
    "kWh."
)
print(a.outcome, a.values)
# SOLVED {'energy': 36000000.0, 'energy_kWh': 10.0, 'cost': 1.5}

a = electrical_engineering.ask(
    "Convert a delta with Rab = 10 ohm, Rbc = 20 ohm, Rca = 30 ohm to "
    "a wye."
)
print(a.outcome, a.values)
# SOLVED {'Ra': 5.0, 'Rb': 3.3333333333333335, 'Rc': 10.0}

a = electrical_engineering.ask(
    "Convert the binary number 1011 to Gray code."
)
print(a.outcome, a.values)
# SOLVED {'result': '1110', 'decimal': 14.0}

a = electrical_engineering.ask(
    "Find the output of an inverting amplifier with Rin = 10 kohm, Rf "
    "= 47 kohm, Vin = 0.5 V."
)
print(a.outcome, a.values)
# SOLVED {'gain': -4.7, 'Vout': -2.35}

a = electrical_engineering.ask(
    "Find the resistance at a new temperature with R1 = 50 ohm, alpha1 "
    "= 0.004, T1 = 20 °C, T2 = 80 °C."
)
print(a.outcome, a.values)
# SOLVED {'R2': 62.0, 'alpha2': 0.0032258064516129032, 'change': 12.0}

a = electrical_engineering.ask(
    "Find the generated emf of a lap-wound d.c. machine with poles = "
    "4, flux = 25 mWb, Z = 600, n = 20 rev/s."
)
print(a.outcome, a.values)
# SOLVED {'E': 300.0, 'paths': 4.0, 'conductor_emf': 2.0}

a = electrical_engineering.ask(
    "Find the equivalent capacitance of 3 uF and 6 uF capacitors in "
    "parallel."
)
print(a.outcome, a.values)
# SOLVED {'equivalent': 9.0, 'count': 2.0, 'unit': 'uF'}

a = electrical_engineering.ask("Is (A·B)' equivalent to A' + B'?")
print(a.outcome, a.values)
# SOLVED {'equivalent': True, 'counterexample': 'none'}

a = electrical_engineering.ask(
    "Find the energy stored in an inductor with L = 50 mH, I = 2 A."
)
print(a.outcome, a.values)
# SOLVED {'energy': 0.1, 'flux_linkage': 0.1}

a = electrical_engineering.ask(
    "Find the temperature coefficient from R1 = 100 ohm, T1 = 20 °C, "
    "R2 = 120 ohm, T2 = 70 °C."
)
print(a.outcome, a.values)
# SOLVED {'alpha1': 0.004, 'alpha2': 0.0033333333333333335, 'slope': 0.4}

a = electrical_engineering.ask(
    "Find the equivalent capacitance of 3 uF and 6 uF capacitors in "
    "series."
)
print(a.outcome, a.values)
# SOLVED {'equivalent': 2.0, 'count': 2.0, 'unit': 'uF'}

a = electrical_engineering.ask(
    "Evaluate A AND (B OR NOT C) for A=1, B=0, C=0."
)
print(a.outcome, a.values)
# SOLVED {'value': 1.0}

Command line: 15 examples

Each command below was run with electrical-engineering of this release; the lines under it are the answer it printed (the full answer goes on with the method, every input in SI units and the conditions it assumes).

$ electrical-engineering solve ac_mesh_currents "R=[[10, -4], [-4, 8]]" "X=[[5, -2], [-2, -3]]" "V_mag=[10, 0]" "V_deg=[0, 0]"
currents_real = [0.984837545126,0.462093862816]
currents_imag = [-0.290252707581,0.274368231047]
currents_mag = [1.02671886344,0.5374092149]
currents_deg = [-16.4213738458,30.6997225508]
first_mag = 1.026718863 A
first_deg = -16.42137385

$ electrical-engineering solve sinusoid_values "Vm=200 V" "w=314.159 rad/s" phi=0 "t=0.0025 s"
v = 141.4212624 V
f = 49.99995777 Hz
T = 0.02000001689 s
phase_deg = 0
relation = in phase
time_shift = 0 s

$ electrical-engineering solve cell_battery "E=1.5 V" "r=0.5 ohm" n=4 "RL=10 ohm" connection=series
emf_total = 6 V
r_total = 2 ohm
I = 0.5 A
V_terminal = 5 V
lost_volts = 1 V
P_load = 2.5 W

$ electrical-engineering solve parallel_plate_capacitor "V=200 V" "d=0.0001 m" "A=0.0004 m^2" eps_r=5
C = 1.770837564e-10 F
Q = 3.541675127e-08 C
E = 2000000 N/C
D = 8.854187818e-05
energy = 3.541675127e-06 J

$ electrical-engineering solve closed_loop_poles "num=[2]" "den=[1, 3, 0]"
poles = [-2.0,-1.0000000000000002]
max_real_part = -1
stable = true
characteristic = [1.0,3.0,2.0]

$ electrical-engineering solve dc_shunt_generator "V=250 V" "IL=100 A" "Ra=0.1 ohm" "Rf=125 ohm"
If = 2 A
Ia = 102 A
E = 260.2 V
P_out = 25000 W
P_generated = 26540.4 W
copper_loss = 1540.4 W

$ electrical-engineering solve current_divider "I=6 A" "R1=4 ohm" "R2=2 ohm"
I1 = 2 A
I2 = 4 A

$ electrical-engineering solve adc_conversion "Vin=1.2 V" "Vref=5 V" bits=8
code = 61
binary = 00111101
lsb = 0.01953125 V
lsb_mV = 19.53125
quantized = 1.19140625 V

$ electrical-engineering solve bjt_divider_bias "VCC=12 V" "VBE=0.7 V" "R1=10000 ohm" "R2=2200 ohm" "RC=3600 ohm" "RE=1000 ohm" beta=100
IC = 0.001424015309 A
IC_mA = 1.424015309
IB = 1.424015309e-05 A
IE = 0.001438255462 A
VB = 2.138255462 V
VE = 1.438255462 V

$ electrical-engineering solve faraday_emf N=200 "dPhi=0.025 Wb" "dt=0.05 s"
emf = 100 V
emf_signed = -100 V
flux_rate = 0.5
linkage_change = 5

$ electrical-engineering solve plane_wave_lossy "f=1000000 Hz" eps_r=1 mu_r=1 sigma=58000000
alpha = 15131.91403
beta = 15131.91403
skin_depth = 6.60854931e-05 m
v = 415.2273993 m/s
wavelength = 0.0004152273993 m
eta = 0.0003689613455 ohm

$ electrical-engineering solve magnetic_circuit N=500 "flux=0.0006 Wb" "lengths=[0.4, 0.001]" "areas=[0.0005, 0.0005]" "mu_r=[800, 1]"
reluctance = 2387324.146
mmf = 1432.394488
current = 2.864788976 A
flux = 0.0006 Wb
B = [1.2,1.2]
H = [1193.6620731892149,954929.658551372]

$ electrical-engineering solve ammeter_shunt "Ifs=0.001 A" "Rm=100 ohm" "I=1 A"
Rsh = 0.1001001001 ohm
multiplying_factor = 1000
V_fs = 0.1 V
R_total = 0.1 ohm

$ electrical-engineering solve difference_amplifier "R1=10000 ohm" "R2=100000 ohm" "R3=10000 ohm" "R4=100000 ohm" "V1=1 V" "V2=1.5 V"
Vout = 5 V
gain_inverting = -10
gain_noninverting = 10

$ electrical-engineering solve coil_capacitor_parallel "R=10 ohm" "L=0.1 H" "C=1e-05 F" "V=100 V" "f=50 Hz"
I_coil = 3.033144711 A
I_C = 0.3141592654 A
I = 2.735445524 A
Z = 36.55711624 ohm
phase_deg = 70.34691454
P = 91.99966835 W

Rust library: 15 examples

The crate electrical-engineering-ai999x (in rust/ of the GitHub repository) answers a JSON request with electrical_engineering_ai999x::solve_json. Each call below was compiled and run on this release; the comment under it is what it printed. The whole program is rust/electrical-engineering/examples/readme.rs: cd rust && cargo run --release --example readme -p electrical-engineering-ai999x.

use serde_json::{json, Value};

fn show(request: Value) {
    let answer: Value = serde_json::from_str(&electrical_engineering_ai999x::solve_json(&request.to_string())).unwrap();
    println!("{}", answer["outcome"].as_str().unwrap_or(""));
    for v in answer["values"].as_array().into_iter().flatten() {
        let unit = v[2].as_str().unwrap_or("");
        let unit = if unit.is_empty() || unit == "1" { String::new() } else { format!(" {unit}") };
        println!("{} = {}{}", v[0].as_str().unwrap_or(""), v[1], unit);
    }
}

show(json!({"key": "ac_mesh_currents", "inputs": {"R": [[10, -4], [-4, 8]], "X": [[5, -2], [-2, -3]], "V_mag": [10, 0], "V_deg": [0, 0]}}));
// SOLVED
// currents_real = [0.984837545126,0.462093862816]
// currents_imag = [-0.290252707581,0.274368231047]
// currents_mag = [1.02671886344,0.5374092149]
// currents_deg = [-16.4213738458,30.6997225508]
// first_mag = 1.02671886344 A
// first_deg = -16.4213738458

show(json!({"key": "sinusoid_values", "inputs": {"Vm": "200 V", "w": "314.159 rad/s", "phi": "0", "t": "0.0025 s"}}));
// SOLVED
// v = 141.4212624187115 V
// f = 49.999957766806745 Hz
// T = 0.02000001689329157 s
// phase_deg = 0.0
// relation = "in phase"
// time_shift = 0.0 s

show(json!({"key": "cell_battery", "inputs": {"E": "1.5 V", "r": "0.5 ohm", "n": "4", "RL": "10 ohm", "connection": "series"}}));
// SOLVED
// emf_total = 6.0 V
// r_total = 2.0 ohm
// I = 0.5 A
// V_terminal = 5.0 V
// lost_volts = 1.0 V
// P_load = 2.5 W

show(json!({"key": "parallel_plate_capacitor", "inputs": {"V": "200 V", "d": "0.0001 m", "A": "0.0004 m^2", "eps_r": "5"}}));
// SOLVED
// C = 1.7708375635240778e-10 F
// Q = 3.541675127048156e-8 C
// E = 2000000.0 N/C
// D = 0.0000885418781762039
// energy = 3.541675127048156e-6 J

show(json!({"key": "closed_loop_poles", "inputs": {"num": [2], "den": [1, 3, 0]}}));
// SOLVED
// poles = [-2.0,-1.0000000000000002]
// max_real_part = -1.0000000000000002
// stable = true
// characteristic = [1.0,3.0,2.0]

show(json!({"key": "dc_shunt_generator", "inputs": {"V": "250 V", "IL": "100 A", "Ra": "0.1 ohm", "Rf": "125 ohm"}}));
// SOLVED
// If = 2.0 A
// Ia = 102.0 A
// E = 260.2 V
// P_out = 25000.0 W
// P_generated = 26540.399999999998 W
// copper_loss = 1540.4 W

show(json!({"key": "current_divider", "inputs": {"I": "6 A", "R1": "4 ohm", "R2": "2 ohm"}}));
// SOLVED
// I1 = 2.0 A
// I2 = 4.0 A

show(json!({"key": "adc_conversion", "inputs": {"Vin": "1.2 V", "Vref": "5 V", "bits": "8"}}));
// SOLVED
// code = 61.0
// binary = "00111101"
// lsb = 0.01953125 V
// lsb_mV = 19.53125
// quantized = 1.19140625 V

show(json!({"key": "bjt_divider_bias", "inputs": {"VCC": "12 V", "VBE": "0.7 V", "R1": "10000 ohm", "R2": "2200 ohm", "RC": "3600 ohm", "RE": "1000 ohm", "beta": "100"}}));
// SOLVED
// IC = 0.0014240153085632277 A
// IC_mA = 1.4240153085632277
// IB = 0.000014240153085632277 A
// IE = 0.00143825546164886 A
// VB = 2.13825546164886 V
// VE = 1.43825546164886 V

show(json!({"key": "faraday_emf", "inputs": {"N": "200", "dPhi": "0.025 Wb", "dt": "0.05 s"}}));
// SOLVED
// emf = 100.0 V
// emf_signed = -100.0 V
// flux_rate = 0.5
// linkage_change = 5.0

show(json!({"key": "plane_wave_lossy", "inputs": {"f": "1000000 Hz", "eps_r": "1", "mu_r": "1", "sigma": "58000000"}}));
// SOLVED
// alpha = 15131.914026488967
// beta = 15131.91402650348
// skin_depth = 0.00006608549310083732 m
// v = 415.2273992685007 m/s
// wavelength = 0.0004152273992685007 m
// eta = 0.0003689613455333556 ohm

show(json!({"key": "magnetic_circuit", "inputs": {"N": "500", "flux": "0.0006 Wb", "lengths": [0.4, 0.001], "areas": [0.0005, 0.0005], "mu_r": [800, 1]}}));
// SOLVED
// reluctance = 2387324.14637843
// mmf = 1432.394487827058
// current = 2.8647889756541156 A
// flux = 0.0006 Wb
// B = [1.2,1.2]
// H = [1193.6620731892149,954929.658551372]

show(json!({"key": "ammeter_shunt", "inputs": {"Ifs": "0.001 A", "Rm": "100 ohm", "I": "1 A"}}));
// SOLVED
// Rsh = 0.1001001001001001 ohm
// multiplying_factor = 1000.0
// V_fs = 0.1 V
// R_total = 0.1 ohm

show(json!({"key": "difference_amplifier", "inputs": {"R1": "10000 ohm", "R2": "100000 ohm", "R3": "10000 ohm", "R4": "100000 ohm", "V1": "1 V", "V2": "1.5 V"}}));
// SOLVED
// Vout = 5.0 V
// gain_inverting = -10.0
// gain_noninverting = 10.0

show(json!({"key": "coil_capacitor_parallel", "inputs": {"R": "10 ohm", "L": "0.1 H", "C": "1e-05 F", "V": "100 V", "f": "50 Hz"}}));
// SOLVED
// I_coil = 3.0331447105335285 A
// I_C = 0.3141592653589793 A
// I = 2.735445524178679 A
// Z = 36.55711624161301 ohm
// phase_deg = 70.34691453987996
// P = 91.99966835037522 W

Guides

  • Desktop app guide: the window, every calculation, scenes and charts: PDF · HTML · Markdown
  • Python guide: every calculation with a Python example: PDF · HTML · Markdown
  • Command-line guide: every calculation with the command and what it printed: PDF · HTML · Markdown

Every calculation, with its formula, a worked example and its figures: Electrical Engineering on ai999x.com. Install guides for the app and the command line: https://www.ai999x.com/desktop-cli/.

Version 1.6.4 · License: Apache-2.0 · Author: Ibnul Jaif Farabi · Organization: AI999X · Contact: support@ai999x.com · Support the project

The Future Is Self-Improving.

Downloads last month
278
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collections including AI999X/electrical-engineering-ai999x

Evaluation results

  • identical on every platform on Golden answers (493 documented questions, Windows + Linux Python 3.10-3.14)
    self-reported
    1.000