Abstract: This article considers the problem of controlling inverter-interfaced distributed energy resources (DERs) in a distribution grid to solve an ac optimal power flow (OPF) problem in real time.