I was originally going to convert a Writer article to HTML and then (somewhat) tidy it all up as per, but I noticed the MathML on the capacitor discharge page was not well formatted on Chrome-based browsers. So, I'll fix that first before delving into re-writing all the maths of this optics nonsense.
The completed article PDF is linked here. The Python code mentioned in the article is linked here.