capacitor charge
capacitor_chargeCalculates RC capacitor charge timing, energy storage, and transient voltages. Given resistance, capacitance, supply voltage, and optional initial voltage, computes the RC time constant (τ = R×C), time to reach standard charge thresholds (63%, 86%, 95%, 99%), voltage at key time points, energy stored (E = ½CV²), and peak charging current. Optionally calculates time to reach a specific target voltage using t = -τ × ln((Vsupply - Vtarget) / (Vsupply - Vinitial)). Essential for timing circuits, power-on reset delays, debounce networks, and soft-start designs. Chain from rc_filter for frequency-domain analysis or timer_555 for oscillator timing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| v_supply | Yes | Supply voltage in volts. The voltage the capacitor charges toward. | |
| v_target | No | Target voltage to reach in volts (optional). When provided, calculates time to reach this voltage. Must be between v_initial and v_supply. | |
| v_initial | No | Initial capacitor voltage in volts (default 0 for fully discharged). | |
| capacitance_f | Yes | Capacitance in farads (C). Use scientific notation, e.g. 1e-6 for 1 µF. | |
| resistance_ohm | Yes | Series resistance in ohms (R). Controls charge/discharge rate. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tau_s | Yes | RC time constant (τ = R×C) in seconds. | |
| tau_ms | Yes | RC time constant in milliseconds. | |
| energy_mj | Yes | Energy stored at full charge in millijoules. | |
| v_at_1tau | Yes | Capacitor voltage after 1τ in volts. | |
| v_at_2tau | Yes | Capacitor voltage after 2τ in volts. | |
| v_at_5tau | Yes | Capacitor voltage after 5τ in volts. | |
| energy_joules | Yes | Energy stored at full charge: E = ½CV² in joules. | |
| peak_current_ma | Yes | Peak charging current at t=0 in milliamps: Ipeak = (Vsupply − Vinitial) / R. | |
| time_to_63pct_ms | Yes | Time to reach 63.2% of (Vsupply − Vinitial) in milliseconds (1τ). | |
| time_to_86pct_ms | Yes | Time to reach 86.5% of (Vsupply − Vinitial) in milliseconds (2τ). | |
| time_to_95pct_ms | Yes | Time to reach 95.0% of (Vsupply − Vinitial) in milliseconds (3τ). | |
| time_to_99pct_ms | Yes | Time to reach 99.3% of (Vsupply − Vinitial) in milliseconds (5τ). | |
| time_to_target_ms | Yes | Time to reach v_target in milliseconds (null if v_target not specified). |