Electric Circuits·power-calculation-passive-sign-convention
Power Calculation Passive Sign Convention
Given voltage and current values at a terminal, compute the instantaneous power using the passive sign convention (p = v·i), accounting for the polarity of current relative to voltage marking to determine whether power is being absorbed or generated.
✓ All 2 test cases pass.
Inputs
Test cases
These cases run live in your browser every time the page loads. If any fail, the calculator is broken — file an issue.
| # | Inputs | Expected | Got | Status |
|---|---|---|---|---|
| 1 | {"voltage":800000,"current":1800,"current_sign":-1} | -1440000000 | -1440000000 | ✓ |
| 2 | {"voltage":100,"current":5,"current_sign":1} | 500 | 500 | ✓ |
APIDeveloper APICall this calculator from codeexpand ↓
Endpoint
POST
/api/calculators/electric-circuits/power-calculation-passive-sign-convention/computeInputs (3)
voltagenumberdefault800000currentnumberdefault1800current_signintegerdefault-1
Example
curl -sX POST http://localhost:3001/api/calculators/electric-circuits/power-calculation-passive-sign-convention/compute \
-H "Content-Type: application/json" \
-d '{"inputs":{"voltage":800000,"current":1800,"current_sign":-1}}'Try it live
Edit the body below, then click Call API.Request body
Response
(click Call API to see the response)Source: Pattern from: James W. Nilsson, Susan A. Riedel - Electric Circuits 11e - Instructor’s Solution Manual-Pearson (2019).pdf. Reproduces a standard power-calculation-passive-sign-convention computation; problem text paraphrased.
AI disclosure: Calculator code generated by anthropic/claude-haiku-4-5-20251001; verified by 2 test cases.