Capacitor as power source to calculate Joule heat