If you are using a piecewise linear cost model, the costs must be convex in order to define the function you intend. See section 6.4.1 in the (v 5) User’s Manual to understand the resulting cost function. In this case, I believe the objective function value will be equal to the sum of the y cost variables, which lies above what you intend at some points, whereas totcost() still gives the correct non-convex cost.
-- Ray Zimmerman Senior Research Associate B30 Warren Hall, Cornell University, Ithaca, NY 14853 USA phone: (607) 255-9645 On Aug 15, 2014, at 8:11 AM, Eser Patrick <[email protected]> wrote: > Ok, I found the reason: Some of my cost curves are non-convex. If I change > the curves to be perfectly linear, the two values match. > > But this does leave another question for me: In the case of non-convex cost > curves, what does the objective function value "result.f" represent? Why is > there a difference to the totcost() value? > > Thanks for your help. > ________________________________________ > Von: [email protected] > [[email protected]]" im Auftrag von "Eser > Patrick [[email protected]] > Gesendet: Freitag, 15. August 2014 11:45 > An: [email protected] > Betreff: Cost vs. Objective function discrepancy > > Dear MATPOWER community, > > I am experiencing a strange phenomenon when looking at the results of a > MATPOWER case I'm running. > > I have a system of around 200 buses and 300 generators, and when I solve the > system using IPOPT, I receive the following results: > >>> result.f > > ans = > > 6.9125e+05 > >>> sum(totcost(result.gencost, result.gen(:, PG))) > > ans = > > 6.1887e+05 > > So effectively, my objective function value is 691250 $/h, whereas my total > generator cost is just 618870 $/h. Where could this discrepancy come from? If > I "manually" calculate the production cost of all dispatched generators at > their respective power levels, I receive the exact value from the totcost() > function. Are some further shadow costs in the objective function value > (result.f)? > > I have to mention, that the case does converge (result.success = 1) and that > I do NOT have any dispatchable loads in the system. > > I'd be thankful for any hints on where to look for the problem. I can't see > it at the moment. > > Thanks, > Best Regards, > > Patrick > > >
