On-board Supercapacitors Cooperative Charging Algorithm: Stability Analysis and Weight Optimization