-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Process output data #47
Comments
@YifanLi86 how are we specifying the transmission expansion candidates? I see that we're specifying the transmission_lines.csv file; does this specify the existing the transmission capacity, the transmission expansion candidates, or both? This will relate to #49 for sure, maybe #50 as well. |
It did both the existing transmission capacity and the transmission expansion candidates. |
So the set of candidates is limited to the topology of the existing branches? Do we place any limits on how much these branches can be expanded? |
Currently we only model existing routes as candidates, we can extend it to new routes but since it is only transport model it does not make too much sense to do that. There is no limit on how much can be expanded. |
If we wanted to have a different set of new routes, distinct from the existing routes, and potentially with limited expansion, do you know if there is another file or column which is used to pass that information to Switch? If not, it seems like we could enable that by adding them into the transmission_lines.csv file with zero existing capacity, which would identify them as candidates, but wouldn't constrain them it seems. |
"If not, it seems like we could enable that by adding them into the transmission_lines.csv file with zero existing capacity," yes that is the only way to do it. No other files or columns. |
The documentation says:
but Table 9 below this paragraph does not list any parameters that could be used to limit the transmission capacity of a given line. Maybe this is something to ask about via their google group: https://groups.google.com/g/switch-model |
When we call Switch with the >>> import pickle
>>> import re
>>> with open("results.pickle", rb") as f:
... results=pickle.load(f)
>>> prog = re.compile(r"([A-z]+)\[")
>>> {prog.match(i).group(1) for i in sorted(results.solution._list[0]["Constraint"].keys())}
>>> sorted({prog.match(i).group(1) for i in sorted(results.solution._list[0]["Constraint"].keys())})
['Distributed_Energy_Balance', 'Enforce_Dispatch_Baseload_Flat', 'Enforce_Dispatch_Upper_Limit', 'Enforce_Local_TD_Capacity_Limit', 'GenFuelUseRate_Calculate', 'Max_Build_Potential', 'Maximum_DispatchTx', 'Zone_Energy_Balance']
|
@YifanLi86 I'm actively working on extracting duals from Switch results, i.e. Discussed with Daniel and there are two possibilities:
Just want to check with you @YifanLi86 to see whether you could confirm this before I google it. |
@BainanXia I think the unit in load file is in MW, and all gens cost are modeled in $ (heat rate being multiplied by fuel cost as well which is also in |
Here is the weight of the 24 points: |
@YifanLi86 I think you're right. For the timestamp mapping I've been using to generate test data (I think these are the same as those that @BainanXia is using), the |
@YifanLi86 Good point and it seems to be reasonable as @danielolsen explained. However, I have a more general question regarding this: currently we recover the time series outputs simply by duplicating the values of a time point among time stamps according to slicing recovery file (except for PF, we also split power between parallel lines given Switch results are based on bus tuples). I'm wondering do all dual variables ( |
Good point. Yes I believe all duals need to be divided, but not pg pf storage_pg, storage_e. Since those are pure MW value and limited by constraints defined in MW. Anything related to cost or energy should be divided, but anything just a dispatch of MW for snapshots should not. |
Per @danielolsen 's comment, I'm implementing Our plan based on previous discussion: Maximum_DispatchTx gives the shadow prices in terms of bus tuples. There will be parallel lines in only one direction between a bus tuple, i.e. all lines between bus_A and bus_B should have same from bus and to bus. Hence, suppose we have two lines with (from_A, to_B) with dual values, D1 for bus tuple (A, B) and D2 for (B, A) respectively. Then D1 would be Here is my observation during implementation: |
The sign on the |
Suppose we have D1 = -100 for bus tuple (A, B) and D2 = 0 for bus tuple (B, A), and we have lines defined by (from_A, to_B), does it mean |
Let's look at the power flow at this time period. In our terminology, |
I think you are right: |
@BainanXia I agree with all that @danielolsen has mentioned above. Just a reminder congu and congl need to be divided by the timepoint weight as well (same with LMP). Another approach is that since you already extracted LMP data, you could simply subtract the from and to busses' LMPs to get line shadow price if there is no losses, if I remember it correctly. E.g.: For busses A & B and branch AB, If branch is defined A->B, and LMP(A) - LMP(B) > 0, then congu(AB) = LMP(A) - LMP(B), and congl(AB) = 0. Might need to verify a couple of cases to see if the dual results of LMP and shadow price actually lining up. This could also help confirm Maximum_Dispatch_Tx is indeed the shadow price. |
I believe this works in a simple transport model, but not in the general case where there are other constraints on line flow (e.g. DC power flow, flowgate constraints, etc.). |
Thanks for the reminder. I've done the implementation. Will get a PR up soon. Some immediate validations according to your suggestion: Looking at the same branch as I posted above, branch_id = 98577, In my non-expert point of view, power in general should flow from low lmp bus to high lmp bus (intuitively, from cheap location to expensive location), which is consistent with the observation above, LMP(A) is higher and power flows from B to A. Regarding the values of shadow price and LMP differences, I'm with @danielolsen, the reason is we do have other constraints on the line flow besides capacity limits. |
Thanks @BainanXia, that's quick action! Yes if there is no DC flow constraints then powerflow tends to go from cheaper place to expensive place to minimize cost, otherwise it will per the voltage angle. I feel the reason of the values are not lining up is not because of other constraints since SWITCH actually is a transport model so there are essentially no other constraints. The reason is because of losses which are defined in SWITCH so we do have a loss component there causing the mismatch. Actually, since we are connecting SWITCH (with loss modeling) results to PowerSimData (lossless network). I would lean towards to add the loss components back to maintain consistency FYI. |
@danielolsen Do we have a place (issue) for adding loss components in PCM? If so we should mention the conversation here. |
There's no issue within REISE.jl for adding losses. The closest one, which involves different power flow models in general, is probably Breakthrough-Energy/REISE.jl#60. I'm not aware of DCOPF formulations that incorporate losses, since generally one of the approximations that's made is under the assumption that Given that the power flow model within Switch is quite different than the power flow model within REISE.jl, what is the value in trying to post-process the results from one to try to emulate what the results would be in another? |
Perhaps we should just assume lossless network in expansion model as well at this time. If so and just for visualization purpose, @BainanXia I am totally ok to ignore loss components for now and please go ahead with your current approach of implementation. |
Below are the steps that we need to follow to use our analysis/plotting ecosystem with results generated by switc:
Grid
object with information stored in the output file and potentially input data (Build a Grid object #49)MockScenario
andMockGrid
objects (Build mock objects #51)The text was updated successfully, but these errors were encountered: