Nonlinear Convex Optimization of the Energy Management for Hybrid Electric Vehicles