The talk will discuss about the application of optimal control and model predictive control (MPC) algorithms in key problems from the power systems, smart cities, and assembly line domains. Perhaps not surprisingly, although arising from different application domains, the tackled problems have very similar mathematical descriptions, since the involved systems can be modelled as systems integrating dynamics, logics, and constraints, leading to models which can be easily integrated into discrete-time MPC formulations (often based on mixed-integer programming) or continuous time optimal control problems. The talk will present basic problem formulations and results for smart charging, tasks scheduling and traffic control problems, and will further outline the ongoing research efforts to make the control problems better scale to large scenarios. Challenges concerning arising cyber-physical security issues in the smart grid will be also briefly discussed.