Some questions about different kinds of datas in modules in SWITCH 2.0 model

26 views
Skip to first unread message

Chen Wang

unread,
Jul 16, 2023, 11:27:18 PM7/16/23
to Switch Model
Dear  Dr. Matthias Fripp and other members for constructing SWITCH, 
I am a postgraduate named Wang Chen who has had the question about the dispatch order in SWITCH 2.0, and Dr. Matthias and Dr. Josiah have given several practical and clear answers and advice. Thank you so much for your attention and contribution! Now, I have already studied the codes of about 10 core modules of SWITCH 2.0, and I am trying to search for relevant datas to find the transition path for the China's power sector with the minimum cost by using these 10 modules. During this process, I have some questions about different kinds of datas in modules. Here are as follows:

1. The first question is about timeseries. From your tutorial and codes explanation, I have known that we should define different kinds of timeseries for our study and each of them will have the weight(Ts_scale_to_period) in their period. In the "timeseries.csv" input file, I want to know if all the timeseries I have defined in each period are sequential. For example, as you see in the following figure, “2020_01winter” is in the first row and "2020_06summer" is in the second row. Would it make a difference to the final result if their positions in the figure were switched? 
微信图片_20230717100741.png

2.The second question is about zone_demand. From the "load.csv" input file in your SWITCH examples, I have seen that each zone in each timepoint will have a special power demand. As we know, the timepoint may occurs many times in one period according to its weight, and it may represent the same time in different years within one period. For example, if I define a timeseries A to represent a median load day of January for all the years in one period , and I also define a timepoint B in the timeseries A to represent the load profile at 6:00 of that median load day. So, when I give the power demand to the timepoint B, does it mean that in all the years of that period, the power demand at 6:00 of the median load day of January will not change and be the same? In orther words, when we give the power demand for one timepoint, if this timepoint will occur in the different years of one period, does it mean that the power demand of this timepoint in different years will be same?

3.The third question is about the carbon_policies module. From the "carbon_polices" input file in your SWITCH examples, I have seen that for each period, it has a certain carbon emission cap for each year.  I would like to know if the carbon emission cap for each year can be further specified in the input document. This is because the carbon cap may be different for each year in a given period. In the present "carbon_polices" input file, for one period, the carbon emission cap for each year will be the same and could not be changed.

These are all the questions what I want to ask. I am sorry that there are a lot of questions and my expression may not be clear to understand. Thank you so much for your attention and contribution again! I am looking forward to your reply! Good luck! Best wishes!

WangChen

Matthias Fripp

unread,
Jul 16, 2023, 11:55:23 PM7/16/23
to switch...@googlegroups.com
Hi Chen Wang,

I am glad you are making progress with Switch! Here are answers to your questions.
  1. The timeseries are generally treated as not following any particular sequence, so you can put them in the file in any order you want, and it won't change the outcome. (However some specialized modules such as the hydro ones may add extra data to group the timeseries or treat them sequentially.)
  2. Switch doesn't have any idea of particular dates or sampling methods other than the timeseries and timepoints you define. If you give it a timeseries with ts_scale_to_period = 25, then it will model that timeseries once and give it a weight as if it occurred 25 times in the period. Usually the best way to think about this is that you are giving some normal days with high weights and some unusual days with low weights, so collectively they represent the whole range of conditions that may occur. This produces a plan that is optimized for the whole range of conditions, but without needing to repeat the common days over and over (which would use a lot of processor time and memory). But Switch doesn't know that one day is January and a different one is February, or that one is median and one is peak -- it just knows these are some conditions that may occur, and makes a plan that will work on those days. The user can keep track of which days each timeseries represents on the calendar, and include that in their own discussions of how they prepared the data and how they interpret the results. But that isn't known or used by Switch.
  3. Switch chooses what to build at the start of each investment period, and simulates how these resources will be used on a limited number of sample days (timeseries) during that period. In this framework, policies are assumed to be the same during all timeseries in the same period, since Switch doesn't model each year in the period separately. So the easiest solution to your problem is probably to have separate investment periods for each year when you want to represent a different policy. But if the model gets too large, then you will just have to work with the intermediate steps, e.g., make a plan that works well in 2025, 2030, 2035, etc., and then assume you can fill in between later.
I hope this helps. Please let me know if you have any questions. 

Matthias

From: switch...@googlegroups.com <switch...@googlegroups.com> on behalf of Chen Wang <wangche...@163.com>
Sent: Sunday, July 16, 2023 8:27 PM
To: Switch Model <switch...@googlegroups.com>
Subject: [EXTERNAL] [switch-model] Some questions about different kinds of datas in modules in SWITCH 2.0 model
 
--
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/6b07e085-1d71-461b-bbb3-895dbbbb4ed1n%40googlegroups.com.

Chen Wang

unread,
Jul 17, 2023, 9:45:30 AM7/17/23
to Switch Model
Dear Dr. Matthias,

Thank you so much for your reply! It' so quick! And I have gotten your advice so clearly and your advice is so useful and helpful! Thank you! One more thing has happened when your told me that maybe the hydro module needs to group the timeseries. Today, I have studied the hydro_simple module quickly and I have gotten that in that module, there are two constriants about the minimum flow level and average flow level. Since I am a freshman in using the SWITCH 2.0 model, could I not define the minimum flow level and average flow level for the hydro projects, and consider the hydro projects as a general generation project like coal, wind and PV for use only in the generators.core.build module, thus not using the hydro module? I have seen that in your example of hydro_simple module, the information of hydro projects has also been listed in the gen_info.csv input file, but the modules. txt has the hydro_simple module. I have already tried to erase it in the modules and SWITCH solver has operated successfully and has given me the different result about the total cost. But I am still not sure if this way is right. So please give me your instruction and I will be appreciated about that! Thank you so much again! Best wishes!

Wang Chen

Matthias Fripp

unread,
Jul 17, 2023, 8:55:43 PM7/17/23
to switch...@googlegroups.com

Hi Wang Chen,

 

There are a few ways you can represent hydro projects with Switch. For all of them, you would put a row in gen_info.csv for each hydroelectric project and you would specify an energy source (e.g., “hydro” or “water”) that is also listed in non_fuel_energy_sources.csv. But then you probably want to provide extra information.

 

  1. If you just provide the information listed above, Switch will assume it can run the hydro generator whenever it wants up to 100% of its rated capacity at no cost. If you have a large enough reservoir and it can run all the time, then maybe this is OK. (This is the example you asked about.)
  2. For run-of-river hydro (or maybe reservoir hydro with lots of water but strict flow limits), you could add data to variable_capacity_factors.csv to show the maximum power that the generator could produce every timepoint. This would reflect limits on the amount of power the project can produce, based on the amount of water flowing in the stream during each timepoint.
  3. If you want a simple treatment of hydro reservoirs, you would probably not put data in variable_capacity_factors.csv. Instead, you would add switch_model.generators.extensions.hydro_simple to modules.txt (to turn on this module), then provide the data needed by this module in hydro_timeseries.csv. This lets you group timepoints together into different blocks of time. Then, for each block of time, you can specify a minimum flow rate and an average flow rate (both expressed in MW). Switch will then schedule hydro production so that the average in that block matches the required average and the flow never goes below the specified minimum. This can be useful, for example, for dams where you know the total production for a month (based on rainfall upstream), and you need to allow some water to flow at all times for the plants and animals in the stream. There is an example of this at https://github.com/switch-model/switch/tree/master/examples/hydro_simple.
  4. If you want to model more complex hydro systems, e.g., a collection of reservoirs and streams that are connected together, you would use switch_model.generators.extensions.hydro_system instead of switch_model.generators.extensions.hydro_simple. Then you need to provide information about the hydro network in water_nodes.csv, reservoirs.csv, water_connections.csv, hydro_generation_projects.csv, water_node_tp_flows.csv, reservoir_tp_data.csv (optional), min_eco_flows.csv (optional) and spillage_penalty.csv (optional). There is an example of this at https://github.com/switch-model/switch/tree/master/examples/hydro_system

 

I hope this helps. Let me know if you have more questions.

 

Matthias

 

Matthias Fripp, Ph.D. (he/him/his)

Assoc. VP, Modeling, Mapping and Analytics

Environmental Defense Fund

+1-808-348-9586 (mobile)
mfr...@edf.org

 

 

From: switch...@googlegroups.com <switch...@googlegroups.com> on behalf of Chen Wang <wangche...@163.com>
Date: Monday, July 17, 2023 at 6:45 AM
To: Switch Model <switch...@googlegroups.com>
Subject: Re: [EXTERNAL] [switch-model] Some questions about different kinds of datas in modules in SWITCH 2.0 model

Dear Dr. Matthias,

 

Thank you so much for your reply! It' so quick! And I have gotten your advice so clearly and your advice is so useful and helpful! Thank you! One more thing has happened when your told me that maybe the hydro module needs to group the timeseries. Today, I have studied the hydro_simple module quickly and I have gotten that in that module, there are two constriants about the minimum flow level and average flow level. Since I am a freshman in using the SWITCH 2.0 model, could I not define the minimum flow level and average flow level for the hydro projects, and consider the hydro projects as a general generation project like coal, wind and PV for use only in the generators.core.build module, thus not using the hydro module? I have seen that in your example of hydro_simple module, the information of hydro projects has also been listed in the gen_info.csv input file, but the modules. txt has the hydro_simple module. I have already tried to erase it in the modules and SWITCH solver has operated successfully and has given me the different result about the total cost. But I am still not sure if this way is right. So please give me your instruction and I will be appreciated about that! Thank you so much again! Best wishes!

 

Wang Chen

2023717日星期一 UTC+8 11:55:23<Matthias Fripp> 写道:

Hi Chen Wang,

 

I am glad you are making progress with Switch! Here are answers to your questions.

  1. The timeseries are generally treated as not following any particular sequence, so you can put them in the file in any order you want, and it won't change the outcome. (However some specialized modules such as the hydro ones may add extra data to group the timeseries or treat them sequentially.)
  2. Switch doesn't have any idea of particular dates or sampling methods other than the timeseries and timepoints you define. If you give it a timeseries with ts_scale_to_period = 25, then it will model that timeseries once and give it a weight as if it occurred 25 times in the period. Usually the best way to think about this is that you are giving some normal days with high weights and some unusual days with low weights, so collectively they represent the whole range of conditions that may occur. This produces a plan that is optimized for the whole range of conditions, but without needing to repeat the common days over and over (which would use a lot of processor time and memory). But Switch doesn't know that one day is January and a different one is February, or that one is median and one is peak -- it just knows these are some conditions that may occur, and makes a plan that will work on those days. The user can keep track of which days each timeseries represents on the calendar, and include that in their own discussions of how they prepared the data and how they interpret the results. But that isn't known or used by Switch.
  3. Switch chooses what to build at the start of each investment period, and simulates how these resources will be used on a limited number of sample days (timeseries) during that period. In this framework, policies are assumed to be the same during all timeseries in the same period, since Switch doesn't model each year in the period separately. So the easiest solution to your problem is probably to have separate investment periods for each year when you want to represent a different policy. But if the model gets too large, then you will just have to work with the intermediate steps, e.g., make a plan that works well in 2025, 2030, 2035, etc., and then assume you can fill in between later.

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

 

Matthias


From: switch...@googlegroups.com <switch...@googlegroups.com> on behalf of Chen Wang <wangche...@163.com>
Sent: Sunday, July 16, 2023 8:27 PM
To: Switch Model <switch...@googlegroups.com>
Subject: [EXTERNAL] [switch-model] Some questions about different kinds of datas in modules in SWITCH 2.0 model

 

Dear  Dr. Matthias Fripp and other members for constructing SWITCH, 

I am a postgraduate named Wang Chen who has had the question about the dispatch order in SWITCH 2.0, and Dr. Matthias and Dr. Josiah have given several practical and clear answers and advice. Thank you so much for your attention and contribution! Now, I have already studied the codes of about 10 core modules of SWITCH 2.0, and I am trying to search for relevant datas to find the transition path for the China's power sector with the minimum cost by using these 10 modules. During this process, I have some questions about different kinds of datas in modules. Here are as follows:

 

1. The first question is about timeseries. From your tutorial and codes explanation, I have known that we should define different kinds of timeseries for our study and each of them will have the weight(Ts_scale_to_period) in their period. In the "timeseries.csv" input file, I want to know if all the timeseries I have defined in each period are sequential. For example, as you see in the following figure, “2020_01winter” is in the first row and "2020_06summer" is in the second row. Would it make a difference to the final result if their positions in the figure were switched? 

 

2.The second question is about zone_demand. From the "load.csv" input file in your SWITCH examples, I have seen that each zone in each timepoint will have a special power demand. As we know, the timepoint may occurs many times in one period according to its weight, and it may represent the same time in different years within one period. For example, if I define a timeseries A to represent a median load day of January for all the years in one period , and I also define a timepoint B in the timeseries A to represent the load profile at 6:00 of that median load day. So, when I give the power demand to the timepoint B, does it mean that in all the years of that period, the power demand at 6:00 of the median load day of January will not change and be the same? In orther words, when we give the power demand for one timepoint, if this timepoint will occur in the different years of one period, does it mean that the power demand of this timepoint in different years will be same?

 

3.The third question is about the carbon_policies module. From the "carbon_polices" input file in your SWITCH examples, I have seen that for each period, it has a certain carbon emission cap for each year.  I would like to know if the carbon emission cap for each year can be further specified in the input document. This is because the carbon cap may be different for each year in a given period. In the present "carbon_polices" input file, for one period, the carbon emission cap for each year will be the same and could not be changed.

 

These are all the questions what I want to ask. I am sorry that there are a lot of questions and my expression may not be clear to understand. Thank you so much for your attention and contribution again! I am looking forward to your reply! Good luck! Best wishes!

 

WangChen

--
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/6b07e085-1d71-461b-bbb3-895dbbbb4ed1n%40googlegroups.com.

--
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.

Chen Wang

unread,
Jul 17, 2023, 9:29:38 PM7/17/23
to Switch Model
Dear Dr. Matthias,

Thank you so much for your instructions in detail! It is very clear and useful. I have known how to tackle with the hydro project in my study. Thank you so much again! Best Wishes! Have a nice day!

Wang Chen
Reply all
Reply to author
Forward
0 new messages