Python runs in your browser. Heavy or infinite loops may freeze your browser tab. Use "Stop" if needed; for heavy jobs, run locally.
Program 1
Capacitor Charging / Discharging
ODE for Capacitor Charging and Discharging
The voltage across a capacitor V(t) in an RC circuit can be described by the following ODE:
Charging:
dV(t)/dt = (1/RC) * (Vin - V(t))
Discharging:
dV(t)/dt = -V(t)/(RC)
Here:
- V(t) is the voltage across the capacitor at time t.
- Vin is the input voltage (for charging).
- R is the resistance in ohms.
- C is the capacitance in farads.
Output 1