A question about dispatch order in SWITCH 2.0 model

47 views
Skip to first unread message

Chen Wang

unread,
Jul 6, 2023, 12:15:07 AM7/6/23
to Switch Model
Dear  Dr. Matthias Fripp and other member for constructing SWITCH, 
         I am a postgraduate named Wang Chen whose major is in the green and low-carbon transition path of the power system. I have been so interested in SWITCH model and really want to grasp it well. I have already read the tutorial files of SWITCH and now I have been studying the codes of SWITCH 2.0. Thank all of you so much for your devotion! During the process of my studying, one question which I haven't dealt with is that which module of SWITCH has regulated the dispatch order of each generation projects? I found that the paper named "Switch 2.0: A modern platform for planning high-renewable power systems"  had claimed that in the modules of "Generators", generators may be assigned a single energy source or allowed to switch optimally between fuels in order to meet targets for emissions or renewables. I interpreted that must be controlled by the codes about dispatch order in SWITCH. But unfortunately, I failed to find anything about the dispatch order in these modules of "Generators", such as generators.core.dispatch and generators.core.no commit. Therefore, could you please instruct me about this question?If you could be convenient to indicate to me which codes in which module has regulated the dispatch order of different kinds of the generation projects, I would appreciate you so much! Thank you so much for your attention and devotion again! Wish you have a nice day! Good luck!
                                                                                                  Yours sincerely,
                                                                                                      Wang Chen

Matthias Fripp

unread,
Jul 6, 2023, 12:30:15 AM7/6/23
to switch...@googlegroups.com
Hi Wang Chen,

I'm glad you're finding Switch useful. Switch is an optimization model, so the decision making is somewhat automatic and not explicitly visible. In this kind of model, you tell it the formula for calculating costs and any rules that need to be satisfied, and then the solver automatically makes decisions that will minimize the total costs while following those rules. 

In Switch, the generators.dispatch module shows the rules that have to be followed, e.g., you can only dispatch generators if they have been built (if using the no_commit module) or have been committed (if using the commit module). It also adds some cost terms to the overall cost function for the model (probably just variable O&M). 

The fuel_costs module or fuel_markets modules also define variables for the amount of fuel that is burned by each plant, and force that to be consistent with the amount of power that is produced. They also calculate the cost of that fuel and add it to the overall model cost. 

Once this is done, the solver automatically chooses values for all variables (both the dispatch variables and the construction variables) that will minimize costs while meeting all the rules (constraints).

Another way to think about this type of model: all the Params (parameters) and Sets are data provided by the user or that are calculated directly from that data. Vars (decision variables) are numbers that will be chosen by the solver, in order to minimize the Objective function (total cost) while satisfying all the Constraints in the model. The Expressions in the model are generally just calculations based on the decision variables, which can be labeled and reused as needed. 

So you won't find any code saying exactly how the decision variables will be set; instead you have to assume the solver will set them to their optimal values, among all the feasible solutions. 

I hope this helps -- let me know if you have any more questions. 

Matthias

Matthias

From: switch...@googlegroups.com <switch...@googlegroups.com> on behalf of Chen Wang <wangche...@163.com>
Sent: Wednesday, July 5, 2023 9:15:06 PM
To: Switch Model <switch...@googlegroups.com>
Subject: [EXTERNAL] [switch-model] A question about dispatch order in SWITCH 2.0 model
 
You don't often get email from wangche...@163.com. Learn why this is important
--
You received this message because you are subscribed to the Google Groups "Switch Model" group.
To unsubscribe from this group and stop receiving emails from it, send an email to switch-model...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/switch-model/8f4b2aef-5beb-44d5-a6e2-cb1338f7f66dn%40googlegroups.com.

Chen Wang

unread,
Jul 7, 2023, 6:35:04 AM7/7/23
to Switch Model
Dear Dr. Matthias Fripp,
         Thank you so much for your reply! Both from your reply and the SWITCH tutorial, I think it is clear to me that SWITCH model is an optimization model and has serveral kinds of model components such as Vars(decision variables),  Params (parameters), Expressions and Constraints, and SWITCH will automatically makes decisions that will minimize the total costs through these components. But what I want to know is that in the generators.dispatch module or any other module related to the electricity dispatch, whether there are some codes that specify the dispatch order of each generation projects? For example, maybe SWITCH 2.0 has defined a dispatch rule that non-fuel-based generators(such as renewable generators) are given priority over the fuel-based generators(such as coal-fired power plants). In the paper "SWITCH-China: A Systems Approach to Decarbonizing China’s Power System" written by Prof. Gang He who is also the member of the switch-model google groups, I have known that the model which this paper has used is SWITCH-China that is based on SWITCH, and Prof. Gang He has claimed that in this paper, he assumed an economic dispatch system given the dispatch decision rules that China’s power sector reform move toward. These dispatch decision rules were based on one China's document about electricity dispatch, named "Grid Dispatch Regulations". This document allocates authority and responsibility for dispatch, sets an organizational hierarchy, and specifies a basic process and rules governing dispatch. So I wonder in SWITCH 2.0 if there are also some similar dispatch decision rules defined by codes. Otherwise, like what you said, SWITCH 2.0 will spontaneouslly and automatically make the dispatch decision rules of each generator on the basis of satisfying the corresponding constraints, such as minimizing the total system cost, not exceeding the system's total carbon emission cap, etc. Sorry that my English is not good enough, and I hope my expression is clear to understand. Thank you so much for your attention! Good luck! Have a nice day!
                                                                                                                                                                                                                                 Yours sincerely,
                                                                                                                                                                                                                                    Wang Chen

Josiah Johnston

unread,
Jul 7, 2023, 9:25:45 AM7/7/23
to switch...@googlegroups.com
Great Q and A. 

You can also think of it like this. If the generation assets are fixed, like in a dispatch, only problem, then dispatch order will be determined by variable costs subject to constraints such as transmission, reliability, etc.
If two generators are effectively functionally equivalent (variable costs, location in network, emissions, etc), then the dispatch order will be arbitrary like a coin flip. For example, if the net work has a surplus of renewable power, in one time point of the year, then the curtailment of wind, solar or other renewable assets, will be an arbitrary choice. 
If you need to force a certain dispatch order, one hack can be to make the variable costs slightly different. This should work in theory although if your optimization problem is complex your  optimization software may encounter a numerical instabilities. 

There may be another way to adjust the model to impose dispatch order to break a tie, but I haven’t worked out that problem yet personally. The least risky way may be to have a secondary dispatch tuning step after the primary optimization where dispatch order is a pose in cases of ties. Mostly I exercise a little caution in interpreting results of dispatch in cases were dispatch order is very important. 

Just some quick thoughts from vacation, mostly transcribed from my phone. Apologies for typos.

----

Sent from a phone; please excuse brevity and typos

On Jul 7, 2023, at 5:35 AM, Chen Wang <wangche...@163.com> wrote:

Dear Dr. Matthias Fripp,

Chen Wang

unread,
Jul 8, 2023, 10:20:54 PM7/8/23
to Switch Model
Dear  Prof.  Josiah,
          Thank you so much for your reply! I think your answer is so clear about the dispatch order, and I have known that there are not some codes about the dispatch order directly in SWITCH 2.0, and the dispatch order will be automatically generate by the model itself. In these days when I have contined to study SWITCH 2.0, a new question about the model optimization approach has been emerged. The question is whether SWITCH 2.0 is an one-stage optimization model or a two-stage optimization model. As I have known about SWITCH 2.0, I think the most important Vars(decision variables) are BuildGen and Dispatch. In my opinion, the approach of one-stage optimization could be interpreted that two Vars of BuildGen and Dispatch would be optimized at the same time, and there is no sequential order of optimization and dependency between them. But the approach of two-stage optimization could be interpreted that SWITCH 2.0 would optimizes BuildGen first, and according to the optimized value of BuildGen, it would further optimizes Dispatch. This is because in the no commit module, a note about one decision variable "ActiveCapacityDruingPeriod" has said that  "ActiveCapacityDruingPeriod" should be constrained based on the amount of installed capacity each period(which I think is the decision varaible "GenCapacity"), and then DispatchUpperLimit and DispatchLowerLimit should be calculated relative to ActiveCapacityDuringPeriod. Therefore, based on this, I have guessed that maybe SWITCH 2.0 is a two-stage optimization model which will optimize the BuildGen first, and then optimize the Dispatch based on the optimized value of the BuildGen. I'm not sure if my guess is correct, so please give me your insturction on it. Thank you so much for writing back to me during your vacation! I am so appericiated to you! Good luck! Enjoy your vacation!
                                                                                                                                                                                                                                    Yours sincerely,
                                                                                                                                                                                                                                       WangChen

Josiah Johnston

unread,
Jul 8, 2023, 10:34:27 PM7/8/23
to switch...@googlegroups.com
it is a one stage optimization at the core. 
Simultaneous optimization of generation and dispatch. Is a key principle of the model to enable rapid rationale evolution of the power grid. 

In practice, I think multi stage tuning or careful interpretation is usually needed, but that is outside of the “core” IMO . 

----

Sent from a phone; please excuse brevity and typos

On Jul 8, 2023, at 7:20 PM, Chen Wang <wangche...@163.com> wrote:

Dear  Prof.  Josiah,

Chen Wang

unread,
Jul 8, 2023, 10:41:57 PM7/8/23
to Switch Model
Dear  Prof.  Josiah,
                      Thank you for your reply! But how should I interpret that note----"ActiveCapacityDruingPeriod" should be constrained based on the amount of installed capacity each period(which I think is the decision varaible "GenCapacity"), and then DispatchUpperLimit and DispatchLowerLimit should be calculated relative to ActiveCapacityDuringPeriod. Does it mean that SWITCH 2.0 will first ensure the optimized value of BuildGen, then ensure the value of ActiveCapacityDruingPeriod, next calculate the DispatchUpperLimit and DispatchLowerLimit, and finally ensure the dispatch of each generator?
                                                                                                                                                                                                 Yours sincerely,
                                                                                                                                                                                                    Wang Chen

Josiah Johnston

unread,
Jul 9, 2023, 6:48:03 PM7/9/23
to switch...@googlegroups.com
All those decision variables (build, dispatch, etc) are optimized simultaneously in a single extra-large optimization problem. This is because the value of additional capacity is dependent on how it is dispatched (among other things). You may want to re-read Matthias’s initial email more carefully for better understanding of those concepts. 


----

Sent from a phone; please excuse brevity and typos

Chen Wang

unread,
Jul 10, 2023, 11:34:35 PM7/10/23
to Switch Model
Dear Prof. Josiah,
          Thank you for your reply! I have re-read your and Matthias's former e-mails and  I think I have understood why SWITCH 2.0 is an one stage optimization model. All the variables will be optimized simultaneously within the same single extra-large optimization problem, which determines the SWITCH 2.0 is an on stage optimization model. Even though there is slight optimization sequences and dependencies for some variables(such as Dispatch and BuildGen, because you said that the value of additional capacity was dependent on how it is dispatched (among other things)), but they are all optimized under the core optimization problem. I hope my interpretation would be correct, but what's more important, I have known that SWITCH 2.0 is a one stage optimization model from your instructions. Thank you so much for your attention and instructions! Good luck! Enjoy your vacation!
                                                                                                                                                                                                                                      Yours sincerely,
                                                                                                                                                                                                                                         Wang Chen

Reply all
Reply to author
Forward
0 new messages