1. A method for testing a powertrain of vehicles that are at least in part electrically driven, comprising: controlling a voltage supplied to the powertrain by a controller coupled with a simulation system for an energy storage system in a manner that the voltage acts dynamically as for a real energy storage system, wherein the controller is designed with a model based controller design method as model predictive control; using a load model of the powertrain in a discrete time model of a controlled system, wherein the model of the controlled system has a parameter set with a parameter (g P ) that is variable over an operating range of the controlled system; determining at each time instant (k) an optimal sequence of control moves (Δu k ); calculating a number (i) of parameter sets with a different parameter (g P,i ) over the operating range and choosing a parameter set with parameter (g P,i ) which is closest to the actual parameter (g P ); and determining the sequence of control moves (Δu k ) with the chosen parameter set.