Optimization takes into account the possibility of partial charging.