Energy stored in capacitors and examples