What you will learn
- Software: relatively basic constructs. Iterative solver!
- Domain: A better feel for a capacitor charging and discharging and the time constant.
Take as input values of R (in Ohms), C (in Farads), and supply voltage (in Volts). Assume that the voltage is applied to a series RC circuits at time t=0t=0, and calculate the voltage across the capacitor at different times. Plot these!
- Determine how much time it will take to charge the capacitor to a target voltage.
- Vary R to see how the curve shifts. Determine the value of C so that the shift is exactly the same. Which has a larger effect?
- Repeat for discharging the capacitor, rather than charging it
Apply a square wave as input and simulate for a few cycles. Vary the period and duty cycle and see if the behavior matches your intuition