Watt's Law | Engineering Calculator API
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
Combined with Ohm's Law:
Energy over time:
Optional efficiency factor:
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
| Variable | Meaning | Unit |
|---|---|---|
P | Power | Watts (W) |
P_i | Initial power | Watts (W) |
P_f | Final power | Watts (W) |
V | Voltage | Volts (V) |
V_i | Initial voltage | Volts (V) |
V_f | Final voltage | Volts (V) |
I | Current | Amperes (A) |
I_i | Initial current | Amperes (A) |
I_f | Final current | Amperes (A) |
R | Resistance | Ohms (Ω) |
t | Time duration | Seconds (s) |
t_i | Initial time | Seconds (s) |
t_f | Final time | Seconds (s) |
efficiency | Efficiency factor | Decimal (1.0 = 100%) |
Behavior Notes
-
Computes missing , , , , or energy .
-
Supports initial and final values for voltage, current, and power; automatically computes deltas.
-
If is provided, voltage and current can be derived via Ohm's Law.
-
Optional efficiency factor modifies power: .
-
If all values are provided, the API verifies consistency.
-
Division by zero (e.g. or 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