-
Notifications
You must be signed in to change notification settings - Fork 21
/
e_report.gms
1985 lines (1638 loc) · 95.3 KB
/
e_report.gms
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
$setglobal ds \
$ifthen.unix %system.filesys% == UNIX
$setglobal ds /
$endif.unix
$if not set case $setglobal case ref
sets
sys_costs /
inv_co2_network_pipe
inv_co2_network_spur
inv_converter_costs
inv_dac
inv_h2_pipeline
inv_h2_production
inv_h2_storage
inv_investment_capacity_costs
inv_investment_refurbishment_capacity
inv_investment_spurline_costs_rsc_technologies
inv_investment_water_access
inv_itc_payments_negative
inv_itc_payments_negative_refurbishments
inv_spurline_investment
inv_transmission_intrazone_investment
inv_transmission_line_investment
op_acp_compliance_costs
op_co2_incentive_negative
op_co2_network_fom_pipe
op_co2_network_fom_spur
op_co2_storage
op_co2_transport_storage
op_consume_fom
op_consume_vom
op_emissions_taxes
op_fom_costs
op_fuelcosts_objfn
op_h2ct_fuel_costs
op_h2_fuel_costs
op_h2_revenue_exog
op_h2_transport
op_h2_transport_intrareg
op_h2_storage
op_h2_vom
op_h2_ptc_payments_negative
op_operating_reserve_costs
op_ptc_payments_negative
op_rect_fuel_costs
op_spurline_fom
op_startcost
op_transmission_fom
op_transmission_intrazone_fom
op_vom_costs
/,
sys_costs_inv(sys_costs) /
inv_co2_network_pipe
inv_co2_network_spur
inv_converter_costs
inv_dac
inv_h2_pipeline
inv_h2_production
inv_h2_storage
inv_investment_capacity_costs
inv_investment_refurbishment_capacity
inv_investment_spurline_costs_rsc_technologies
inv_investment_water_access
inv_itc_payments_negative
inv_itc_payments_negative_refurbishments
inv_spurline_investment
inv_transmission_intrazone_investment
inv_transmission_line_investment
/,
sys_costs_op(sys_costs) /
op_acp_compliance_costs
op_co2_incentive_negative
op_co2_network_fom_pipe
op_co2_network_fom_spur
op_co2_storage
op_co2_transport_storage
op_consume_fom
op_consume_vom
op_emissions_taxes
op_fom_costs
op_fuelcosts_objfn
op_h2ct_fuel_costs
op_h2_fuel_costs
op_h2_revenue_exog
op_h2_transport
op_h2_transport_intrareg
op_h2_storage
op_h2_ptc_payments_negative
op_operating_reserve_costs
op_ptc_payments_negative
op_spurline_fom
op_startcost
op_transmission_fom
op_transmission_intrazone_fom
op_vom_costs
/,
rev_cat "categories for renvenue streams" /load, res_marg, oper_res, rps, charge /,
lcoe_cat "categories for LCOE calculation" /capcost, upgradecost, rsccost, fomcost, vomcost, gen /
loadtype "categories for types of load" / end_use, dist_loss, trans_loss, stor_charge, h2_prod, h2_network, dac /
h2_demand_type / "electricity", "cross-sector"/
;
* Parameter definitions in the following file are read from e_report_params.csv
* and parsed in copy_files.py.
* All output parameters should be defined in e_report_params.csv.
$include e_report_params.gms
* Restrict operational outputs to representative timeslices and seasons
h(h)$[not h_rep(h)] = no ;
szn(szn)$[not szn_rep(szn)] = no ;
*=================================================
* -- CAPACITY ABOVE INTERCONNECTION QUEUE LIMIT --
*=================================================
cap_above_limit(tg,r,t)$tmodel_new(t) = CAP_ABOVE_LIM.l(tg,r,t) ;
*=====================
* -- CO2 Reporting --
*=====================
CO2_CAPTURED_out(r,h,t)$tmodel_new(t) = CO2_CAPTURED.l(r,h,t) ;
CO2_CAPTURED_out_ann(r,t)$tmodel_new(t) = sum(h,hours(h) * CO2_CAPTURED.l(r,h,t) );
CO2_STORED_out(r,cs,h,t)$[tmodel_new(t)$csfeas(cs)] = CO2_STORED.l(r,cs,h,t) ;
CO2_STORED_out_ann(r,cs,t)$[tmodel_new(t)$csfeas(cs)] = sum(h,hours(h) * CO2_STORED.l(r,cs,h,t) );
CO2_TRANSPORT_INV_out(r,rr,t)$tmodel_new(t) = CO2_TRANSPORT_INV.l(r,rr,t) ;
CO2_SPURLINE_INV_out(r,cs,t)$[tmodel_new(t)$csfeas(cs)] = CO2_SPURLINE_INV.l(r,cs,t) ;
CO2_FLOW_out(r,rr,h,t)$[(ord(r) < ord(rr))$tmodel_new(t)] = CO2_FLOW.l(r,rr,h,t) + CO2_FLOW.l(rr,r,h,t) ;
CO2_FLOW_out_ann(r,rr,t)$[(ord(r) < ord(rr))$tmodel_new(t)] = sum{h, hours(h) * (CO2_FLOW.l(r,rr,h,t) + CO2_FLOW.l(rr,r,h,t)) } ;
CO2_FLOW_pos_out(r,rr,h,t)$[(ord(r) < ord(rr))$tmodel_new(t)] = CO2_FLOW.l(r,rr,h,t) ;
CO2_FLOW_pos_out_ann(r,rr,t)$[(ord(r) < ord(rr))$tmodel_new(t)] = sum{h, hours(h) * CO2_FLOW.l(r,rr,h,t) } ;
CO2_FLOW_neg_out(r,rr,h,t)$[(ord(r) < ord(rr))$tmodel_new(t)] = -1 * CO2_FLOW.l(rr,r,h,t) ;
CO2_FLOW_neg_out_ann(r,rr,t)$[(ord(r) < ord(rr))$tmodel_new(t)] = -1 * sum{h, hours(h) * CO2_FLOW.l(rr,r,h,t) } ;
CO2_FLOW_net_out(r,rr,h,t)$[(ord(r) < ord(rr))$tmodel_new(t)] = CO2_FLOW.l(r,rr,h,t) - CO2_FLOW.l(rr,r,h,t) ;
CO2_FLOW_net_out_ann(r,rr,t)$[(ord(r) < ord(rr))$tmodel_new(t)] = sum{h, hours(h) * (CO2_FLOW.l(r,rr,h,t) - CO2_FLOW.l(rr,r,h,t)) } ;
*=========================
* LCOE
*=========================
avg_avail(i,v,r) = sum{h, hours(h) * avail(i,r,h) * derate_geo_vintage(i,v) } / 8760 ;
avg_cf(i,v,r,t)$[CAP.l(i,v,r,t)$(not rsc_i(i))] =
sum{h, GEN.l(i,v,r,h,t) * hours(h) }
/ sum{h,
CAP.l(i,v,r,t)
* (1 + sum{szn, h_szn(h,szn) * seas_cap_frac_delta(i,v,r,szn,t)})
* hours(h) }
;
*non-rsc technologies do not face the grid supply curve
*and thus can be assigned to an individual bin
*LCOE calculation is appropriate for sequential solve mode only where annual energy production is the same in every year.
*In inter-temporal modes this isn't the case and energy production should be discounted appropriately.
lcoe(i,v,r,t,"bin1")$[(not rsc_i(i))$valcap_init(i,v,r,t)$ivt(i,v,t)$avg_avail(i,v,r)] =
* cost of capacity divided by generation
((crf(t) * cost_cap_fin_mult(i,r,t) * cost_cap(i,t)$newv(v)
+ cost_fom(i,v,r,t)
) / (avg_avail(i,v,r) * 8760))
*plus VOM costs
+ cost_vom(i,v,r,t)
* plus fuel costs - assuming constant fuel prices here (model prices might be different)
+ heat_rate(i,v,r,t) * fuel_price(i,r,t)
;
gen_rsc(i,v,r,t)$[valcap_init(i,v,r,t)$ivt(i,v,t)$rsc_i(i)] =
sum{h, m_cf(i,v,r,h,t) * hours(h) } ;
lcoe(i,v,r,t,rscbin)$[valcap_init(i,v,r,t)$ivt(i,v,t)$rsc_i(i)$m_rscfeas(r,i,rscbin)$gen_rsc(i,v,r,t)] =
* cost of capacity divided by generation
(crf(t)
* (cost_cap_fin_mult(i,r,t) * cost_cap(i,t)
* Spur-line costs embedded in supply curve for techs without explicitly-modeled spurlines
+ m_rsc_dat(r,i,rscbin,"cost")$[newv(v)$(not spur_techs(i))]
* Spur-line costs assuming 1:1 ratio between gen cap and spur cap (i.e. no overbuilding)
+ sum{x$[xfeas(x)$x_r(x,r)$spur_techs(i)], spurline_cost(x) * Sw_SpurCostMult}
)
+ cost_fom(i,v,r,t)
) / gen_rsc(i,v,r,t)
*plus VOM costs
+ cost_vom(i,v,r,t)
;
lcoe_cf_act(i,v,r,t,rscbin)$[valcap_init(i,v,r,t)$rsc_i(i)] = lcoe(i,v,r,t,rscbin) ;
lcoe_cf_act(i,v,r,t,"bin1")$[(not rsc_i(i))$valcap_init(i,v,r,t)$ivt(i,v,t)$avg_cf(i,v,r,t)] =
* cost of capacity divided by generation
((crf(t) * cost_cap_fin_mult(i,r,t) * cost_cap(i,t)$newv(v)
+ cost_fom(i,v,r,t)
) / (avg_cf(i,v,r,t) * 8760)
)
*plus VOM costs
+ cost_vom(i,v,r,t)
*plus fuel costs - assuming constant fuel prices here (model prices might be different)
+ heat_rate(i,v,r,t) * fuel_price(i,r,t)
;
lcoe_nopol(i,v,r,t,rscbin)$valcap_init(i,v,r,t) = lcoe(i,v,r,t,rscbin) ;
lcoe_nopol(i,v,r,t,rscbin)$[valcap_init(i,v,r,t)$ivt(i,v,t)$rsc_i(i)$m_rscfeas(r,i,rscbin)$gen_rsc(i,v,r,t)] =
* cost of capacity divided by generation
(crf(t)
* (cost_cap_fin_mult_noITC(i,r,t) * cost_cap(i,t)
* Spur-line costs embedded in supply curve for techs without explicitly-modeled spurlines
+ m_rsc_dat(r,i,rscbin,"cost")$newv(v)$(not spur_techs(i)))
* Spur-line costs assuming 1:1 ratio between gen cap and spur cap (i.e. no overbuilding)
+ sum{x$[xfeas(x)$x_r(x,r)$spur_techs(i)], spurline_cost(x) * Sw_SpurCostMult}
+ cost_fom(i,v,r,t)
) / gen_rsc(i,v,r,t)
*plus VOM costs
+ cost_vom(i,v,r,t)
;
lcoe_fullpol(i,v,r,t,rscbin)$valcap_init(i,v,r,t) = lcoe(i,v,r,t,rscbin) ;
lcoe_fullpol(i,v,r,t,rscbin)$[valcap_init(i,v,r,t)$ivt(i,v,t)$rsc_i(i)$m_rscfeas(r,i,rscbin)$gen_rsc(i,v,r,t)] =
* cost of capacity divided by generation
(crf(t)
* (cost_cap_fin_mult(i,r,t) * cost_cap(i,t)
* Spur-line costs embedded in supply curve for techs without explicitly-modeled spurlines
+ m_rsc_dat(r,i,rscbin,"cost")$newv(v)$(not spur_techs(i)))
* Spur-line costs assuming 1:1 ratio between gen cap and spur cap (i.e. no overbuilding)
+ sum{x$[xfeas(x)$x_r(x,r)$spur_techs(i)], spurline_cost(x) * Sw_SpurCostMult}
+ cost_fom(i,v,r,t))
/ gen_rsc(i,v,r,t)
*plus VOM costs
+ cost_vom(i,v,r,t)
;
lcoe_built(i,r,t)$[ [sum{(v,h)$[valinv(i,v,r,t)$INV.l(i,v,r,t)], GEN.l(i,v,r,h,t) * hours(h) }] or
[sum{(v,h)$[UPGRADES.l(i,v,r,t)$Sw_Upgrades], GEN.l(i,v,r,h,t) * hours(h) }] ] =
(crf(t) * (
sum{v$valinv(i,v,r,t),
INV.l(i,v,r,t) * (cost_cap_fin_mult(i,r,t) * cost_cap(i,t) ) }
+ sum{v$[upgrade(i)$valcap(i,v,r,t)$Sw_Upgrades],
UPGRADES.l(i,v,r,t) * (cost_upgrade(i,v,r,t) * cost_cap_fin_mult(i,r,t) ) }
+ sum{(v,rscbin)$[m_rscfeas(r,i,rscbin)$valinv(i,v,r,t)$rsc_i(i)],
INV_RSC.l(i,v,r,rscbin,t) * m_rsc_dat(r,i,rscbin,"cost") * rsc_fin_mult(i,r,t) }
)
+ sum{v$valinv(i,v,r,t), cost_fom(i,v,r,t) * INV.l(i,v,r,t) }
+ sum{v$[upgrade(i)$valcap(i,v,r,t)$Sw_Upgrades], cost_fom(i,v,r,t) * UPGRADES.l(i,v,r,t) }
+ sum{(v,h)$[valinv(i,v,r,t)$INV.l(i,v,r,t)], (cost_vom(i,v,r,t)+ heat_rate(i,v,r,t) * fuel_price(i,r,t)) * GEN.l(i,v,r,h,t) * hours(h) }
+ sum{(v,h)$[UPGRADES.l(i,v,r,t)$Sw_Upgrades], (cost_vom(i,v,r,t)+ heat_rate(i,v,r,t) * fuel_price(i,r,t)) * GEN.l(i,v,r,h,t) * hours(h) }
) / (sum{(v,h)$[valinv(i,v,r,t)$INV.l(i,v,r,t)], GEN.l(i,v,r,h,t) * hours(h) }
+ sum{(v,h)$[UPGRADES.l(i,v,r,t)$Sw_Upgrades], GEN.l(i,v,r,h,t) * hours(h) })
;
lcoe_built_nat(i,t)$[sum{(v,r)$valinv(i,v,r,t), INV.l(i,v,r,t) }] =
sum{r, lcoe_built(i,r,t) * sum{v$valinv(i,v,r,t), INV.l(i,v,r,t) } }
/ sum{(v,r)$valinv(i,v,r,t), INV.l(i,v,r,t) } ;
lcoe_pieces("capcost",i,r,t)$tmodel_new(t) = sum{v$valinv(i,v,r,t),
INV.l(i,v,r,t) * (cost_cap_fin_mult(i,r,t) * cost_cap(i,t) ) } ;
lcoe_pieces("upgradecost",i,r,t)$tmodel_new(t) =
sum{v$[upgrade(i)$valcap(i,v,r,t)$Sw_Upgrades],
cost_upgrade(i,v,r,t) * cost_cap_fin_mult(i,r,t) * UPGRADES.l(i,v,r,t) }
+ sum{(v,rscbin)$allow_cap_up(i,v,r,rscbin,t),
cost_cap_fin_mult(i,r,t) * INV_CAP_UP.l(i,v,r,rscbin,t) * cost_cap_up(i,v,r,rscbin,t) }
+ sum{(v,rscbin)$allow_ener_up(i,v,r,rscbin,t),
cost_cap_fin_mult(i,r,t) * INV_ENER_UP.l(i,v,r,rscbin,t) * cost_ener_up(i,v,r,rscbin,t) } ;
lcoe_pieces("rsccost",i,r,t)$tmodel_new(t) =
sum{(v,rscbin)$[m_rscfeas(r,i,rscbin)$valinv(i,v,r,t)$rsc_i(i)],
INV_RSC.l(i,v,r,rscbin,t) * m_rsc_dat(r,i,rscbin,"cost") * rsc_fin_mult(i,r,t) } ;
lcoe_pieces("fomcost",i,r,t)$tmodel_new(t) =
sum{v$valinv(i,v,r,t), cost_fom(i,v,r,t) * INV.l(i,v,r,t) }
+ sum{v$[upgrade(i)$valcap(i,v,r,t)$Sw_Upgrades], cost_fom(i,v,r,t) * UPGRADES.l(i,v,r,t)} ;
lcoe_pieces("vomcost",i,r,t)$tmodel_new(t) =
sum{(v,h)$[valinv(i,v,r,t)$INV.l(i,v,r,t)],
(cost_vom(i,v,r,t) + heat_rate(i,v,r,t) * fuel_price(i,r,t)) * GEN.l(i,v,r,h,t) * hours(h) }
+ sum{(v,h)$[UPGRADES.l(i,v,r,t)$Sw_Upgrades],
(cost_vom(i,v,r,t) + heat_rate(i,v,r,t) * fuel_price(i,r,t)) * GEN.l(i,v,r,h,t) * hours(h)} ;
lcoe_pieces("gen",i,r,t)$tmodel_new(t) =
sum{(v,h)$[valinv(i,v,r,t)$INV.l(i,v,r,t)], GEN.l(i,v,r,h,t) * hours(h) }
+ sum{(v,h)$[UPGRADES.l(i,v,r,t)$Sw_Upgrades], GEN.l(i,v,r,h,t) * hours(h) } ;
lcoe_pieces_nat(lcoe_cat,i,t)$tmodel_new(t) = sum{r, lcoe_pieces(lcoe_cat,i,r,t) } ;
*========================================
* REQUIREMENT PRICES AND QUANTITIES
*========================================
objfn_raw = z.l ;
load_frac_rt(r,t)$sum{(rr,h), LOAD.l(rr,h,t) } = sum{h, hours(h) * LOAD.l(r,h,t) }/ sum{(rr,h), hours(h) * LOAD.l(rr,h,t) } ;
*Load and operating reserve prices are $/MWh, and reserve margin price is $/MW/rep-day for
* capacity credit formulation and $/MW/stress-timeslice for stress period formulation.
reqt_price('load','na',r,h,t)$tmodel_new(t) =
(1 / cost_scale) * (1 / pvf_onm(t)) * eq_supply_demand_balance.m(r,h,t) / hours(h) ;
reqt_price('oper_res',ortype,r,h,t)$tmodel_new(t) =
(1 / cost_scale) * (1 / pvf_onm(t)) * eq_OpRes_requirement.m(ortype,r,h,t) / hours(h) ;
reqt_price('state_rps',RPSCat,r,'ann',t)$tmodel_new(t) =
(1 / cost_scale) * (1 / pvf_onm(t)) * sum{st$r_st(r,st), eq_REC_Requirement.m(RPSCat,st,t) } ;
reqt_price('nat_gen','na',r,'ann',t)$tmodel_new(t) =
(1 / cost_scale) * (1 / pvf_onm(t)) * eq_national_gen.m(t) ;
reqt_price('annual_cap',e,r,'ann',t)$tmodel_new(t) =
(1 / cost_scale) * (1 / pvf_onm(t)) * eq_annual_cap.m(e,t) ;
* Capacity credit formulation ($/MW/rep-day)
reqt_price('res_marg','na',r,ccseason,t)$[Sw_PRM_CapCredit$tmodel_new(t)] =
eq_reserve_margin.m(r,ccseason,t) * (1 / cost_scale) * (1 / pvf_onm(t));
* Stress period formulation ($/MW/stress-timeslice)
reqt_price('res_marg','na',r,allh,t)$[(Sw_PRM_CapCredit=0)$tmodel_new(t)$h_stress_t(allh,t)] =
eq_supply_demand_balance.m(r,allh,t) * (1 / cost_scale) * (1 / pvf_onm(t));
reqt_price('res_marg_ann','na',r,'ann',t)$tmodel_new(t) =
* Capacity credit formulation ($/MW-yr)
sum{ccseason, reqt_price('res_marg','na',r,ccseason,t) }$Sw_PRM_CapCredit
* Stress period formulation ($/MW-yr)
+ sum{allh$h_stress_t(allh,t), reqt_price('res_marg','na',r,allh,t) }$(Sw_PRM_CapCredit=0)
;
*The marginal on the total load constraint, eq_loadcon is converted to $/MW-yr.
*We can't convert to $/MWh because stress periods have no hours.
reqt_price('eq_loadcon','na',r,allh,t)$[tmodel_new(t)$h_t(allh,t)] =
(1 / cost_scale) * (1 / pvf_onm(t)) * eq_loadcon.m(r,allh,t) ;
*Load and operating reserve quantities are MWh, and reserve margin quantity is MW
* Demand from production activities (H2 and DAC) doesn't count toward electricity demand
reqt_quant('load','na',r,h,t)$tmodel_new(t) =
hours(h) * (
LOAD.l(r,h,t)
- sum{(p,i,v)$[consume(i)$valcap(i,v,r,t)$i_p(i,p)$Sw_Prod],
PRODUCE.l(p,i,v,r,h,t) / prod_conversion_rate(i,v,r,t) }
) ;
* Capacity credit formulation
reqt_quant('res_marg','na',r,ccseason,t)$[Sw_PRM_CapCredit$tmodel_new(t)] =
(peakdem_static_ccseason(r,ccseason,t)
* + PEAK_FLEX.l(r,ccseason,t)
) * (1 + prm(r,t)) ;
* Stress period formulation
reqt_quant('res_marg','na',r,allh,t)$[(Sw_PRM_CapCredit=0)$tmodel_new(t)$h_stress_t(allh,t)] =
LOAD.l(r,allh,t) ;
* Annual res_marg quantity is defined as the max requirement level in the year.
reqt_quant('res_marg_ann','na',r,'ann',t)$tmodel_new(t) =
* Capacity credit formulation
smax{ccseason, reqt_quant('res_marg','na',r,ccseason,t) }$Sw_PRM_CapCredit
* Stress period formulation
+ smax{allh$h_stress_t(allh,t), reqt_quant('res_marg','na',r,allh,t) }$(Sw_PRM_CapCredit=0)
;
reqt_quant('oper_res',ortype,r,h,t)$tmodel_new(t) =
hours(h) * (
orperc(ortype,"or_load") * LOAD.l(r,h,t)
+ orperc(ortype,"or_wind") * sum{(i,v)$[wind(i)$valgen(i,v,r,t)],
GEN.l(i,v,r,h,t) }
+ orperc(ortype,"or_pv") * sum{(i,v)$[pv(i)$valcap(i,v,r,t)],
CAP.l(i,v,r,t) }$dayhours(h)
) ;
reqt_quant('state_rps',RPSCat,r,'ann',t)$tmodel_new(t) =
sum{(st,h)$r_st_rps(r,st), RecPerc(RPSCat,st,t) * hours(h) *(
( (LOAD.l(r,h,t) - can_exports_h(r,h,t)$[Sw_Canada=1]
- sum{v$valgen("distpv",v,r,t), GEN.l("distpv",v,r,h,t) }) * (1.0 - distloss)
)$(RecStyle(st,RPSCat)=0)
+ ( LOAD.l(r,h,t) - can_exports_h(r,h,t)$[Sw_Canada=1]
- sum{v$valgen("distpv",v,r,t), GEN.l("distpv",v,r,h,t) }
)$(RecStyle(st,RPSCat)=1)
+ ( sum{(i,v)$[valgen(i,v,r,t)$(not storage_standalone(i))], GEN.l(i,v,r,h,t)
- (distloss * GEN.l(i,v,r,h,t))$(distpv(i) or dupv(i))
- (STORAGE_IN_GRID.l(i,v,r,h,t) * storage_eff_pvb_g(i,t))$[storage_hybrid(i)$(not csp(i))$Sw_HybridPlant] }
- can_exports_h(r,h,t)$[(Sw_Canada=1)$sameas(RPSCat,"CES")]
)$(RecStyle(st,RPSCat)=2)
)} ;
reqt_quant('nat_gen','na',r,'ann',t)$tmodel_new(t) =
national_gen_frac(t) * (
* if Sw_GenMandate = 1, then apply the fraction to the bus bar load
(
sum{h, LOAD.l(r,h,t) * hours(h) }
+ sum{(rr,h,trtype)$routes(rr,r,trtype,t), (tranloss(rr,r,trtype) * FLOW.l(rr,r,h,t,trtype) * hours(h)) }
)$[Sw_GenMandate = 1]
* if Sw_GenMandate = 2, then apply the fraction to the end use load
+ (sum{h,
hours(h) *
( (LOAD.l(r,h,t) - can_exports_h(r,h,t)) * (1.0 - distloss) - sum{v$valgen("distpv",v,r,t), GEN.l("distpv",v,r,h,t) })
})$[Sw_GenMandate = 2]
) ;
reqt_quant('annual_cap',e,r,'ann',t)$tmodel_new(t) = emit_cap(e,t) * load_frac_rt(r,t) ;
*We keep quantity of eq_loadcon in MW
reqt_quant('eq_loadcon','na',r,allh,t)$[tmodel_new(t)$h_t(allh,t)] = LOAD.l(r,allh,t) ;
*System-wide average prices:
reqt_price_sys('load','na',h,t)$sum{r, reqt_quant('load','na',r,h,t)} =
sum{r, reqt_price('load','na',r,h,t) * reqt_quant('load','na',r,h,t)}/
sum{r, reqt_quant('load','na',r,h,t)} ;
reqt_price_sys('oper_res',ortype,h,t)$sum{r, reqt_quant('oper_res',ortype,r,h,t)} =
sum{r, reqt_price('oper_res',ortype,r,h,t) * reqt_quant('oper_res',ortype,r,h,t)}/
sum{r, reqt_quant('oper_res',ortype,r,h,t)} ;
reqt_price_sys('state_rps',RPSCat,'ann',t)$sum{r, reqt_quant('state_rps',RPSCat,r,'ann',t)} =
sum{r, reqt_price('state_rps',RPSCat,r,'ann',t) * reqt_quant('state_rps',RPSCat,r,'ann',t)}/
sum{r, reqt_quant('state_rps',RPSCat,r,'ann',t)} ;
reqt_price_sys('nat_gen','na','ann',t)$sum{r, reqt_quant('nat_gen','na',r,'ann',t)} =
sum{r, reqt_price('nat_gen','na',r,'ann',t) * reqt_quant('nat_gen','na',r,'ann',t)}/
sum{r, reqt_quant('nat_gen','na',r,'ann',t)} ;
reqt_price_sys('annual_cap',e,'ann',t)$sum{r, reqt_quant('annual_cap',e,r,'ann',t)} =
sum{r, reqt_price('annual_cap',e,r,'ann',t) * reqt_quant('annual_cap',e,r,'ann',t)}/
sum{r, reqt_quant('annual_cap',e,r,'ann',t)} ;
reqt_price_sys('res_marg','na',ccseason,t)$[Sw_PRM_CapCredit$sum{r, reqt_quant('res_marg','na',r,ccseason,t)}] =
sum{r, reqt_price('res_marg','na',r,ccseason,t) * reqt_quant('res_marg','na',r,ccseason,t)}/
sum{r, reqt_quant('res_marg','na',r,ccseason,t)} ;
reqt_price_sys('res_marg','na',allh,t)$[(Sw_PRM_CapCredit=0)$h_stress_t(allh,t)$sum{r, reqt_quant('res_marg','na',r,allh,t)}] =
sum{r, reqt_price('res_marg','na',r,allh,t) * reqt_quant('res_marg','na',r,allh,t)}/
sum{r, reqt_quant('res_marg','na',r,allh,t)} ;
load_rt(r,t)$tmodel_new(t) = sum{h, hours(h) * load_exog(r,h,t) } ;
load_stress(r,allh,t)$[tmodel_new(t)$h_stress_t(allh,t)] = LOAD.l(r,allh,t) ;
co2_price(t)$tmodel_new(t) = (1 / cost_scale) * (1 / pvf_onm(t)) * eq_annual_cap.m("CO2",t) ;
rggi_price(t)$tmodel_new(t) = (1 / cost_scale) * (1 / pvf_onm(t)) * eq_RGGI_cap.m(t) ;
rggi_quant(t)$tmodel_new(t) = RGGI_cap(t) ;
state_cap_and_trade_price(st,t)$tmodel_new(t) =
(1 / cost_scale) * (1 / pvf_onm(t))
* eq_state_cap.m(st,t) ;
state_cap_and_trade_quant(st,t)$tmodel_new(t) =
state_cap(st,t) ;
tran_hurdle_cost_ann(r,rr,trtype,t)$[tmodel_new(t)$routes(r,rr,trtype,t)$cost_hurdle(r,rr,t)] =
sum{h, hours(h) * cost_hurdle(r,rr,t) * FLOW.l(r,rr,h,t,trtype) } ;
*========================================
* RPS, CES, AND TAX CREDIT OUTPUTS
*========================================
rec_outputs(RPSCat,i,st,ast,t)$[stfeas(st)$(stfeas(ast) or sameas(ast,"voluntary"))$tmodel_new(t)] = RECS.l(RPSCat,i,st,ast,t) ;
acp_purchases_out(rpscat,st,t) = ACP_PURCHASES.l(RPSCat,st,t) ;
ptc_out(i,v,t)$[tmodel_new(t)$ptc_value_scaled(i,v,t)] = ptc_value_scaled(i,v,t) * tc_phaseout_mult(i,v,t) ;
*========================================
* FUEL PRICES AND QUANTITIES
*========================================
* The marginal biomass fuel price is derived from the linear program constraint marginals
* Case 1: the resource of a biomass class is NOT exhausted, i.e., BIOUSED.l(bioclass) < biosupply(bioclass)
* Marginal Biomass Price = eq_bioused.m
* Case 2: the resource of one or more biomass classes ARE exhausted, i.e., BIOUSED.l(bioclass) = biosupply(bioclass)
* Marginal Biomass Price = maximum difference between eq_bioused.m and eq_biousedlimit.m(bioclass) across all biomass classes in a region
repbioprice(r,t)$tmodel_new(t) = max{0, smax{bioclass$BIOUSED.l(bioclass,r,t), eq_bioused.m(r,t) -
sum{usda_region$r_usda(r,usda_region), eq_biousedlimit.m(bioclass,usda_region,t) } } } / pvf_onm(t) ;
* quantity of biomass used (convert from mmBTU to dry tons using biomass energy content)
bioused_out(bioclass,r,t)$tmodel_new(t) = BIOUSED.l(bioclass,r,t) / bio_energy_content ;
bioused_usda(bioclass,usda_region,t)$tmodel_new(t) = sum{r$r_usda(r,usda_region), bioused_out(bioclass,r,t) } ;
* 1e9 converts from MMBtu to Quads
repgasquant(cendiv,t)$[(Sw_GasCurve = 0 or Sw_GasCurve = 3)$tmodel_new(t)] =
sum{(gb,h), GASUSED.l(cendiv,gb,h,t) * hours(h) } * gas_scale/ 1e9 ;
repgasquant(cendiv,t)$[(Sw_GasCurve = 1 or Sw_GasCurve = 2)$tmodel_new(t)] =
( sum{(i,v,r,h)$[r_cendiv(r,cendiv)$valgen(i,v,r,t)$gas(i)$heat_rate(i,v,r,t)],
hours(h) * heat_rate(i,v,r,t) * GEN.l(i,v,r,h,t)}
+ sum{(v,r,h)$[valcap("dac_gas",v,r,t)$r_cendiv(r,cendiv)],
hours(h) * dac_gas_cons_rate("dac_gas",v,t) * PRODUCE.l("DAC","dac_gas",v,r,h,t) }$Sw_DAC_Gas
+ sum{(p,i,v,r,h)$[r_cendiv(r,cendiv)$valcap(i,v,r,t)$smr(i)],
hours(h) * smr_methane_rate * PRODUCE.l(p,i,v,r,h,t) }$Sw_H2
) / 1e9 ;
repgasquant_irt(i,r,t)$tmodel_new(t) =
( sum{(v,h)$[valgen(i,v,r,t)$gas(i)$heat_rate(i,v,r,t)],
hours(h) * heat_rate(i,v,r,t) * GEN.l(i,v,r,h,t) }
+ sum{(v,h)$[valcap("dac_gas",v,r,t)],
hours(h) * dac_gas_cons_rate("dac_gas",v,t) * PRODUCE.l("DAC","dac_gas",v,r,h,t) }$Sw_DAC_Gas
+ sum{(p,v,h)$[valcap(i,v,r,t)$smr(i)],
hours(h) * smr_methane_rate * PRODUCE.l(p,i,v,r,h,t) }$Sw_H2
) / 1e9 ;
repgasquant_nat(t)$tmodel_new(t) = sum{cendiv, repgasquant(cendiv,t) } ;
*for reported gasprice (not that used to compute system costs)
*scale back to $ / mmbtu
repgasprice(cendiv,t)$[(Sw_GasCurve = 0)$tmodel_new(t)$repgasquant(cendiv,t)] =
smax{gb$[sum{h, GASUSED.l(cendiv,gb,h,t) }], gasprice(cendiv,gb,t) } / gas_scale ;
repgasprice(cendiv,t)$[(Sw_GasCurve = 2)$tmodel_new(t)$repgasquant(cendiv,t)] =
sum{(i,v,r,h)$[r_cendiv(r,cendiv)$valgen(i,v,r,t)$gas(i)$heat_rate(i,v,r,t)],
hours(h)*heat_rate(i,v,r,t)*fuel_price(i,r,t)*GEN.l(i,v,r,h,t)
} / (repgasquant(cendiv,t) * 1e9) ;
repgasprice_r(r,t)$[(Sw_GasCurve = 0 or Sw_GasCurve = 2)$tmodel_new(t)] = sum{cendiv$r_cendiv(r,cendiv), repgasprice(cendiv,t) } ;
repgasprice_r(r,t)$[(Sw_GasCurve = 1)$tmodel_new(t)] =
( sum{(h,cendiv),
gasmultterm(cendiv,t) * szn_adj_gas(h) * cendiv_weights(r,cendiv) *
hours(h) } / sum{h, hours(h) }
+ smax((fuelbin,cendiv)$[VGASBINQ_REGIONAL.l(fuelbin,cendiv,t)$r_cendiv(r,cendiv)], gasbinp_regional(fuelbin,cendiv,t) )
+ smax(fuelbin$VGASBINQ_NATIONAL.l(fuelbin,t), gasbinp_national(fuelbin,t) )
) ;
repgasprice(cendiv,t)$[(Sw_GasCurve = 1)$tmodel_new(t)$repgasquant(cendiv,t)] =
sum{(i,r)$r_cendiv(r,cendiv), repgasprice_r(r,t) * repgasquant_irt(i,r,t) } / repgasquant(cendiv,t) ;
repgasprice_nat(t)$[tmodel_new(t)$sum{cendiv, repgasquant(cendiv,t) }] =
sum{cendiv, repgasprice(cendiv,t) * repgasquant(cendiv,t) }
/ sum{cendiv, repgasquant(cendiv,t) } ;
*========================================
* NATURAL GAS FUEL COSTS
*========================================
gasshare_ba(r,cendiv,t)$[r_cendiv(r,cendiv)$tmodel_new(t)$repgasquant(cendiv,t)] =
sum{i$[valgen_irt(i,r,t)$gas(i)],repgasquant_irt(i,r,t) / repgasquant(cendiv,t) } ;
gasshare_techba(i,r,cendiv,t)$[r_cendiv(r,cendiv)$tmodel_new(t)$repgasquant(cendiv,t)$gas(i)] =
repgasquant_irt(i,r,t) / repgasquant(cendiv,t) ;
gasshare_cendiv(cendiv,t)$[sum{cendiv2,repgasquant(cendiv2,t)}] = repgasquant(cendiv,t) / sum{cendiv2,repgasquant(cendiv2,t)} ;
gascost_cendiv(cendiv,t)$tmodel_new(t) =
*cost of natural gas for Sw_GasCurve = 2 (static natural gas prices)
+ sum{(i,v,r,h)$[r_cendiv(r,cendiv)$valgen(i,v,r,t)$gas(i)$heat_rate(i,v,r,t)
$[not bio(i)]$[not cofire(i)]$[Sw_GasCurve = 2]],
hours(h) * heat_rate(i,v,r,t) * fuel_price(i,r,t) * GEN.l(i,v,r,h,t) }
*cost of natural gas for Sw_GasCurve = 0 (census division supply curves natural gas prices)
+ sum{gb, sum{h,hours(h) * GASUSED.l(cendiv,gb,h,t) } * gasprice(cendiv,gb,t)
}$[Sw_GasCurve = 0]
*cost of natural gas for Sw_GasCurve = 3 (national supply curve for natural gas prices with census division multipliers)
+ sum{(h,gb), hours(h) * GASUSED.l(cendiv,gb,h,t)
* gasadder_cd(cendiv,t,h) + gasprice_nat_bin(gb,t)
}$[Sw_GasCurve = 3]
*cost of natural gas for Sw_GasCurve = 1 (national and census division supply curves for natural gas prices)
*first - anticipated costs of gas consumption given last year's amount
+ (sum{(i,v,r,h)$[valgen(i,v,r,t)$gas(i)],
gasmultterm(cendiv,t) * szn_adj_gas(h) * cendiv_weights(r,cendiv) *
hours(h) * heat_rate(i,v,r,t) * GEN.l(i,v,r,h,t) }
*second - adjustments based on changes from last year's consumption at the regional and national level
+ sum{(fuelbin),
gasbinp_regional(fuelbin,cendiv,t) * VGASBINQ_REGIONAL.l(fuelbin,cendiv,t) }
+ sum{(fuelbin),
gasbinp_national(fuelbin,t) * VGASBINQ_NATIONAL.l(fuelbin,t) } * gasshare_cendiv(cendiv,t)
)$[Sw_GasCurve = 1];
*========================================
* BIOFUEL COSTS
*========================================
bioshare_techba(i,r,t)$[(cofire(i) or bio(i))$tmodel_new(t)] =
* biofuel-based generation of tech i in the BA (biopower + cofire)
(( sum{(v,h)$[valgen(i,v,r,t)$bio(i)], hours(h) * heat_rate(i,v,r,t) * GEN.l(i,v,r,h,t) }
+ sum{(v,h)$[cofire(i)$valgen(i,v,r,t)], bio_cofire_perc * hours(h) * heat_rate(i,v,r,t) * GEN.l(i,v,r,h,t) }
) /
* biofuel-based generation of all techs in the BA (biopower + cofire)
( sum{(ii,v,h)$[valgen(ii,v,r,t)$bio(ii)], hours(h) * heat_rate(ii,v,r,t) * GEN.l(ii,v,r,h,t) }
+ sum{(ii,v,h)$[cofire(ii)$valgen(ii,v,r,t)], bio_cofire_perc * hours(h) * heat_rate(ii,v,r,t) * GEN.l(ii,v,r,h,t) }
)
)$[ sum{(ii,v,h)$[valgen(ii,v,r,t)$bio(ii)], hours(h) * heat_rate(ii,v,r,t) * GEN.l(ii,v,r,h,t) }
+ sum{(ii,v,h)$[cofire(ii)$valgen(ii,v,r,t)], bio_cofire_perc * hours(h) * heat_rate(ii,v,r,t) * GEN.l(ii,v,r,h,t) }
]
;
*=========================
* GENERATION
*=========================
* Calculate generation and include charging, pumping, DR shifted load, and production as negative values
gen_h(i,r,h,t)$[tmodel_new(t)$valgen_irt(i,r,t)] =
sum{v$valgen(i,v,r,t), GEN.l(i,v,r,h,t)
* less storage charging
- STORAGE_IN.l(i,v,r,h,t)$[storage_standalone(i) or hyd_add_pump(i)]
* less DR shifting
- sum{(hh)$[dr1(i)$DR_SHIFT.l(i,v,r,h,hh,t)], DR_SHIFT.l(i,v,r,h,hh,t) / hours(h) / storage_eff(i,t)} }
* less load from hydrogen production
- sum{(v,p)$[consume(i)$valcap(i,v,r,t)$i_p(i,p)], PRODUCE.l(p,i,v,r,h,t) / prod_conversion_rate(i,v,r,t)}$Sw_Prod
;
* A small amount of upv capacity is actually csp-ns, so convert it back now.
* UPV capacity is already in MWac at this point (matching csp-ns),
* so don't need to account for ILR.
gen_h("csp-ns",r,h,t)$[cap_cspns(r,t)$tmodel_new(t)]
= cap_cspns(r,t) * m_cf("upv_6","new1",r,h,t) ;
* We have to take csp-ns generation from somewhere, so take it from upv_6 (which all the
* csp-ns-containing regions have)
gen_h("upv_6",r,h,t)$[cap_cspns(r,t)$tmodel_new(t)]
= gen_h("upv_6",r,h,t) - gen_h("csp-ns",r,h,t) ;
* Make sure it doesn't go negative, just in case
gen_h("upv_6",r,h,t)$[cap_cspns(r,t)$tmodel_new(t)$(gen_h("upv_6",r,h,t) < 0)] = 0 ;
* Do it again for stress periods
gen_h_stress(i,r,allh,t)$[tmodel_new(t)$valgen_irt(i,r,t)$h_stress_t(allh,t)] =
sum{v$valgen(i,v,r,t), GEN.l(i,v,r,allh,t)
* less storage charging
- STORAGE_IN.l(i,v,r,allh,t)$[storage_standalone(i) or hyd_add_pump(i)] }
* less load from hydrogen production
- sum{(v,p)$[consume(i)$valcap(i,v,r,t)$i_p(i,p)],
PRODUCE.l(p,i,v,r,allh,t) / prod_conversion_rate(i,v,r,t)}$Sw_Prod
;
gen_ann(i,r,t)$tmodel_new(t) = sum{h, gen_h(i,r,h,t) * hours(h) } ;
* Report generation without the charging, DR, and production included as above
gen_ivrt(i,v,r,t)$valgen(i,v,r,t) = sum{h, GEN.l(i,v,r,h,t) * hours(h) } ;
gen_ivrt_uncurt(i,v,r,t)$[(vre(i) or storage_hybrid(i)$(not csp(i)))$valgen(i,v,r,t)] =
sum{h, m_cf(i,v,r,h,t) * CAP.l(i,v,r,t) * hours(h) } ;
stor_inout(i,v,r,t,"in")$[valgen(i,v,r,t)$storage(i)$[not storage_hybrid(i)$(not csp(i))]] = sum{h, STORAGE_IN.l(i,v,r,h,t) * hours(h) } ;
stor_inout(i,v,r,t,"out")$[valgen(i,v,r,t)$storage(i)] = gen_ivrt(i,v,r,t) ;
stor_in(i,v,r,h,t)$[storage(i)$valgen(i,v,r,t)$(not storage_hybrid(i)$(not csp(i)))] = STORAGE_IN.l(i,v,r,h,t) ;
stor_out(i,v,r,h,t)$[storage(i)$valgen(i,v,r,t)] = GEN.l(i,v,r,h,t) ;
stor_level(i,v,r,h,t)$[valgen(i,v,r,t)$storage(i)] = STORAGE_LEVEL.l(i,v,r,h,t) ;
*=====================================================================
* WATER ACCOUNTING, CAPACITY, NEW CAPACITY, AND RETIRED CAPACITY
*=====================================================================
water_withdrawal_ivrt(i,v,r,t)$valgen(i,v,r,t) = sum{h$valgen(i,v,r,t), WAT.l(i,v,"with",r,h,t) } ;
water_consumption_ivrt(i,v,r,t)$valgen(i,v,r,t) = sum{h$valgen(i,v,r,t), WAT.l(i,v,"cons",r,h,t) } ;
watcap_ivrt(i,v,r,t)$valcap(i,v,r,t) = WATCAP.l(i,v,r,t) ;
watcap_out(i,r,t)$valcap_irt(i,r,t) = sum{v$valcap(i,v,r,t), WATCAP.l(i,v,r,t) } ;
watcap_new_out(i,r,t)$[valcap_irt(i,r,t)$i_water_cooling(i)] =
sum{h$h_rep(h),
hours(h)
* sum{w$[i_w(i,w)],
water_rate(i,w,r) }
* ( sum{v$valinv(i,v,r,t), INV.l(i,v,r,t) + INV_REFURB.l(i,v,r,t)}
+ sum{v$valcap(i,v,r,t),
(1-upgrade_derate(i,v,r,t)) * (UPGRADES.l(i,v,r,t) - UPGRADES_RETIRE.l(i,v,r,t))}$[upgrade(i)$Sw_Upgrades] )
* (1 + sum{(v,szn), h_szn(h,szn) * seas_cap_frac_delta(i,v,r,szn,t)})
} / 1E6
+ sum{v$[psh(i)$valinv(i,v,r,t)], WATCAP.l(i,v,r,t)} ;
watcap_new_ivrt(i,v,r,t)$[valcap(i,v,r,t)$i_water_cooling(i)] =
sum{h$h_rep(h),
hours(h)
* sum{w$[i_w(i,w)],
water_rate(i,w,r) }
* ( [INV.l(i,v,r,t) + INV_REFURB.l(i,v,r,t)]$valinv(i,v,r,t)
+ [(1-upgrade_derate(i,v,r,t)) * (UPGRADES.l(i,v,r,t) - UPGRADES_RETIRE.l(i,v,r,t))]$[upgrade(i)$valcap(i,v,r,t)$Sw_Upgrades] )
* (1 + sum{szn, h_szn(h,szn) * seas_cap_frac_delta(i,v,r,szn,t)})
} / 1E6
+ WATCAP.l(i,v,r,t)$psh(i) ;
watcap_new_ann_out(i,v,r,t)$watcap_new_ivrt(i,v,r,t) = watcap_new_ivrt(i,v,r,t) / (yeart(t) - sum(tt$tprev(t,tt), yeart(tt))) ;
* --- Water Capacity Retirements ---*
watret_out(i,r,t)$[(not tfirst(t))] = sum{tt$tprev(t,tt), watcap_out(i,r,tt)} - watcap_out(i,r,t) + watcap_new_out(i,r,t) ;
watret_out(i,r,t)$[abs(watret_out(i,r,t)) < 1e-6] = 0 ;
watret_ivrt(i,v,r,t)$[(not tfirst(t))] = sum{tt$tprev(t,tt), watcap_ivrt(i,v,r,tt)} - watcap_ivrt(i,v,r,t) + watcap_new_ivrt(i,v,r,t) ;
watret_ivrt(i,v,r,t)$[(abs(watret_ivrt(i,v,r,t)) < 1e-6)] = 0 ;
watret_ann_out(i,v,r,t)$watret_ivrt(i,v,r,t) = watret_ivrt(i,v,r,t) / (yeart(t) - sum{tt$tprev(t,tt), yeart(tt) }) ;
*=========================
* Operating Reserves
*=========================
opres_supply_h(ortype,i,r,h,t)$[tmodel_new(t)$reserve_frac(i,ortype)] =
sum{v, OPRES.l(ortype,i,v,r,h,t) } ;
opres_supply(ortype,i,r,t)$[tmodel_new(t)$reserve_frac(i,ortype)] =
sum{h, hours(h) * opRes_supply_h(ortype,i,r,h,t) } ;
* total opres trade
opres_trade(ortype,r,rr,t)$[opres_routes(r,rr,t)$tmodel_new(t)] =
sum{h, hours(h) * OPRES_FLOW.l(ortype,r,rr,h,t) } ;
*=========================
* LOSSES AND CURTAILMENT
*=========================
gen_new_uncurt(i,r,h,t)$[(vre(i) or storage_hybrid(i)$(not csp(i)))$valcap_irt(i,r,t)] =
sum{v$valinv(i,v,r,t), (INV.l(i,v,r,t) + INV_REFURB.l(i,v,r,t)) * m_cf(i,v,r,h,t) * hours(h) }
;
* Formulation follows eq_curt_gen_balance(r,h,t); since it uses =g= there may be extra curtailment
* beyond CURT.l(r,h,t) so we recalculate as (availability - generation - operating reserves)
curt_h(r,h,t)$tmodel_new(t) =
sum{(i,v)$[valcap(i,v,r,t)$(vre(i) or storage_hybrid(i)$(not csp(i)))],
m_cf(i,v,r,h,t) * CAP.l(i,v,r,t) }
- sum{(i,v)$[valgen(i,v,r,t)$vre(i)], GEN.l(i,v,r,h,t) }
- sum{(i,v)$[valgen(i,v,r,t)$storage_hybrid(i)$(not csp(i))], GEN_PLANT.l(i,v,r,h,t) }$Sw_HybridPlant
- sum{(ortype,i,v)$[Sw_OpRes$opres_h(h)$reserve_frac(i,ortype)$valgen(i,v,r,t)$vre(i)],
OPRES.l(ortype,i,v,r,h,t) }
;
curt_ann(r,t)$tmodel_new(t) = sum{h, curt_h(r,h,t) * hours(h) } ;
curt_tech(i,r,t)$[tmodel_new(t)$vre(i)] =
sum{(v,h)$valcap(i,v,r,t),
m_cf(i,v,r,h,t) * CAP.l(i,v,r,t) * hours(h) }
- sum{(v,h)$valgen(i,v,r,t),
GEN.l(i,v,r,h,t) * hours(h) }
- sum{(ortype,v,h)$[Sw_OpRes$opres_h(h)$reserve_frac(i,ortype)$valgen(i,v,r,t)],
OPRES.l(ortype,i,v,r,h,t) * hours(h) }
;
curt_rate_tech(i,r,t)$[tmodel_new(t)$vre(i)$(gen_ann(i,r,t) + curt_tech(i,r,t))] =
curt_tech(i,r,t) / (gen_ann(i,r,t) + curt_tech(i,r,t))
;
curt_rate(t)
$[tmodel_new(t)
$(sum{(i,r)$[vre(i) or storage_hybrid(i)$(not csp(i))], gen_ann(i,r,t) } + sum{r, curt_ann(r,t) })]
= sum{r, curt_ann(r,t) }
/ (sum{(i,r)$[vre(i) or storage_hybrid(i)$(not csp(i))], gen_ann(i,r,t) } + sum{r, curt_ann(r,t) }) ;
losses_ann('storage',t)$tmodel_new(t) = sum{(i,v,r,h)$[valcap(i,v,r,t)$storage_standalone(i)], STORAGE_IN.l(i,v,r,h,t) * hours(h) }
- sum{(i,v,r,h)$[valcap(i,v,r,t)$storage_standalone(i)], GEN.l(i,v,r,h,t) * hours(h) } ;
losses_ann('trans',t)$tmodel_new(t) =
sum{(rr,r,h,trtype)$routes(rr,r,trtype,t),
(tranloss(rr,r,trtype) * FLOW.l(rr,r,h,t,trtype) * hours(h)) } ;
losses_ann('curt',t)$tmodel_new(t) = sum{r, curt_ann(r,t) } ;
losses_ann('load',t)$tmodel_new(t) = sum{(r,h), LOAD.l(r,h,t) * hours(h) } ;
losses_tran_h(rr,r,h,trtype,t)$[routes(r,rr,trtype,t)$tmodel_new(t)]
= tranloss(rr,r,trtype) * FLOW.l(rr,r,h,t,trtype) ;
*=========================
* CAPACTIY
*=========================
cap_deg_ivrt(i,v,r,t)$valcap(i,v,r,t) = CAP.l(i,v,r,t) / ilr(i) ;
cap_ivrt(i,v,r,t)$[(not (upv(i) or dupv(i) or wind(i)))$valcap(i,v,r,t)] = cap_deg_ivrt(i,v,r,t) ;
*upv, dupv, and wind have degradation, so use INV rather than CAP to get the reported capacity
cap_ivrt(i,v,r,t)$[(upv(i) or dupv(i) or wind(i))$valcap(i,v,r,t)] = (
m_capacity_exog(i,v,r,t)$tmodel_new(t)
+ sum{tt$[inv_cond(i,v,r,t,tt)$[tmodel(tt) or tfix(tt)]],
INV.l(i,v,r,tt) + INV_REFURB.l(i,v,r,tt)$[refurbtech(i)$Sw_Refurb]}) / ilr(i) ;
cap_out(i,r,t)$[valcap_irt(i,r,t)$tmodel_new(t)] = sum{v$valcap(i,v,r,t), cap_ivrt(i,v,r,t) } ;
* A small amount of upv capacity is actually csp-ns, so convert it back now.
* UPV capacity is already in MWac at this point (matching csp-ns),
* so don't need to account for ILR
cap_out("csp-ns",r,t)$[cap_cspns(r,t)$tmodel_new(t)] = cap_cspns(r,t) ;
* We have to take csp-ns capacity from somewhere, so take it from upv_6 (which all the
* csp-ns-containing regions have)
cap_out("upv_6",r,t)$[cap_cspns(r,t)$tmodel_new(t)] = cap_out("upv_6",r,t) - cap_cspns(r,t) ;
* Make sure it doesn't go negative, just in case
cap_out("upv_6",r,t)$[cap_cspns(r,t)$tmodel_new(t)$(cap_out("upv_6",r,t) < 0)] = 0 ;
* Exogenous capacity (used by reeds_to_rev)
cap_exog(i,v,r,t)$tmodel_new(t) = m_capacity_exog(i,v,r,t) ;
*=========================
* NEW CAPACITY
*=========================
cap_new_out(i,r,t)$[(not tfirst(t))$valcap_irt(i,r,t)] = [
sum{v$valinv(i,v,r,t),
INV.l(i,v,r,t) + INV_REFURB.l(i,v,r,t) }
+ sum{v$valcap(i,v,r,t),
(1 - upgrade_derate(i,v,r,t)) * (UPGRADES.l(i,v,r,t) - UPGRADES_RETIRE.l(i,v,r,t))}$[upgrade(i)$Sw_Upgrades]
] / ilr(i) ;
cap_new_out("distpv",r,t)$[valcap_irt("distpv",r,t)$(not tfirst(t))] = cap_out("distpv",r,t) - sum{tt$tprev(t,tt), cap_out("distpv",r,tt) } ;
cap_new_ann(i,r,t)$cap_new_out(i,r,t) = cap_new_out(i,r,t) / (yeart(t) - sum{tt$tprev(t,tt), yeart(tt) }) ;
cap_new_bin_out(i,v,r,t,rscbin)$[rsc_i(i)$valinv(i,v,r,t)] = INV_RSC.l(i,v,r,rscbin,t) / ilr(i) ;
cap_new_bin_out(i,v,r,t,"bin1")$[(not rsc_i(i))$valinv(i,v,r,t)] = INV.l(i,v,r,t) / ilr(i) ;
cap_new_ivrt(i,v,r,t)$[(not tfirst(t))$valcap(i,v,r,t)] = [
[INV.l(i,v,r,t) + INV_REFURB.l(i,v,r,t)]$valinv(i,v,r,t)
+ [(1-upgrade_derate(i,v,r,t)) * (UPGRADES.l(i,v,r,t) - UPGRADES_RETIRE.l(i,v,r,t))]$[upgrade(i)$valcap(i,v,r,t)$Sw_Upgrades]
] / ilr(i) ;
cap_new_ivrt("distpv",v,r,t)$[not tfirst(t)$valcap("distpv",v,r,t)] = cap_ivrt("distpv",v,r,t) - sum{tt$tprev(t,tt), cap_ivrt("distpv",v,r,tt) } ;
cap_new_ivrt_refurb(i,v,r,t)$valinv(i,v,r,t) = INV_REFURB.l(i,v,r,t) / ilr(i) ;
*** Capacity by reV site
site_spurinv(x,t)$[tmodel_new(t)$xfeas(x)] = INV_SPUR.l(x,t) ;
site_spurcap(x,t)$[tmodel_new(t)$xfeas(x)] = CAP_SPUR.l(x,t) ;
site_cap(i,x,t)$[tmodel_new(t)$sum{(r,rscbin), spurline_sitemap(i,r,rscbin,x)}] =
sum{(v,r,rscbin,tt)
$[spurline_sitemap(i,r,rscbin,x)
$cap_new_bin_out(i,v,r,tt,rscbin)
$(yeart(tt) <= yeart(t))],
* Multiply by ILR to get DC capacity for PV
cap_new_bin_out(i,v,r,tt,rscbin) * ilr(i)
} ;
site_gir(i,x,t)$[site_cap(i,x,t)$site_spurcap(x,t)] = site_cap(i,x,t) / site_spurcap(x,t) ;
site_pv_fraction(x,t)$sum{i$spur_techs(i), site_cap(i,x,t)} =
sum{i$upv(i), site_cap(i,x,t)} / (sum{i$spur_techs(i), site_cap(i,x,t)}) ;
site_hybridization(x,t)$site_pv_fraction(x,t) = abs(1 - 2 * abs(site_pv_fraction(x,t) - 0.5)) ;
*=========================
* AVAILABLE CAPACITY
*=========================
cap_avail(i,r,t,rscbin)$[tmodel_new(t)$rsc_i(i)$m_rscfeas(r,i,rscbin)$m_rsc_con(r,i)] =
m_rsc_dat(r,i,rscbin,"cap")
+ hyd_add_upg_cap(r,i,rscbin,t)$(Sw_HydroCapEnerUpgradeType=1)
+ rsc_dr(i,r,"cap",rscbin,t)
+ rsc_evmc(i,r,"cap",rscbin,t)
- (
sum{(ii,v,tt)$[valinv(ii,v,r,tt)$(yeart(tt) < yeart(t))$rsc_agg(i,ii)$(not dr(i))],
INV_RSC.l(ii,v,r,rscbin,tt) * resourcescaler(ii) }
+ sum{(ii,v,tt)$[tfirst(tt)$rsc_agg(i,ii)$(not dr(i))$exog_rsc(i)],
capacity_exog_rsc(ii,v,r,rscbin,tt) }
);
capacity_offline(i,r,allh,t)
$[valcap_irt(i,r,t)$tmodel_new(t)$(h_stress_t(allh,t) or h_rep(allh))] =
cap_out(i,r,t) * (1 - avail(i,r,allh)) ;
forced_outage(i) = sum{(r,h), forcedoutage_h(i,r,h) * hours(h) } / sum{(r,h), hours(h) } ;
*=========================
* UPGRADED CAPACITY
*=========================
cap_upgrade(i,r,t)$[upgrade(i)$valcap_irt(i,r,t)] = sum{v, (1-upgrade_derate(i,v,r,t)) * UPGRADES.l(i,v,r,t) } ;
cap_upgrade_ivrt(i,v,r,t)$[valcap(i,v,r,t)$upgrade(i)$Sw_Upgrades] = (1-upgrade_derate(i,v,r,t)) * UPGRADES.l(i,v,r,t) ;
*=========================
* RETIRED CAPACITY
*=========================
ret_ivrt(i,v,r,t)$[(not tfirst(t))] =
sum{tt$tprev(t,tt), cap_ivrt(i,v,r,tt) } - cap_ivrt(i,v,r,t) + cap_new_ivrt(i,v,r,t)
- sum{ii$upgrade_from(ii,i), UPGRADES.l(ii,v,r,t) } ;
ret_ivrt(i,v,r,t)$[abs(ret_ivrt(i,v,r,t)) < 1e-6] = 0 ;
ret_out(i,r,t)$[(not tfirst(t))] = sum{v, ret_ivrt(i,v,r,t) } ;
ret_out(i,r,t)$[abs(ret_out(i,r,t)) < 1e-6] = 0 ;
ret_ann(i,r,t)$ret_out(i,r,t) = ret_out(i,r,t) / (yeart(t) - sum{tt$tprev(t,tt), yeart(tt) }) ;
*==================================
* BINNED STORAGE CAPACITY
*==================================
cap_sdbin_out(i,r,ccseason,sdbin,t)$valcap_irt(i,r,t) = sum{v, CAP_SDBIN.l(i,v,r,ccseason,sdbin,t)} ;
* energy capacity of storage
stor_energy_cap(i,v,r,t)$[tmodel_new(t)$valcap(i,v,r,t)] =
storage_duration(i) * CAP.l(i,v,r,t) * (1$CSP_Storage(i) + 1$psh(i) + bcr(i)$[battery(i) or storage_hybrid(i)$(not csp(i))]) ;
*==================================
* CAPACITY CREDIT AND FIRM CAPACITY
*==================================
cc_all_out(i,v,r,ccseason,t)$tmodel_new(t) =
cc_int(i,v,r,ccseason,t)$[(vre(i) or csp(i) or storage(i) or storage_hybrid(i)$(not csp(i)))$valcap(i,v,r,t)] +
m_cc_mar(i,r,ccseason,t)$[(vre(i) or csp(i) or storage(i) or storage_hybrid(i)$(not csp(i)))$valinv_init(i,v,r,t)]+
m_cc_dr(i,r,ccseason,t)$[demand_flex(i)$valinv_init(i,v,r,t)]
;
cap_new_cc(i,r,ccseason,t)$[(vre(i) or storage(i) or storage_hybrid(i)$(not csp(i)))$valcap_irt(i,r,t)] = sum{v$ivt(i,v,t),cap_new_ivrt(i,v,r,t) } ;
cc_new(i,r,ccseason,t)$[valcap_irt(i,r,t)$cap_new_cc(i,r,ccseason,t)] = sum{v$ivt(i,v,t), cc_all_out(i,v,r,ccseason,t) } ;
cap_firm(i,r,ccseason,t)$[valcap_irt(i,r,t)$[not consume(i)]$tmodel_new(t)] =
sum{v$[(not vre(i))$(not hydro(i))$(not storage(i))$(not storage_hybrid(i)$(not csp(i)))$(not demand_flex(i))$valcap(i,v,r,t)],
CAP.l(i,v,r,t) * (1 + ccseason_cap_frac_delta(i,v,r,ccseason,t)) }
+ cc_old(i,r,ccseason,t)
+ sum{v$[(vre(i) or csp(i) or storage_hybrid(i)$(not csp(i)))$valinv(i,v,r,t)],
m_cc_mar(i,r,ccseason,t) * (INV.l(i,v,r,t) + INV_REFURB.l(i,v,r,t)$[refurbtech(i)$Sw_Refurb]) }
+ sum{v$[(vre(i) or csp(i) or storage_hybrid(i)$(not csp(i)))$valcap(i,v,r,t)],
cc_int(i,v,r,ccseason,t) * CAP.l(i,v,r,t) }
+ sum{v$demand_flex(i),
m_cc_dr(i,r,ccseason,t) * CAP.l(i,v,r,t) }
+ cc_excess(i,r,ccseason,t)$[(vre(i) or csp(i) or storage_hybrid(i)$(not csp(i)))]
+ sum{(v,h)$[hydro_nd(i)$valgen(i,v,r,t)$h_ccseason_prm(h,ccseason)],
GEN.l(i,v,r,h,t) }
+ sum{v$[hydro_d(i)$valcap(i,v,r,t)],
CAP.l(i,v,r,t) * cap_hyd_ccseason_adj(i,ccseason,r) * (1 + hydro_capcredit_delta(i,t)) }
+ sum{(v,sdbin)$[valcap(i,v,r,t)$(storage_standalone(i) or hyd_add_pump(i))], CAP_SDBIN.l(i,v,r,ccseason,sdbin,t) * cc_storage(i,sdbin) }
+ sum{(v,sdbin)$[valcap(i,v,r,t)$storage_hybrid(i)], CAP_SDBIN.l(i,v,r,ccseason,sdbin,t) * cc_storage(i,sdbin) * hybrid_cc_derate(i,r,ccseason,sdbin,t) } ;
* Capacity trading to meet PRM
captrade(r,rr,trtype,ccseason,t)$[routes(r,rr,trtype,t)$routes_prm(r,rr)$tmodel_new(t)] = PRMTRADE.l(r,rr,trtype,ccseason,t) ;
*========================================
* REVENUE LEVELS
*========================================
revenue('load',i,r,t)$valgen_irt(i,r,t) = sum{(v,h)$valgen(i,v,r,t),
GEN.l(i,v,r,h,t) * hours(h) * reqt_price('load','na',r,h,t) } ;
*revenue from storage charging (storage charging from curtailment recovery does not have a cost)
revenue('charge',i,r,t)$[storage_standalone(i)$valgen_irt(i,r,t)] = - sum{(v,h)$valgen(i,v,r,t),
STORAGE_IN.l(i,v,r,h,t) * hours(h) * reqt_price('load','na',r,h,t) } ;
revenue('res_marg',i,r,t)$[valgen_irt(i,r,t)$Sw_PRM_CapCredit] = sum{ccseason,
cap_firm(i,r,ccseason,t) * reqt_price('res_marg','na',r,ccseason,t) } ;
revenue('res_marg',i,r,t)$[valgen_irt(i,r,t)$(Sw_PRM_CapCredit=0)] = sum{allh$h_stress_t(allh,t),
gen_h_stress(i,r,allh,t) * reqt_price('res_marg','na',r,allh,t) } ;
revenue('oper_res',i,r,t)$valgen_irt(i,r,t) = sum{(ortype,v,h)$valgen(i,v,r,t),
OPRES.l(ortype,i,v,r,h,t) * hours(h) * reqt_price('oper_res',ortype,r,h,t) } ;
revenue('rps',i,r,t)$valgen_irt(i,r,t) =
sum{(v,h,RPSCat)$[valgen(i,v,r,t)$sum{st$r_st(r,st), RecTech(RPSCat,i,st,t) }],
GEN.l(i,v,r,h,t) * sum{st$r_st(r,st), RPSTechMult(RPSCat,i,st) } * hours(h) * reqt_price('state_rps',RPSCat,r,'ann',t) } ;
revenue_nat(rev_cat,i,t)$tmodel_new(t) = sum{r, revenue(rev_cat,i,r,t) } ;
revenue_en(rev_cat,i,r,t)
$[tmodel_new(t)
$sum{(v,h)$valgen(i,v,r,t), GEN.l(i,v,r,h,t) * hours(h) }
$[not vre(i)]] =
revenue(rev_cat,i,r,t) / sum{(v,h)$valgen(i,v,r,t), GEN.l(i,v,r,h,t) * hours(h) } ;
revenue_en(rev_cat,i,r,t)$[tmodel_new(t)$sum{(v,h)$[valcap(i,v,r,t)], m_cf(i,v,r,h,t) * CAP.l(i,v,r,t) }$vre(i)] =
revenue(rev_cat,i,r,t) / sum{(v,h)$valcap(i,v,r,t),
m_cf(i,v,r,h,t) * CAP.l(i,v,r,t) * hours(h) } ;
revenue_en_nat(rev_cat,i,t)
$[tmodel_new(t)
$sum{(v,r,h)$valgen(i,v,r,t), GEN.l(i,v,r,h,t) * hours(h) }] =
revenue_nat(rev_cat,i,t) / sum{(v,r,h)$valgen(i,v,r,t), GEN.l(i,v,r,h,t) * hours(h) } ;
revenue_cap(rev_cat,i,r,t)$[tmodel_new(t)$cap_out(i,r,t)] =
revenue(rev_cat,i,r,t) / cap_out(i,r,t) ;
revenue_cap_nat(rev_cat,i,t)$[tmodel_new(t)$sum{r$valcap_irt(i,r,t), cap_out(i,r,t) }] =
revenue_nat(rev_cat,i,t) / sum{r$valcap_irt(i,r,t), cap_out(i,r,t) } ;
gen_ann_nat(i,t)$tmodel_new(t) = sum{r, gen_ann(i,r,t) } ;
*========================================
* Value (Revenue) of new builds
*========================================
valnew('MW',i,r,t)$[(not tfirst(t))$valcap_irt(i,r,t)] =
sum{v$valinv(i,v,r,t), INV.l(i,v,r,t) + INV_REFURB.l(i,v,r,t) } / ilr(i) ;
valnew('inv_cap_ratio',i,r,t)$[valnew('MW',i,r,t)] =
sum{v$[valinv(i,v,r,t)$CAP.l(i,v,r,t)], (INV.l(i,v,r,t) + INV_REFURB.l(i,v,r,t))
/ CAP.l(i,v,r,t) } ;
valnew('MWh',i,r,t)$[valnew('MW',i,r,t)] =
sum{v$valinv(i,v,r,t), gen_ivrt(i,v,r,t)} * valnew('inv_cap_ratio',i,r,t) ;
* Use uncurtailed energy for VRE
valnew('MWh',i,r,t)$[valnew('MW',i,r,t)$sum{v$valinv(i,v,r,t), gen_ivrt_uncurt(i,v,r,t)}] =
sum{v$valinv(i,v,r,t), gen_ivrt_uncurt(i,v,r,t)} * valnew('inv_cap_ratio',i,r,t) ;
valnew('MWh','benchmark',r,t)$tmodel_new(t) = sum{h, reqt_quant('load','na',r,h,t)} ;
valnew('MWh','benchmark','sys',t)$tmodel_new(t) = sum{(r,h), reqt_quant('load','na',r,h,t)} ;
valnew('MW','benchmark',r,t)$tmodel_new(t) = reqt_quant('res_marg_ann','na',r,'ann',t) ;
valnew('MW','benchmark','sys',t)$tmodel_new(t) = sum{r, reqt_quant('res_marg_ann','na',r,'ann',t)} ;
valnew('val_load',i,r,t)$valnew('MW',i,r,t) = sum{(v,h)$valinv(i,v,r,t),
(GEN.l(i,v,r,h,t) - STORAGE_IN.l(i,v,r,h,t)$[storage_standalone(i) or hyd_add_pump(i)])
* hours(h) * reqt_price('load','na',r,h,t) } * valnew('inv_cap_ratio',i,r,t) ;
*'val_load_sys' is the val our tech would have if valued at the system-average load price profile.
valnew('val_load_sys',i,r,t)$valnew('MW',i,r,t) = sum{(v,h)$valinv(i,v,r,t),
(GEN.l(i,v,r,h,t) - STORAGE_IN.l(i,v,r,h,t)$[storage_standalone(i) or hyd_add_pump(i)])
* hours(h) * reqt_price_sys('load','na',h,t) } * valnew('inv_cap_ratio',i,r,t) ;
*Annual-average price at each r:
valnew('val_load','benchmark',r,t)$tmodel_new(t) =
sum{h, reqt_price('load','na',r,h,t) * reqt_quant('load','na',r,h,t)} ;
*Annual-average price of the system
valnew('val_load','benchmark','sys',t)$tmodel_new(t) =
sum{(r,h), reqt_price('load','na',r,h,t) * reqt_quant('load','na',r,h,t)} ;
valnew('val_resmarg',i,r,t)$[(Sw_PRM_CapCredit=0)$valnew('MW',i,r,t)] =
sum{(v,allh)$[h_stress_t(allh,t)$valinv(i,v,r,t)],
(GEN.l(i,v,r,allh,t) - STORAGE_IN.l(i,v,r,allh,t)$[storage_standalone(i) or hyd_add_pump(i)])
* reqt_price('res_marg','na',r,allh,t)} * valnew('inv_cap_ratio',i,r,t) ;
* New VRE for the CapCredit formulation is a special case in that new is distinct from old of the same vintage
valnew('val_resmarg',i,r,t)$[(Sw_PRM_CapCredit=1)$vre(i)$valnew('MW',i,r,t)] =
sum{ccseason, m_cc_mar(i,r,ccseason,t) * valnew('MW',i,r,t) * reqt_price('res_marg','na',r,ccseason,t)};
valnew('val_resmarg_sys',i,r,t)$[(Sw_PRM_CapCredit=0)$valnew('MW',i,r,t)] =
sum{(v,allh)$[h_stress_t(allh,t)$valinv(i,v,r,t)],
(GEN.l(i,v,r,allh,t) - STORAGE_IN.l(i,v,r,allh,t)$[storage_standalone(i) or hyd_add_pump(i)])
* reqt_price_sys('res_marg','na',allh,t)} * valnew('inv_cap_ratio',i,r,t) ;