Controlling energy storage system

By evaluating and adjusting the control actions of the energy storage system and optimizing the temperature and power requirements of the system, the problem of difficult to predict temperature and control systems in the prior art is solved, and higher performance and safety are achieved.

CN119558556APending Publication Date: 2025-03-04RAYMARK ENERGY CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411209422.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-09-01
Filing Date
2024-08-30
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

The prior art is difficult to accurately predict the temperature of an energy storage system in a high-frequency switching scenario, and while controlling the energy storage system, it is necessary to consider temperature and power requirements, which makes it difficult to ensure system performance and safety.

Method used

By obtaining the status information of the energy storage system, determining the control actions, and using this information and control actions to evaluate the cost function, adjusting the control actions until the cost function reaches a minimum value, to optimize system performance and security.

Benefits of technology

It realizes the optimization of the temperature and power requirements of the energy storage system while ensuring system performance and safety, and improves the overall performance and safety of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119558556A_ABST
    Figure CN119558556A_ABST
Patent Text Reader

Abstract

A method for controlling an energy storage system, the method comprising the steps of: a) obtaining information relating to a state of the energy storage system; b) determining a control action for controlling the energy storage system; c) evaluating a cost function using the control action and the information; d) determining whether the evaluated cost function has reached a minimum value; e) applying a control action to the energy storage system if the evaluated cost function has reached a minimum value; if the evaluated cost function has not reached a minimum value, the control action is adjusted based on the evaluated cost function, and step c) is repeated using the adjusted control action.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to controlling energy storage systems and, in particular, to determining and applying control actions to control energy storage systems. Background Art

[0002] In view of technological changes, the control of energy storage systems (such as batteries, especially AC batteries) that are part of the energy grid is a very important emerging field. Many of these energy storage systems can and need to be controlled by scheduling algorithms so that the stored power can be provided according to demand (i.e., power output).

[0003] Important aspects for such a dispatch algorithm are the performance and safety of the energy storage system being controlled. Both aspects are closely related to the temperature of the energy storage system. Although it is difficult to control the thermal gradient of a direct current (DC) battery, any energy storage system with a switching mechanism allows the temperature of the energy storage system to be controlled, such as by introducing a module, bypassing individual modules of the energy storage system, or reducing the output of individual modules of the energy storage system.

[0004] During operation of an energy storage system, modules may have different temperatures and thermal gradients due to energy source variations, poor balance, etc. This can severely impact the performance and safety of the entire system. The power and capacity of the individual energy sources provided in the energy storage system can drop rapidly when these modules are operated or stored at excessively high temperatures (e.g., temperatures of 50 degrees Celsius or more), which can lead to various failure modes, including thermal runaway. On the other hand, low temperatures, especially during charging, can also be detrimental because they lead to lithium plating and dendrite growth.

[0005] One challenge in addressing these aspects is that it is difficult to accurately predict the temperature in high-frequency switching scenarios. This is even more true when cooling effects are also taken into account. In addition, controlling the energy storage system also requires considering both temperature and power demand.

[0006] Therefore, there is a need for a method of controlling an energy storage system which takes the above aspects into account, enabling an improved performance of a safer energy storage system. Summary of the invention

[0007] The above-mentioned problems and others are solved by the subject matter of the independent claims. Preferred embodiments are given by the subject matter of the dependent claims.

[0008] According to one embodiment of the present invention, a method for controlling an energy storage system is provided, the method comprising the following steps: a) acquiring information related to a state of the energy storage system; b) determining a control action for controlling the energy storage system; c) evaluating a cost function using the control action and the information; d) determining whether the evaluated cost function has reached a minimum value; and, e) applying a control action to the energy storage system if the evaluated cost function has reached a minimum value; and, e) adjusting the control action based on the evaluated cost function if the evaluated cost function has not yet reached a minimum value, and repeating step c) using the adjusted control action.

[0009] According to another embodiment of the present invention, a device for controlling an energy storage system is provided, which is configured to: a) obtain information related to the state of the energy storage system; b) determine a control action for controlling the energy storage system; c) evaluate a cost function using the control action and the information; d) determine whether the evaluated cost function has reached a minimum value; and e) if the evaluated cost function has reached a minimum value, apply a control action to the energy storage system; if the evaluated cost function has not yet reached a minimum value, adjust the control action based on the evaluated cost function, and repeat step c) using the adjusted control action.

[0010] According to another embodiment of the present invention, there is provided an energy storage system configured to: a) obtain information related to a state of the energy storage system; b) determine a control action for controlling the energy storage system; c) evaluate a cost function using the control action and the information; d) determine whether the evaluated cost function has reached a minimum value; and e) in the event that the evaluated cost function has reached a minimum value, apply a control action to the energy storage system; in the event that the evaluated cost function has not yet reached a minimum value, adjust the control action based on the evaluated cost function, and repeat step c) using the adjusted control action. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to better understand the inventive concept of the present invention, but it should not be regarded as limiting the present invention, embodiments of the present invention will now be described with reference to the accompanying drawings, in which:

[0012] Figure 1 A flow chart of a method according to an embodiment of the present invention is shown;

[0013] Figure 2 The device of the embodiment of the present invention is shown;

[0014] Figure 3 A schematic diagram of an energy source model is shown;

[0015] Figure 4 A schematic diagram of an energy source model is shown;

[0016] Figure 5 A schematic diagram of a thermal module model including a cooling system and a busbar is shown; and

[0017] Figure 6 A schematic block diagram of a multi-level converter is shown. DETAILED DESCRIPTION

[0018] Figure 1 A flow chart of a method according to an embodiment of the present invention is shown. A method for controlling an energy storage system, the method comprising the following steps: a) obtaining information related to a state of the energy storage system (step S1); b) determining a control action for controlling the energy storage system (step S2); c) evaluating a cost function using the control action and the information (step S3); d) determining whether the evaluated cost function has reached a minimum value (step S4); and e) if the evaluated cost function has reached a minimum value, applying a control action to the energy storage system (step S5a); if the evaluated cost function has not yet reached a minimum value, adjusting the control action based on the evaluated cost function, and repeating step c) (step S5b) using the adjusted control action.

[0019] In other words, the present invention can be understood as being used to control and / or dispatch an energy storage system based on an assessment of whether a control action provides an optimal solution (ie, the cost function has reached a minimum), and iteratively adjusting the control action until such an optimal solution is found.

[0020] In an embodiment according to the present disclosure, control actions may be determined along a control horizon. The control horizon may be a sliding window and may have a duration of 15 minutes. The value of 15 minutes is merely an example and should not be limiting; in fact, other values ​​may also be chosen. The sliding window can be understood as removing the first value and adding a (new) last value in each iteration.

[0021] In an embodiment according to the present disclosure, the evaluation of the cost function may include evaluating the power demand predicted along the control horizon. Here, the power demand may correspond to the electrical power, ie, the current provided by the energy storage system.

[0022] In an embodiment according to the present disclosure, the control action determined in step b) may be based on the information obtained in step a).

[0023] In fact, the above discussion can be understood as: step a) obtaining system-related information, which also includes information about individual components of the energy storage system discussed elsewhere in this document.

[0024] Then, step b) determines the (initial) control action.

[0025] Then, steps c) to e) are to iteratively search for the optimal solution by evaluating the cost function in step c), determining whether a minimum value is reached in step d), and then applying a control action or adjusting the control action in step e) and starting another iteration.

[0026] Thus, by repeating steps c) and d) the acquired information and the final control action can be linked, since here the control action is adjusted and the adjustment is influenced by the acquired information via the evaluation of the cost function.

[0027] Thus, steps c) to e) may be understood as a (numerical) optimization. In this case, for example, it can be determined whether a minimum value has been reached by comparing whether the current iteration contains any improvement compared to the previous iteration. Furthermore, adjusting the control action may be implemented by comparing different control actions of different iterations and the associated values ​​of the evaluated cost function to determine how to adjust the current control action.

[0028] In an embodiment according to the present disclosure, the control action may have at least one of a control action lower limit and a control action upper limit.

[0029] These control action limits, particularly the upper control action limit, may be used as a safety measure so that the resulting control actions do not result in a power discharge that could potentially cause damage to the energy storage system or its components.

[0030] In the embodiments according to the present disclosure, the minimum value may be a local minimum value, a global minimum value, or an approximate minimum value. In other words, the term is not particularly limited to a specific type of "minimum value", and therefore, the method involved in obtaining the minimum value is not particularly limited.

[0031] In an embodiment according to the present disclosure, in step e), if the stop criterion is met, a control action may also be applied to the energy storage system. This may be understood as terminating the repetition of step c), thus ensuring that the method terminates with the application of a clear control action to the energy storage system.

[0032] In an embodiment according to the present disclosure, the stopping criterion may be at least one of the following: reaching the maximum number of iterations of step c), falling below a minimum difference between the evaluated cost functions of two subsequent iterations of step c), the total computation time of the executed method, falling below a minimum difference between two subsequent iterations of the control action.

[0033] In summary, the method according to the present disclosure can be understood as being related to the use of concepts such as model predictive control (MPC). MPC is a control algorithm that uses a model of a dynamic system to predict its future behavior and then optimizes control actions to achieve a desired goal, i.e., minimizes a cost function representing the desired goal.

[0034] In the present disclosure, a control action is related to an action of controlling the power provided by the energy storage system. The control action may include or be a turn-on rule and / or turn-on time of the energy storage system.

[0035] Figure 2 1 shows an apparatus of an embodiment of the present invention. For example, the apparatus may be a microcontroller, such as a microcontroller as part of a battery management system. The apparatus 100 may include a processor 101, a memory 102, and a communication interface 103. The memory 102 may store code or may access code that instructs the processor 101 to perform the steps of any method of the embodiment of the present invention as described above. The communication interface 103 may be adapted to receive communication data via a network. The network may be a wired network or a wireless network.

[0036] The device 100 may generally be a computer, an electronic control unit (ECU), or the like.

[0037] The processor 101 may be embodied by one or more processing units, such as a central processing unit (CPU), or may also be provided by a microcontroller unit (MCU).

[0038] The memory 102 can be embodied by a local memory, which may include but is not limited to a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), and an electrically erasable programmable read-only memory (EEPROM).

[0039] The communication interface 103 may be adapted to provide and / or receive data from the processor 101 through a communication network, and to provide and / or receive data from the memory 102. The communication network may be a wired network or a wireless network.

[0040] Device 100 can be used to control an energy storage system and can be configured to: a) obtain information related to the state of the energy storage system; b) determine a control action for controlling the energy storage system; c) evaluate a cost function using the control action and the information; d) determine whether the evaluated cost function has reached a minimum; and e) if the evaluated cost function has reached a minimum, apply a control action to the energy storage system; if the evaluated cost function has not yet reached a minimum, adjust the control action based on the evaluated cost function, and repeat step c) using the adjusted control action.

[0041] Alternatively, Figure 2 The schematically shown device 100 can be an energy storage device configured to: a) obtain information related to the state of an energy storage system; b) determine a control action for controlling the energy storage system; c) evaluate a cost function using the control action and the information; d) determine whether the evaluated cost function has reached a minimum; and e) if the evaluated cost function has reached a minimum, apply a control action to the energy storage system; if the evaluated cost function has not yet reached a minimum, adjust the control action based on the evaluated cost function, and repeat step c) using the adjusted control action.

[0042] In an embodiment according to the present disclosure, an energy storage system may include at least one module, wherein a control action may be determined for each of the at least one module, and wherein the control action may be related to an on-time of the at least one module. Thus, applying the control action to the module reflects the entire energy storage system.

[0043] Furthermore, the control action may be related to bypassing at least one module and / or reducing the energy output of at least one module. Bypassing a module is here understood as not using the module or at least not using it completely. This may last for a period of time. Since the control action can be understood as a function of time, bypassing a module for a period of time can be understood as not using the module during the period of time, or as at least not using the module completely during the period of time.

[0044] More specifically, if a module comprises at least one energy source, bypassing the module may comprise bypassing respective energy sources of the module.

[0045] Alternatively, or in addition to bypassing, control of the energy storage system, modules and / or energy sources may include reducing the energy output of individual components or larger portions of the energy storage system, i.e., reducing the energy output of individual modules or individual energy sources. This may be particularly advantageous for preventing overheating of individual energy sources or modules.

[0046] In a preferred embodiment according to the present disclosure, the on-time and / or the on-rule are module-related. In this sense, the "on-time of the energy storage system" may be understood as the "on-time of the modules included in the energy storage system".

[0047] In an embodiment according to the present disclosure, each module may include at least one energy source. Therefore, when the above terms "on-time", "on-rule", and "control action" refer to the entire energy storage system, they may also refer to the energy source of the energy storage system, that is, "on-time of the energy storage system" may be understood as "on-time of the energy source included in the energy storage system".

[0048] In an embodiment according to the present disclosure, the cost function may be a function of the temperature of the energy storage system.

[0049] In embodiments according to the present disclosure, the temperature may be a predicted temperature.

[0050] In an embodiment according to the present disclosure, a spatially discretized heat transfer equation may be used to calculate the temperature of an energy storage system, resulting in a plurality of spatially discretized temperature values.

[0051] In an embodiment according to the present disclosure, the cost function may be the variance of a plurality of spatially discrete temperature values. The choice of this cost function helps to avoid overheating and underheating because it "drives" the temperature distribution toward a uniform temperature distribution, thereby avoiding "temperature surges".

[0052] In an embodiment according to the present disclosure, the temperature of the energy storage system may have at least one of a lower temperature limit and an upper temperature limit, which helps to avoid overheating and low temperature, thereby further contributing to the safety and overall performance of the energy storage system.

[0053] In an embodiment according to the present disclosure, an energy storage system may include at least one energy source and at least one power converter module.

[0054] In an embodiment of the present disclosure, the energy storage system may be a multi-level converter comprising a plurality of energy sources and a plurality of power converter modules, each power converter module comprising at least two switching elements. In such an embodiment, the control action may be associated with bypassing at least one energy source and / or reducing the energy output of at least one energy source.

[0055] In an embodiment according to the present disclosure, the information may include at least one of a terminal voltage of the energy storage system, a current of the energy storage system, an ambient temperature of the energy storage system, and a state of charge of the energy storage system. Here, the state of charge is an estimated quantity, and the remaining quantities may be measured quantities, but may also be based on estimation / calculation.

[0056] Furthermore, these quantities may be available at the level of the energy storage system, at the level of a module comprised in the energy storage or at the level of an energy source comprised in a module.

[0057] For example, as a further clarification, "the state of charge of the energy storage system" may be understood as the state of charge of the entire energy storage system (i.e., all of its modules and all energy sources of all modules), but may include the state of charge of a single module of the energy storage system and the state of charge of a single energy source of a single module of the energy storage system.

[0058] In an embodiment according to the present disclosure, the energy storage system can be configured to provide at least one of an arbitrary waveform current, alternating current, pulsating direct current, and direct current. In other words, the current provided by the energy storage system is not particularly limited, but can provide current according to specific needs.

[0059] In case the energy storage system further comprises at least one power converter module, it may be understood that the combination of the module and the at least one power converter module provides the electric current.

[0060] Furthermore, the supplied current may be synthesized by a combination of a direct current and an alternating current (AC) current.

[0061] In an embodiment according to the present disclosure, the energy storage system may be disposed in a vehicle or may be a stationary energy source storage system, for example, connected to an energy source grid.

[0062] In the following, reference is also made to Figure 3 , Figure 4 and Figure 5 Embodiments according to the present invention are described below. Figure 3 shows a schematic diagram of the energy source model, and Figure 4 shows a schematic diagram of the energy source model, Figure 5 A schematic diagram of the thermal module model including the cooling system and busbars is shown.

[0063] In this embodiment, the energy storage system includes multiple modules, each module containing multiple energy sources. In the context of the present disclosure, the energy source can be associated with any type of energy source, and includes, for example, a battery, a capacitive energy source, a photovoltaic (PV) cell, a fuel cell, or an electromechanical power converter. Although the present embodiment will be discussed in close conjunction with a battery as an energy source, it should be understood that the present disclosure is not limited thereto, and the concepts discussed herein are applicable to any energy source.

[0064] Figure 3 A module thermal model is shown, i.e., a thermal model for modeling each module of an energy storage system. The model is based on a lumped thermal model (LTM) and an equivalent circuit model (ECM), which are coupled together for each energy source of the module. The ECM can be understood as replacing the circuit with a theoretical model to simplify the modeling. The LTM can be understood as a spatial discretization of the underlying model to numerically determine the dynamics. This can be combined with a finite difference method (FDM), which is a time discretization of the underlying model.

[0065] Figure 4 The model of the energy source level, i.e., how the LTM and ECM relate to each other, is shown. Specifically, the ECM receives the current I (i.e., the power demand), the ambient temperature T amb and the initial state of charge initSOC of the energy source as input. Based on these quantities, the voltage V and the generated heat Q are determined gen , where Q gen Determined as: Q gen =(U-OCV)×I Where U is the energy source terminal voltage, that is, the voltage across the energy source, ranging from positive to negative, and OCV is the open circuit voltage. Therefore, the state of charge SOC can be updated. Ambient temperature T amb It can be the measured temperature around the energy source, but it can also be the temperature of the surface of the energy source of the energy storage system or other equipment (such as a bus) connected to the energy source of the energy storage system. In addition, the ambient temperature can also be determined (e.g., measured or estimated) based on these temperature measurements.

[0066] Based on this heat generation, LTM is able to provide an estimate of the surface temperature T surf To this end, the LTM obtains the ambient temperature T amb , the heat generated Q gen and the surface temperature T surf As input, we use an initial estimate of . For example, we use the following equation to implement: Among them C s and R u are parameters of the equation, which can be obtained empirically, for example.

[0067] Temperature-based energy source level model, Figure 5 The Module Thermal Model (MTM) shown provides an estimate of the temperature distribution across the module. This also takes into account the cooling system employed in the system.

[0068] In one embodiment, the spatially discretized heat transfer equation takes into account the cooling effects occurring in the energy storage system. In other words, the heat transfer equation is not limited to including heat generation phenomena, but can also include cooling phenomena, such as the fact that there is a coolant in the energy storage system.

[0069] from Figure 5It can be seen that the module has a coolant inlet and a coolant outlet, as well as a busbar for the energy source set in the module. Since the coolant heats up once it enters the module, the temperature distribution between the modules is not uniform. This temperature distribution can be modeled by a two-dimensional heat equation: Where q represents the internal energy generation rate and k represents the thermal conductivity. Here, the internal energy generation rate can be an efficiency and can be a ratio that takes into account both heating and cooling aspects. In addition, since these heating and cooling aspects are not necessarily uniform in the energy storage system, the internal energy generation rate can depend on the location, that is, q = q (x, y).

[0070] like Figure 5 As shown in the points in , the partial derivatives of the partial differential equation can be approximated when the spatial coordinates x and y are discretized. In other words, the temperature T(x, y) as a function of the variables x and y is taken as the temperature T of the discrete variables m and n m,n According to this approximation, the partial derivative can be written as:

[0071] In summary, the heat generated by the energy sources of the module and the temperature distribution within the module can be estimated, in particular not only at a certain moment, but also for further time steps. Thus, for a given control action, the temperature of the module can be estimated, and therefore the control action can be evaluated using a cost function and adjusted if necessary.

[0072] Specifically, the cost function may be a function of temperature, since, as mentioned above, an important parameter of the energy storage system is temperature. More specifically, the cost function may be the variance of temperature. Thus, the underlying optimization problem may be formulated as: Where "I" is in the interval [N1, N2], N1 and N2 define the start and end of the range considered. In addition, "u(i)" is the control action, and "Var" indicates the variance. Here, the variance can be the variance of each module. Therefore, the cost function is the sum of all discrete points (m, n) of each module and the interval [N1, N2] over all modules. Obviously, the temperature distribution T of each module m,n may be different; however, to improve readability, the specific index indicating this point is omitted in the above formula.

[0073] In addition, the optimization may be subject to further constraints, specifically, at least one of the following constraints: u min ≤u(i)≤u max as well as Tmin ≤T m,n (i)≤T max

[0074] In other words, at least one of the control action u and the temperature profile may be constrained by a lower limit and / or an upper limit.

[0075] The above embodiments can also be understood as applying model predictive control to the energy storage system, so that the variance of the temperature of the modules and energy sources of the energy storage system is minimized while providing current according to power demand.

[0076] In summary, it can be understood that the control of energy storage provided according to the embodiments of the present disclosure not only achieves high efficiency and high performance of energy storage, but also ensures the safety of the energy storage system.

[0077] also, Figure 6 A schematic block diagram of a multilevel converter 1 according to an embodiment of the present invention is shown. The figure is particularly useful for illustrating how the present invention can be applied to the case where the multilevel converter 1 is used as an energy storage system.

[0078] The multi-level converter 1 includes a plurality of energy sources 11 and a plurality of power converter modules 10_1, 10_2, 10_3, ..., 10_i, ..., 10_m (i = 1 ... m). Each power converter module 10_i may include at least two switching elements 12, but is not limited to including at least two switching elements. For example, four switching elements 12 may also be used. Each of the switching elements 12 may be a solid-state switching element, such as a two-terminal solid-state switch or a three-terminal solid-state switch. Without limiting the present invention, examples of two-terminal solid-state switches include PIN (positive-internal-negative) diodes and Schottky diodes. Without limiting the present invention, examples of three-terminal solid-state switches include MOSFETs, JFETs, IGBTs, BJTs, and thyristors.

[0079] It should be understood that although Figure 6 It is shown that each energy source 11 is connected to each power converter module in power converter module 10_1, 10_2, 10_3, ..., 10_m, but this is not restrictive, and other connection configurations are also possible. Energy source 11 can be any kind of energy source, such as a battery, a photovoltaic cell, a fuel cell, an electromechanical power converter or a capacitive energy source. It should be further understood that the present invention is not limited to the specific topology of the multi-level converter 1. For example, power converter modules 10_1, 10_2, 10_3, ..., 10_m can be connected in series, and multiple such series can be provided in the multi-level converter 1. Each series can have an input terminal and an output terminal. Each series can represent a phase or arm of the multi-level converter 1.

[0080] By switching the switch element 12 of the module 10_i, the conduction of the energy source 11 of the module 10_i can be controlled, that is, the module 10_i can be controlled to be in a conducting state or a non-conducting state. Therefore, the control action can control the conduction time and / or the conduction rule by controlling the switch element 12.

[0081] The non-conducting state of at least one power conversion module 10_i does not necessarily mean that for the at least one power converter module 10_i in the non-conducting state, each element of the at least one power converter module 10_i is in the non-conducting state. For example, when at least one power converter module 10_i is in the non-conducting state, at least one of the two switch elements 12 of the power converter module 10_i can be in the conducting state, thereby bypassing the energy source 11 connected to the power converter module 10_i. Therefore, at least one power converter module 10_i in the non-conducting state can be understood as the at least one power converter module 10_i not (actively) contributing to the distribution of energy conversion (workload, load) in the multi-level converter 1. The value of the output signal of at least one power converter module 10_i in the non-conducting state can be 0V. Therefore, when at least one power converter module 10_i is in the non-conducting state, it can not contribute to the generation of the required output voltage of the multi-level converter 1. Therefore, the module 10_i being in the conducting state can be understood as the module contributing to the generation of the required output voltage of the multi-level converter 1 in this state.

[0082] Although detailed embodiments have been described, these embodiments are only intended to provide a better understanding of the invention defined in the independent claims and should not be considered as limiting the present invention.

Claims

1. A method for controlling an energy storage system, the method comprising the following steps: a) obtaining information related to the state of the energy storage system; b) determining a control action for controlling the energy storage system; c) evaluating a cost function using the control action and the information; d) determining whether the evaluated cost function has reached a minimum value; as well as e) applying the control action to the energy storage system if the evaluated cost function has reached the minimum value; In case the evaluated cost function has not reached the minimum value, the control action is adjusted based on the evaluated cost function, and step c) is repeated using the adjusted control action.

2. The method according to claim 1, wherein: The energy storage system comprises at least one module, wherein the control action is determined for each module of the at least one module, and wherein the control action is preferably related to an on-time of the at least one module.

3. The method according to claim 2, wherein: The control action is associated with bypassing at least one module and / or reducing the energy output of at least one module.

4. The method according to any one of claims 1 to 3, wherein: The cost function is a function of a temperature of the energy storage system, wherein preferably the temperature is a predicted temperature.

5. The method according to claim 4, wherein: The temperature of the energy storage system is calculated using a spatially discretized heat transfer equation, generating a plurality of spatially discretized temperature values, wherein preferably the cost function is the variance of the plurality of spatially discretized temperature values.

6. The method according to claim 4 or 5, wherein: The spatially discretized heat transfer equations account for cooling effects occurring in the energy storage system.

7. The method according to any one of claims 1 to 6, wherein: The energy storage system is a multi-level converter comprising a plurality of energy sources and a plurality of power converter modules, each power converter module comprising at least two switching elements.

8. The method according to claim 7, wherein: The control action is associated with bypassing at least one energy source and / or reducing energy output of at least one energy source.

9. The method according to any one of claims 1 to 7, wherein: The information includes at least one of the following: a terminal voltage of the energy storage system, a current of the energy storage system, an ambient temperature of the energy storage system, and a state of charge of the energy storage system.

10. The method according to any one of claims 1 to 9, wherein: The control action is determined along a control range, wherein preferably the evaluation of the cost function comprises evaluating a predicted power demand along the control range.

11. The method according to any one of claims 1 to 10, wherein: Said control action determined in step b) is based on said information obtained in step a).

12. The method according to any one of claims 1 to 11, wherein: In step e), the control action is also applied to the energy storage system in case a stop criterion is met.

13. The method according to claim 12, wherein: The stopping criterion is at least one of: reaching a maximum number of iterations of step c), falling below a minimum difference between the cost functions evaluated of two subsequent iterations of step c), a total computation time of the method performed, falling below a minimum difference between two subsequent iterations of the control action.

14. An apparatus for controlling an energy storage system, the apparatus being configured to: a) obtaining information related to the state of the energy storage system; b) determining a control action for controlling the energy storage system; c) evaluating a cost function using the control action and the information; d) determining whether the evaluated cost function has reached a minimum; and e) applying the control action to the energy storage system if the evaluated cost function has reached the minimum value; In case the evaluated cost function has not reached the minimum value, the control action is adjusted based on the evaluated cost function, and step c) is repeated using the adjusted control action.

15. An energy storage system, configured to: a) obtaining information related to the state of the energy storage system; b) determining a control action for controlling the energy storage system; c) evaluating a cost function using the control action and the information; d) determining whether the evaluated cost function has reached a minimum; and e) applying the control action to the energy storage system if the evaluated cost function has reached the minimum value; In case the evaluated cost function has not reached the minimum value, the control action is adjusted based on the evaluated cost function, and step c) is repeated using the adjusted control action.