#### F.2 Example

The case ﬁle lib/t/t_auction_case.m, used for this example, is a modiﬁed version of the 30-bus system that has 9 generators, where the last three have negative PMIN to model the dispatchable loads.

• Six generators with three blocks of capacity each, oﬀering as shown in Table F-2.
• Fixed load totaling 151.64 MW.
• Three dispatchable loads, bidding three blocks each as shown in Table F-3.

To solve this case using an AC optimal power ﬂow and a last accepted oﬀer (LAO) pricing rule, we use:

mkt.OPF = 'AC';
mkt.auction_type = 1;

and set up the problem as follows:

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);

The resulting cleared oﬀers and bids are:

>> co.P.qty

ans =

12.0000   23.3156         0
12.0000   24.0000         0
12.0000   24.0000         0
12.0000   24.0000         0
12.0000   24.0000         0
12.0000   24.0000         0

>> co.P.prc

ans =

50.0000   50.0000   50.0000
50.2406   50.2406   50.2406
50.3368   50.3368   50.3368
51.0242   51.0242   51.0242
52.1697   52.1697   52.1697
52.9832   52.9832   52.9832

>> cb.P.qty

ans =

10.0000   10.0000   10.0000
10.0000         0         0
10.0000   10.0000         0

>> cb.P.prc

ans =

51.8207   51.8207   51.8207
54.0312   54.0312   54.0312
55.6208   55.6208   55.6208

In other words, the sales by generators and purchases by loads are as shown summarized in Tables F-4 and Tables F-5, respectively.