The smartmarket code simply sets up the cost functions and generator limits for the OPF problem. The OPF minimizes total generation cost. In the case that includes dispatchable loads, modeled as negative generation, this cost is essential the cost of the normal generators plus the negative cost of the dispatchable loads. This is the same as the net benefit (value of dispatchable load minus cost of generation), with a change of sign.
If that still doesn’t seem to match for you, please give me minimal example I can use to reproduce what you’re seeing. Ray On Oct 14, 2023, at 12:17 AM, Dr. D. Karthikaikannan <karthikaikan...@eee.sastra.edu> wrote: Dear sir, In optimal power flow the objective function is sum of the cost function and benefit function of generator and load respectively. I run smart market and cross checked the objective function displayed with the corresponding cost function and generation using total cost function and it is not equal. what actually the objective function value denotes in smart market. D.Karthikaikannan