This semester I'm teaching the recitation session for the second-year physics course on electricity and magnetism, which is basically an hour a week dedicated to helping students go over the concepts they encountered that week and help work through problems (sort of like a group tutoring session). I also taught it last semester, and we've caught up to an unresolved question I had from the same point in the curriculum.
We've been covering RC circuits, which are simple DC circuits with a resistor (the R) and a capacitor (the C) in line with a driving voltage (a battery, for simplicity). They're wired in such a way that you can move a switch to charge them, and then switch it to discharge; while charging, the charge on the capacitor fills up until its potential difference reaches that of the battery (at which point no more current can flow), and while discharging that charge flows away, dissipating as heat through the resistor. Both follow an exponential curve, which can be adjusted by changing the resistance and capacitance of the system (their product RC has units of seconds, and is known as the time constant of the system, how long it takes for the charge to rise or fall ~63% of the remaining way towards being full or empty).
Anyway, while the textbook we're using had some plots of the charge and current in RC circuits charging and discharging, it also mentioned what the power in the circuit was mathematically (the product of two competing exponential terms) but didn't provide a diagram. I've wanted to plot it myself to see what it looks like since last spring. I could do it using Python and matplotlib, I just never got around to it.
Enter Typst! I've been writing up the problems we cover in the recitation session in Typst so that students have a record they can go back to, and as mentioned in an earlier post it can include diagrams and plots. I started coding up the equations for charge, current, and voltage as a function of time to make some plots to serve as a reminder, and realized I could also encode the equation for the power dissipated in the circuit while charging, which comes out to be
\[P(t) = \left(\frac{V^2}{R}\right)(e^{-t/RC})(1 - e^{-t/RC}).\]
Here's what I included; the third plot shows how the above equation looks.
Anyway, I just wanted to share my discovery. Typst continues to impress me with its ease of use and accessibility. I gave a short introductory talk about it to some of my classes this week, since they're doing a lot of writing of lab reports and it could be useful. Being introduced to \(\LaTeX\) in college was an important milestone in my life and I think learning Typst has the potential to be as revolutionary for them if they're continuing on in STEM fields (or even if they aren't, since Typst can be used for any kind of writing). One of my colleagues even asked me this week if I could do a short presentation on it for his class so they could use it for their (math-heavy) homework. I think it's safe to say I've found my latest obsession at this point, so we'll see where it goes from here. A hui hou!















