Generally, unsolvable OPF problem can only be restored by experience and repeated debugging. In this paper, an extended optimal power flow(EOPF) model is presented to solve this problem. It is realized through adding slack variables to equality constraints and inequality constraints, introducing corresponding penalty items to the objective function. The extended model is solved by improved primal-dual interior point method. Test results of examples show that: if the original problem is solvable, optimal solution of original problem can be obtained; if the original problem is unsolvable due to the violations of constraints or control variables, the unsolvable OPF can search for optimum in an expanded region and get an approximate solution. The approximate solution can reflect the key constraints that lead to the insolvability of original problem and provide adjustive measures clearly. The adjustive measures include active power supplement, reactive power compensation, adjusting security constraints indices and so on. The improved algorithm has a good convergence property under various conditions. The proposed method has an advantage over other methods and can be applied in several aspects.