Watt's Law | Engineering Calculator API

Posted on March 1, 2026 by Boden Bensema

Watt's Law API

Compute electrical power, current, voltage, resistance, or energy over time using Watt's Law. This endpoint is ideal for students, engineers, and developers working on circuit calculations, energy analysis, or efficiency estimations.

Law

P=VIP = V \cdot I

Combined with Ohm's Law:

P=I2RP = I^2 \cdot R

P=V2RP = \frac{V^2}{R}

Energy over time:

E=PΔtE = P \cdot \Delta t

Optional efficiency factor:

Pout=ηPinP_{\text{out}} = \eta \cdot P_{\text{in}}

Request Body

1{ 2 "law": "watts", 3 "vars": { 4 "P": null, 5 "P_i": null, 6 "P_f": null, 7 "V": null, 8 "V_i": null, 9 "V_f": null, 10 "I": null, 11 "I_i": null, 12 "I_f": null, 13 "R": null, 14 "t": null, 15 "t_i": null, 16 "t_f": null, 17 "efficiency": 1.0 18 } 19}

Variables

VariableMeaningUnit
PPowerWatts (W)
P_iInitial powerWatts (W)
P_fFinal powerWatts (W)
VVoltageVolts (V)
V_iInitial voltageVolts (V)
V_fFinal voltageVolts (V)
ICurrentAmperes (A)
I_iInitial currentAmperes (A)
I_fFinal currentAmperes (A)
RResistanceOhms (Ω)
tTime durationSeconds (s)
t_iInitial timeSeconds (s)
t_fFinal timeSeconds (s)
efficiencyEfficiency factorDecimal (1.0 = 100%)

Behavior Notes

  • Computes missing PP, VV, II, RR, or energy E=PΔtE = P \cdot \Delta t.

  • Supports initial and final values for voltage, current, and power; automatically computes deltas.

  • If RR is provided, voltage and current can be derived via Ohm's Law.

  • Optional efficiency factor modifies power: Pout=ηPinP_out=\eta \cdot P_in.

  • If all values are provided, the API verifies consistency.

  • Division by zero (e.g. I=0I=0 or V=0V=0 when solving) raises an error.

Example Requests

Calculate power

1{ 2 "law": "watts", 3 "vars": { 4 "V": 12, 5 "I": 2 6 } 7}

Solve for current

1{ 2 "law": "watts", 3 "vars": { 4 "P": 60, 5 "V": 120 6 } 7}

Power at two voltages (same resistance)

1{ 2 "law": "watts", 3 "vars": { 4 "V_i": 100, 5 "V_f": 200, 6 "R": 50 7 } 8}

Power with efficiency

1{ 2 "law": "watts", 3 "vars": { 4 "V": 240, 5 "I": 10, 6 "efficiency": 0.85 7 } 8}

Example Response

1{ 2 "solved": "P", 3 "value": 2040, 4 "summary": "P = V·I ·η = 2040 W | E = 7344000 J", 5 "inputs": { 6 "P": 2040, 7 "V": 240, 8 "I": 10, 9 "R": 24, 10 "P_i": null, 11 "P_f": null, 12 "V_i": null, 13 "V_f": null, 14 "I_i": null, 15 "I_f": null, 16 "delta_t": 3600, 17 "t_i": 0, 18 "t_f": 3600, 19 "efficiency": 0.85 20 }, 21 "derived": { 22 "energy_J": 7344000, 23 "energy_kWh": 2.04, 24 "R_derived": 24, 25 "P_input": 2400, 26 "P_loss": 360 27 } 28}

Use Cases

  • Electrical power calculations

  • Circuit analysis and design

  • Energy consumption over time

  • Efficiency evaluation in power systems

  • Engineering, physics, and electronics education

About the Author

This article was written by Boden Bensema, an electronics hobbyist focused on teaching beginner-friendly circuit design, breadboarding, and electronics fundamentals.

About page