Solar and battery bank design theory