The future transmission grid for electrical power will face challenges on an unprecedented scale as the transformation of the energy system progresses. The massive integration of renewable energy sources will require new methods and additional equipment to maintain the system secure and cost-efficient. This doctoral thesis presents an approach to securely operate a transmission grid based on optimal power flow. Optimal control of phase shifting transformers, overlaying HVDC grids and large-scale energy storage lead to reduced operating costs. Furthermore, this work discusses efficient approaches to optimally coordinate multiple inter-connected control areas, if one central controller is undesirable for political or technical reasons.