Method for charging a battery, in which a minimum of a charging time available for charging and a required minimum of the state of charge to be reached, to which state of charge the battery is to be charged, are known prior to the start of the charging process, characterized in that the method comprises the following steps: - identifying an optimum setpoint value trajectory for the charging current (I Bat) and/or the charging voltage (U Bat) or the charging power (P Bat) over the course of the charging time, said setpoint value trajectory minimizing the power losses in the battery (P Losses_Battery) during charging, wherein a model of the power losses is used for the identification of the optimum setpoint value trajectory, said model describing the power losses (P Losses_Battery) in the battery during charging over the course of the charging process, wherein the model depends at least on the respective state of charge of the battery and furthermore is dependent on the charging current (I Bat) and/or the charging voltage (U Bat) or the charging power (P Bat), wherein the optimum setpoint value trajectory for the charging current (I Bat) and/or the charging voltage (U Bat) or the charging power (P Bat) is identified in such a way that, for the given model of the power losses, a minimum energy loss appears within the minimum available charging time during charging at the required minimum of the state of charge to be reached, wherein the minimization of the power losses (P Losses_Battery) at each point in time of the charging process over the overall charging time leads to a minimum energy loss within the available charging time, and - leading a setpoint value for the charging current (I Bat) and/or the charging voltage (U Bat) or the charging power (P Bat) along the identified setpoint value trajectory in order to charge the battery. - identifying an optimum setpoint value trajectory for the charging current (I Bat) and/or the charging voltage (U Bat) or the charging power (P Bat) over the course of the charging time, said setpoint value trajectory minimizing the power losses in the battery (P Losses_Battery) during charging, wherein a model of the power losses is used for the identification of the optimum setpoint value trajectory, said model describing the power losses (P Losses_Battery) in the battery during charging over the course of the charging process, wherein the model depends at least on the respective state of charge of the battery and furthermore is dependent on the charging current (I Bat) and/or the charging voltage (U Bat) or the charging power (P Bat), wherein the optimum setpoint value trajectory for the charging current (I Bat) and/or the charging voltage (U Bat) or the charging power (P Bat) is identified in such a way that, for the given model of the power losses, a minimum energy loss appears within the minimum available charging time during charging at the required minimum of the state of charge to be reached, wherein the minimization of the power losses (P Losses_Battery) at each point in time of the charging process over the overall charging time leads to a minimum energy loss within the available charging time, and - leading a setpoint value for the charging current (I Bat) and/or the charging voltage (U Bat) or the charging power (P Bat) along the identified setpoint value trajectory in order to charge the battery.