No. It is the total cost (based on offers) of generation, minus the total value 
(based on bids) of the dispatchable loads.

If you have a case where all of the loads are dispatchable (not true for 
t_auction_case) and have bids that accurately reflect their value, and 
generators offer their true costs, then the objective function would be equal 
to the negative of the social welfare.

That said, the runmarket() does maximize the welfare or system net benefits as 
defined by the bids and offers.

    Ray


On Oct 27, 2023, at 2:29 AM, Dr. D. Karthikaikannan 
<karthikaikan...@eee.sastra.edu> wrote:

thank you sir.
is that the objective function value 2985.78 $/hr  represents the social 
welfare (supplier profit for the given offers +consumer net surplus for the 
given bid).
________________________________
From: 
bounce-127850109-88225...@list.cornell.edu<mailto:bounce-127850109-88225...@list.cornell.edu>
 
<bounce-127850109-88225...@list.cornell.edu<mailto:bounce-127850109-88225...@list.cornell.edu>>
 on behalf of Ray Daniel Zimmerman <r...@cornell.edu<mailto:r...@cornell.edu>>
Sent: Thursday, October 26, 2023 11:31 PM
To: MATPOWER-L <matpowe...@list.cornell.edu<mailto:matpowe...@list.cornell.edu>>
Subject: Re: What the objective function denotes in the smart market

I see what’s going on. Turns out the explanation is simple. There are 2 sets of 
“costs” that are in play here.

1. The original generator costs in mpc.gencost. These represent the actual 
costs of the units.
2, The “costs” derived from the bids and offers. These are used for the actual 
optimization. You can find them in mpc_out.genoffer.

The cost displayed in the Market Summary output is based on 1. The objective 
function is based on 2.

>> sum(totcost(mpc_out.genoffer,mpc_out.gen(:,PG)))

ans =

   2.9858e+03

>> mpc_out.f

ans =

   2.9858e+03

Hope this clears things up.

    Ray


On Oct 26, 2023, at 3:05 AM, Dr. D. Karthikaikannan . 
<karthikaikan...@eee.sastra.edu<mailto:karthikaikan...@eee.sastra.edu>> wrote:

Dear sir,
this is the coding and results
clc
clear
mkt.OPF='AC';
mkt.auction_type=1;
mpc=loadcase('t_auction_case');
define_constants
offers.P.qty=[...
    12  24  24
    12  24  24
    12  24  24
    12  24  24
    12  24  24
    12  24  24];
offers.P.prc=[...
    20 50 60;
    20  40  70;
    20  42  80;
    20  44  90;
    20  46  75
    20  48  60];
bids.P.qty=[...
    10  10  10
    10  10  10
    10  10  10];
bids.P.prc=[...
    100 70  60;
    100 50  20;
    100 60  50];
[mpc_out,co,cb,f,dispatch,success,et]=runmarket(mpc,offers,bids,mkt);
sum(totcost(mpc_out.gencost,mpc_out.gen(:,PG)))
================================================================================
|     Market Summary                                                           |
================================================================================
Dispatch period duration: 1.00 hours
Gen  Bus     Pg      Price    Revenue   Fix+Var   Strt/Stp   Total    Earnings
 #    #     (MW)    ($/MWh)     ($)     Cost ($)  Cost ($)  Cost ($)     ($)
---  ---  --------  --------  --------  --------  --------  --------  --------
  1    1    35.32    50.000   1765.78   1172.63      0.00   1172.63    593.16
  2    2    36.00    50.241   1808.66   1200.00      0.00   1200.00    608.66
  3  220    36.00    50.337   1812.13   1200.00      0.00   1200.00    612.13
  4   27    36.00    51.024   1836.87   1200.00      0.00   1200.00    636.87
  5   23    36.00    52.170   1878.11   1200.00      0.00   1200.00    678.11
  6   13    36.00    52.983   1907.40   1200.00      0.00   1200.00    707.40
  7    7   -30.00    51.821  -1554.62  -3000.00      0.00  -3000.00   1445.38
  8   15   -10.00    54.031   -540.31  -1000.00      0.00  -1000.00    459.69
  9   30   -20.00    55.621  -1112.42  -2000.00      0.00  -2000.00    887.58
          --------            --------  --------  --------  --------  --------
Total:     155.32             7801.60   1172.63      0.00   1172.63   6628.97

Converged in 0.14 seconds
Objective Function Value = 2985.78 $/hr
================================================================================
|     System Summary                                                           |
================================================================================

How many?                How much?              P (MW)            Q (MVAr)
---------------------    -------------------  -------------  -----------------
Buses             30     Total Gen Capacity     360.0         -90.0 to 360.0
Generators         6     On-line Capacity       360.0         -90.0 to 360.0
Committed Gens     6     Generation (actual)    215.3             101.1
Loads             20     Load                   211.6             106.3
  Fixed           17       Fixed                151.6              82.3
  Dispatchable     3       Dispatchable          60.0 of 90.0      24.0
Shunts             2     Shunt (inj)             -0.0               0.2
Branches          41     Losses (I^2 * Z)         3.67             12.27
Transformers       0     Branch Charging (inj)     -               17.3
Inter-ties         7     Total Inter-tie Flow    33.1              21.8
Areas              3

                          Minimum                      Maximum
                 -------------------------  --------------------------------
Voltage Magnitude   0.974 p.u. @ bus 20         1.083 p.u. @ bus 13
Voltage Angle      -6.50 deg   @ bus 20         0.12 deg   @ bus 220
P Losses (I^2*R)             -                  0.54 MW    @ line 27-30
Q Losses (I^2*X)             -                  2.96 MVAr  @ line 12-13
Lambda P           50.00 $/MWh @ bus 1         57.18 $/MWh @ bus 20
Lambda Q           -0.00 $/MWh @ bus 1          1.79 $/MWh @ bus 20

================================================================================
|     Bus Data                                                                 |
================================================================================
 Bus      Voltage          Generation             Load          Lambda($/MVA-hr)
  #   Mag(pu) Ang(deg)   P (MW)   Q (MVAr)   P (MW)   Q (MVAr)     P        Q
----- ------- --------  --------  --------  --------  --------  -------  -------
    1  1.050    0.000*    35.32      0.75       -         -      50.000     -
    2  1.049   -0.486     36.00     13.64      5.04      2.95    50.241     -
    3  1.030   -1.912       -         -       22.32     11.16    51.115   0.317
    4  1.032   -1.896       -         -        8.83      1.86    51.126   0.274
    5  1.034   -1.747       -         -         -         -      50.896   0.232
    6  1.032   -1.820       -         -         -         -      51.061   0.265
    7  1.021   -2.430       -         -       30.00*    15.00*   51.560   0.522
    8  1.028   -2.005       -         -       13.95     13.95    51.170   0.357
    9  1.039   -0.872       -         -         -         -      50.938   0.212
   10  1.043   -0.381       -         -        6.74      2.32    50.875   0.182
   11  1.039   -0.872       -         -         -         -      50.938   0.212
   12  1.039   -3.223       -         -       13.02      8.72    52.983     -
   13  1.083   -0.657     36.00     34.42       -         -      52.983     -
   14  1.024   -3.944       -         -        7.21      1.86    53.896   0.334
   15  1.023   -3.733       -         -       10.00*     4.00*   53.831   0.500
   16  1.008   -4.377       -         -        4.07      2.09    54.400   0.944
   17  0.986   -5.212       -         -       10.46      6.74    55.387   1.601
   18  0.990   -5.526       -         -        3.72      1.05    56.052   1.385
   19  0.975   -6.406       -         -       11.04      3.95    57.077   1.762
   20  0.974   -6.499       -         -        2.56      0.81    57.176   1.794
   21  1.050   -0.009       -         -        3.39      2.17    50.476   0.027
  220  1.053    0.116     36.00     10.73       -         -      50.337     -
   23  1.047   -2.011     36.00     20.13     22.32     11.16    52.170     -
   24  1.038   -1.042       -         -       10.11      7.79    51.769   0.403
   25  1.050   -0.923       -         -         -         -      51.532   0.260
   26  1.030   -1.388       -         -        4.07      2.67    52.541   0.935
   27  1.067   -0.547     36.00     21.38       -         -      51.024     -
   28  1.036   -1.789       -         -         -         -      51.000   0.135
   29  1.032   -2.447       -         -        2.79      1.05    53.305   0.821
   30  1.006   -4.043       -         -       20.00*     5.00*   55.280   1.361
                        --------  --------  --------  --------
               Total:    215.32    101.05    211.64    106.31

================================================================================
|     Branch Data                                                              |
================================================================================
Brnch   From   To    From Bus Injection   To Bus Injection     Loss (I^2 * Z)
  #     Bus    Bus    P (MW)   Q (MVAr)   P (MW)   Q (MVAr)   P (MW)   Q (MVAr)
-----  -----  -----  --------  --------  --------  --------  --------  --------
   1      1      2     14.77     -4.03    -14.73      0.85     0.041      0.12
   2      1      3     20.54      4.78    -20.33     -6.15     0.207      0.79
   3      2      4     17.15      3.09    -16.98     -4.77     0.170      0.48
   4      3      4     -1.98     -5.01      1.99      5.02     0.003      0.01
   5      2      5     13.06      3.41    -12.98     -5.24     0.087      0.35
   6      2      6     15.48      3.34    -15.34     -5.08     0.141      0.42
   7      4      6     -3.40      0.60      3.40     -0.60     0.001      0.00
   8      5      7     12.98      5.44    -12.88     -6.27     0.095      0.23
   9      6      7     17.22      7.96    -17.12     -8.73     0.104      0.28
  10      6      8     10.91      9.43    -10.89     -9.35     0.020      0.08
  11      6      9     -8.45     -3.37      8.45      3.53     0.000      0.16
  12      6     10     -4.83     -1.92      4.83      2.07     0.000      0.14
  13      9     11      0.00      0.00      0.00      0.00     0.000      0.00
  14      9     10     -8.45     -3.53      8.45      3.62     0.000      0.09
  15      4     12      9.56     -2.70     -9.56      2.94    -0.000      0.24
  16     12     13    -36.00    -31.46     36.00     34.42     0.000      2.96
  17     12     14      6.59      3.12     -6.53     -2.99     0.059      0.13
  18     12     15     11.03      6.95    -10.92     -6.75     0.110      0.20
  19     12     16     14.92      9.72    -14.66     -9.14     0.264      0.59
  20     14     15     -0.68      1.13      0.68     -1.13     0.004      0.00
  21     16     17     10.59      7.04    -10.46     -6.74     0.127      0.30
  22     15     18     17.84      6.87    -17.45     -6.10     0.384      0.77
  23     18     19     13.73      5.06    -13.60     -4.77     0.131      0.28
  24     19     20      2.56      0.82     -2.56     -0.81     0.002      0.01
  25     10     20      0.00      0.00      0.00      0.00     0.000      0.00
  26     10     17      0.00      0.00      0.00      0.00     0.000      0.00
  27     10     21    -12.24     -4.92     12.29      5.03     0.048      0.11
  28     10    220     -7.78     -3.09      7.83      3.19     0.045      0.10
  29     21    220    -15.68     -7.20     15.71      7.25     0.027      0.05
  30     15     23    -17.60     -2.99     17.91      3.60     0.304      0.61
  31    220     24     12.46      0.29    -12.30     -0.04     0.168      0.25
  32     23     24     -4.22      5.37      4.28     -5.25     0.055      0.11
  33     24     25     -2.10     -2.45      2.11      2.48     0.018      0.03
  34     25     26      4.12      2.76     -4.07     -2.67     0.056      0.08
  35     25     27     -6.24     -5.24      6.31      5.37     0.066      0.13
  36     28     27     -5.99     -7.88      5.99      8.25     0.000      0.37
  37     27     29     10.55      3.56    -10.31     -3.10     0.240      0.46
  38     27     30     13.15      4.21    -12.62     -3.20     0.536      1.00
  39     29     30      7.52      2.05     -7.38     -1.80     0.137      0.26
  40      8     28     -3.06     -4.60      3.07      2.51     0.012      0.04
  41      6     28     -2.91     -6.42      2.92      5.37     0.008      0.02
                                                             --------  --------
                                                    Total:     3.672     12.27

================================================================================
|     Voltage Constraints                                                      |
================================================================================
Bus #  Vmin mu    Vmin    |V|   Vmax    Vmax mu
-----  --------   -----  -----  -----   --------
    1      -      0.950  1.050  1.050   118.677
   21      -      0.950  1.050  1.050   227.579
   25      -      0.950  1.050  1.050    51.254

================================================================================
|     Dispatchable Load Constraints                                            |
================================================================================
 Gen   Bus                  Active Power Limits
  #     #     Pmin mu     Pmin       Pg       Pmax    Pmax mu
----  -----   -------   --------  --------  --------  -------
   7     7      4.092    -30.00    -30.00      0.00      -

 Gen   Bus                 Reactive Power Limits
  #     #     Qmin mu     Qmin       Qg       Qmax    Qmax mu
----  -----   -------   --------  --------  --------  -------
   7     7      8.175    -15.00    -15.00      0.00      -

================================================================================
|     Branch Flow Constraints            (S in MVA)                            |
================================================================================
Brnch   From     "From" End        Limit       "To" End        To
  #     Bus   |Sf| mu    |Sf|     |Smax|     |St|    |St| mu   Bus
-----  -----  -------  --------  --------  --------  -------  -----
  15      4     0.000     9.93     10.00     10.00     1.710    12

ans =

   1.1726e+03

what the objective function value represents?


________________________________
From: 
bounce-127836391-88225...@list.cornell.edu<mailto:bounce-127836391-88225...@list.cornell.edu>
 
<bounce-127836391-88225...@list.cornell.edu<mailto:bounce-127836391-88225...@list.cornell.edu>>
 on behalf of Ray Daniel Zimmerman <r...@cornell.edu<mailto:r...@cornell.edu>>
Sent: Friday, October 20, 2023 2:53 AM
To: MATPOWER-L <matpowe...@list.cornell.edu<mailto:matpowe...@list.cornell.edu>>
Subject: Re: What the objective function denotes in the smart market

Can you send me the details I need to reproduce your result? The simple OPF on 
that case does show consistency between the objective function value and the 
sum of the generator costs.

>> r = runopf('t_auction_case');
>> sum(totcost(r.gencost, r.gen(:, PG)))

ans =

 -245.2078

>> r.f

ans =

 -245.2076

—Ray


On Oct 17, 2023, at 12:25 AM, Dr. D. Karthikaikannan 
<karthikaikan...@eee.sastra.edu<mailto:karthikaikan...@eee.sastra.edu>> wrote:

this is the result i got it when i run for t_auction_case
================================================================================
|     Market Summary                                                           |
================================================================================
Dispatch period duration: 1.00 hours
Gen  Bus     Pg      Price    Revenue   Fix+Var   Strt/Stp   Total    Earnings
 #    #     (MW)    ($/MWh)     ($)     Cost ($)  Cost ($)  Cost ($)     ($)
---  ---  --------  --------  --------  --------  --------  --------  --------
  1    1    35.32    50.000   1765.78   1172.63      0.00   1172.63    593.16
  2    2    36.00    50.241   1808.66   1200.00      0.00   1200.00    608.66
  3  220    36.00    50.337   1812.13   1200.00      0.00   1200.00    612.13
  4   27    36.00    51.024   1836.87   1200.00      0.00   1200.00    636.87
  5   23    36.00    52.170   1878.11   1200.00      0.00   1200.00    678.11
  6   13    36.00    52.983   1907.40   1200.00      0.00   1200.00    707.40
  7    7   -30.00    51.821  -1554.62  -3000.00      0.00  -3000.00   1445.38
  8   15   -10.00    54.031   -540.31  -1000.00      0.00  -1000.00    459.69
  9   30   -20.00    55.621  -1112.42  -2000.00      0.00  -2000.00    887.58
          --------            --------  --------  --------  --------  --------
Total:     155.32             7801.60   1172.63      0.00   1172.63   6628.97

Converged in 1.14 seconds
Objective Function Value = 2985.78 $/hr

I crossed the objective function value by using 
sum(totcost(mpc_out.gencost,mpc_out.gen(:,PG))). the answer is 1172.63.
what the value 2985.78 represents.                                              
          |

________________________________

From: 
bounce-127828667-88225...@list.cornell.edu<mailto:bounce-127828667-88225...@list.cornell.edu>
 
<bounce-127828667-88225...@list.cornell.edu<mailto:bounce-127828667-88225...@list.cornell.edu>>
 on behalf of Ray Daniel Zimmerman <r...@cornell.edu<mailto:r...@cornell.edu>>
Sent: Tuesday, October 17, 2023 1:45 AM
To: MATPOWER-L <matpowe...@list.cornell.edu<mailto:matpowe...@list.cornell.edu>>
Subject: Re: What the objective function denotes in the smart market

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<mailto: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


Reply via email to