Energy efficient charging or discharging systems for batteries, ultracapacitors, supercapacitors or double-layer capacitors specially adapted for vehicles