-
Notifications
You must be signed in to change notification settings - Fork 9
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
[Feature] Link inverter and rectifier capacity #155
Comments
Hello @remmyd! Glad to hear from you. I agree that this is not an ideal representation (and related to #31). I have already noted down some hints in the MVS issues (rl-institut/multi-vector-simulator#24 (comment)) already:
So, I think you did not work with oemof yet, right? This will be a jump into cold water for you. This is how I would go about it:
... as you see, this is already a pretty large issue. You can learn basically everything you need to program a tool like Offgridders, but it requires a lot from you. Depending on your learning style, you might want to adress a smaller issue first, to get to know the github flow first. |
I have heard you are not sure how to share code with me. There are actually different options:
|
Hi @smartie2076, thanks for the reply. I used parts of test_connect_invest.py from the code example you shared above. I'll attach it to this post. The equal_variables() function does set the two transformers to the same capacity ('invest' variable for transformer 2 is set equal to transformer 1 invest variable eventhough transformer 2 is not used). If the function is commented out the transformer 2 variable is set to 0. Thus, it seem to do what we want. The constraint in the lp-file looks like the following:
|
This is looking good then! I think we would implement
A bit differently - I think I called the offgridders/src/G2b_constraints_custom.py Line 891 in a8fa6f1
(This is just one example for a call for an inverter). probably, your function would look more like this:
Notes:
|
Ah, and of couse you need an if-loop somehow that would make sure that you only apply the constraint when appropriate. |
Do you have an answer to the following question yet?
|
Thanks for the hints. I think letting the user decide if they want to link the inverter and the rectifier together is a good idea. I also saw in this publication that the inverter and rectifier can be linked by a capacity ratio factor, and if I am not mistaken Homer also defines the rectifier as a % of the inverter. However, I am unsure on how we would implement this. For the if-loop you mentioned would you call it outside of the function then in G1? |
Yeah, Homer also does that: https://www.homerenergy.com/products/pro/docs/3.10/converter.html Basically, you would also add a parameter like
This results in |
I did call the if-loops for the other constraints in offgridders/src/G1_oemof_create_model.py Line 432 in a8fa6f1
You can follow that approach for now. In the end, we will still have to figure out how to easiest add pytests for the new constraints, and then you might need to move the if-loop (but that is no big thing!). |
I ment in the LP-file, you could also try that out with your code snippet! That would even be the best approach, actually :) |
Yes, that makes, sense. equal_variables() actually has the option to use a factor: equate_variables(model, CAP_rectifier , CAP_inverter, inverter_rectifier_capactiy_ratio_factor) which result in the same constraint: CAP_rectifier==inverter_rectifier_capactiy_ratio_factor*CAP_inverter (tested with the code snippet) I guess this would be useful if the user gives only an inverter cost. The options now would be:
I am usure if they all make sense or if we should decide on which one to use. |
Hi @remmyd! Sorry about the delay. I think you can cover all of them with following data:
for 1), you could print a warning if the costs for both rectifyer costs and inverter costs are added ( for 2), Same as above, just that for 3) Same as above, ...so, I think you only need to add |
Hi @smartie2076 ! Makes sense, I would suggest add
|
I think the offgridders/src/B_read_from_files.py Line 259 in a8fa6f1
Same goes for offgridders/src/B_read_from_files.py Line 368 in a8fa6f1
Mainly, you need to make sure that the simulation also works if the user does not provide these two parameters as well. You should implement that as two benchmark tests (or more). This makes sure that old users can still use their old input files to use Offgridders.
I am taking about the development costs, the specific costs and the specific operation and management costs. They should/should not be linked/added according to the setting. I think the dispatch costs may be different. |
Alright. Do you already have an idea where I should check if the two parameters are provided or not? Are there other parameters where this was already implemented? offgridders/src/F_case_definitions.py Line 79 in a8fa6f1
|
I think you can check if offgridders/src/C_sensitivity_experiments.py Line 1074 in a8fa6f1
For offgridders/src/B_read_from_files.py Line 409 in a8fa6f1
You should, though, raise a |
Remember: You can already push the slightest bits of code you already created into a PR. |
Hi @smartie2076, I have a first draft ready to push but I think I don't have access to the github. When I use the command |
Sorry about that, I now created write-access for you. Does it work now? I have to let you know that I am on vacation starting tomorrow afternoon, so I will not be able to review your pull request in the next two weeks... |
Currently the rectifier and inverter capacity are optimized individually eventhough they should represent a bi-directional inverter. Linking them together could enhance offgridders. What would be a good way to start on this issue?
The text was updated successfully, but these errors were encountered: