Dear community, Hi. I have written a very simple OPF myself with objective function of loss minimization and I compared my results with matpower standard opf results.
My OPF program: - Input data : 'case6ww' in matpower - *ObjFcn = ∑Pg - ∑Pd* *- **∑Pd = const* - Flow limits : not considered in my program - Solver : fmincon Matpower Standard OPF program - Flow limits: not considered so : rateA = 0 for all lines - Solver : MIPS - generator cost data : My question I am only getting the same answer when mpc.gencost is like below : %% generator cost data % 1 startup shutdown n x1 y1 ... xn yn % 2 startup shutdown n c(n-1) ... c0 mpc.gencost = [ 2 0 0 2 *1* *0*; 2 0 0 2 *1 * *0*; 2 0 0 2 *1* *0*; ]; However, in FAQs of website it is mentioned that for loss minimization "*Assign positive, constant, equal costs to all generators*" which means I think: %% generator cost data % 1 startup shutdown n x1 y1 ... xn yn % 2 startup shutdown n c(n-1) ... c0 mpc.gencost = [ 2 0 0 2 *0* *1*; 2 0 0 2 *0* *1*; 2 0 0 2 *0* *1*; ]; In this case my results are different. I think costs should not be constant. It should be linear and P dependent like : C(P1) = P1 C(P2) = P2 C(P3) = P3 So Objective function becomes : Objective_costfcn = P1+P2+P3 = *∑Pg* *Can anyone help me to understand this problem and fix my own program?* *Best Wishes,* *Ehsan*
