Within the last years, mechatronics as a discipline has shaped the development of complex technical systems. Mechatronics consists of the close interaction of mechanics, electronics, control engineering and software engineering in order to achieve a better system behaviour. Due to the advances in deployment of information and communication technologies, the functionality of mechatronic systems will go far beyond the known standards with the intention to increase their robustness, flexibility and reliability. The paradigm that expresses this development is called self-optimization. Self-optimizing systems react autonomously to changing environmental conditions and optimize their behaviour during operation. The design of such systems is an interdisciplinary task. Engineers in the different fields of mechatronics have to work closely with experts from mathematical optimization and artificial intelligence. Furthermore, self-optimizing systems adopt information processing fu nctions, which are known as cognitive functions. Even though more theories of the modelling of cognitive behaviour in technical systems are being developed and published, an applicable support of the system engineers is missing. Already the identification of self-optimization and appropriate cognitive functions area challenge. This contribution presents an approach to design cognitive functions in self-optimizing systems and its example application to a hybrid energy storage system as a subsystem of an innovative railway vehicle