Dear Dr. Zimmerman, I may be wrong, but apprently, in opf_costfnc.m, line 135, there is an issue which it not clear to me. In calculating the gradiant of cost function, baseMVA is multiplied as in: df_dPgQg(ipol) = baseMVA * polycost(gencost(ipol, :), xx(ipol), 1);
However, in calculating xx(ipol), in line 87, it has already been considered that baseMVA should be multiplied to get actual values which are not in per unit as: xx = [ Pg; Qg ] * baseMVA; Therefore, there seem to be no reason for multiplying the gradient in line 135 by baseMVA again, and it should be: df_dPgQg(ipol) = polycost(gencost(ipol, :), xx(ipol), 1); Please, let me know of your opinion on this. Regards, Arash Alimardani
