The Interior Point Methods primal-dual when applied to problems of optimal power flow has great results, but when the system presents overloads in generation and/or transmission, not converge because these overloads imply violation of operating limits, causing some variables cease to be interiors. In order to eliminate these difficulties of these methods is proposed an exchange of barrier function, replacing the classical logarithmic barrier by modified logarithmic barrier. This change allows for controlled violations in some inequality constraints and can be used in solving problems such as optimal power flow with overloads. In practice, such violations can be performed in a short period without damaging the system. Finally, computational tests are made simulating overloads the system suggesting good results.