Proton exchange membrane fuel cell is considered as one of the most efficient sources of renewable energy. Time-varying dynamic and nonlinear equations are two major factors that make control and power optimization of fuel-cell vehicles challenging. In this paper, by using a comprehensive PEMFC vehicle model and nonlinear model predictive controller, a novel energy management method is represented. By considering both of the regenerating brake power and fuel-cell output power as the controller inputs, the steady-state equations have been derived in a nonlinear form. Also, the NMPC contains a constrained quadratic cost function which has been minimized to make the controller inputs completely optimized. Moreover, the two controller references using in this article have been achieved based on experimental FTP drive-cycle data. Finally, the optimized cost-function weighting matrices will be calculated by genetic algorithm, and then, the real-time controller inputs are applied to the vehicle model to get better results on vehicle range during an online procedure, and the online results are compared with the experimental drive-cycle data.