-
Notifications
You must be signed in to change notification settings - Fork 85
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
Monte carlo case study #78
Conversation
… into monte-carlo
"\n", | ||
"The goal of this notebook is to analyze the results of the Monte-Carlo simulations and gain insights into the power system of Nigeria. It utilizes the Monte Carlo method to generate multiple scenarios and assess the uncertainty in the power system's performance.\n", | ||
"\n", | ||
"The Monte Carlo method is a statistical technique that involves running multiple simulations with randomly sampled input parameters to estimate the distribution of the output variables. By applying this method to Nigeria's power data, we can assess the reliability and robustness of the power system under different scenarios and identify potential areas for improvement.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the method is applied rather to the model than to the data, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right. The method is applied to the model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then, it would be good to revise a bit the description ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @GbotemiB!
Great work! 😄 Added a couple of technical comments across the text. Two main points:
-
would be great to briefly introduce the model to explain what exactly are we reproducing;
-
the plots labels should be improved;
-
we can probably think on how to make a conclusion more impressive.
What is your feeling about that?
"source": [ | ||
"## Sensitivity Analysis\n", | ||
"\n", | ||
"Sensitivity analysis helps us explore how variations in input parameters affect the model’s output. These inputs might include energy prices, efficiency factors, renewable energy availability, and demand patterns.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to shortly introduce the model to clarify what are we actually doing.
} | ||
], | ||
"source": [ | ||
"import os\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a technical comment: os
has been imported before.
" network = pypsa.Network(path)\n", | ||
" network_list.append(network)\n", | ||
"\n", | ||
"print(\"All Networks loaded successfully\")" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't it make sense to use logging instead of prints? We have anyway loaded logging
import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yh, Totally fine to use logging.
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"MONTE_CARLO_PYPSA_FEATURES = [\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we inherited the capitalised variable names from some previous set-up of Monte-Carlo part? Not sure they look consistent...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could make it smaller cases.
What I did was to copy the code implementation from the monte_carlo.py
script
"sns.barplot(src_beta_coefficients)\n", | ||
"plt.title(\"Beta coefficients of the parameters\")\n", | ||
"plt.show()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Here is labelling for the x-axis of the plots with regards to the selected parameters\n", | ||
"\n", | ||
"0: 'loads_t.p_set <br>\n", | ||
"1: 'generators_t.p_max_pu.loc[:, n.generators.carrier == \"solar\"]'<br>\n", | ||
"2: 'generators_t.p_max_pu.loc[:, n.generators.carrier == \"onwind\"]'<br>\n", | ||
"3: 'generators.capital_cost.loc[n.generators.carrier == \"solar\"]'<br>\n", | ||
"4: 'generators.capital_cost.loc[n.generators.carrier == \"onwind\"]'<br>\n", | ||
"5: 'generators.weight.loc[n.generators.carrier == \"onwind\"]'<br>\n", | ||
"6: 'generators.weight.loc[n.generators.carrier == \"solar\"]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plots labels must be fixed on the plot, otherwise it's a bit difficult to comprehend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might have a much larger plot if the label is inserted directly into the x-axis. I tried using labels but it took a considerably large amount of space in the plot, covering some of the bars in the plot.
I am open to different ideas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point. Can we use short yet meaningful version of the labels?
Hi @Katia, Thanks for the review so far. I have updated the notebook based on the review. I think the notebook is ready for another round of review. |
Hello @GbotemiB! A couple of additional comments, which are mainly follow-ups of our discussion. Tutorial notebook
Sensitivity analysis notebook
What do you think? |
Hello @ekatef, Thank you very much for the comment. I will let you know when I have updated the notebook based on the review. |
Hi @ekatef, I have made some recent changes to the notebook, happy to have you review them. |
Following the negative objective issue pypsa-meets-earth/pypsa-earth#961, there seems to be a significant change in the charts for the monte-carlo objectives from the notebook. |
Perfect, thanks a lot for the updates @GbotemiB! Adding a review on the PR (sorry for taking so long for the next iteration):
|
@GbotemiB a really great work! Would be great to address the points above to make the notebooks shine. But the current explanations are still good enough to help start with Monte-Carlo in PyPSA-Earth. So, not much is left to finalise the tutorials :) |
Thanks for the review @ekatef. I have factored all the changes into the notebooks.
I also made changes to this. But, feel free to revise. Once again, thanks for the review. Well, We wont still be able to proceed with the merge until the negative objective issue is solved, which is fine. |
@ekatef I think we are getting closer. |
Hello @GbotemiB, brilliant work! Agree, we are almost there 😄 I have a few final comments which mainly relate to polishing of the description in monte_carlo_case_study_nigeria_data.ipynb.
Agree that it's a usual and general description of how weights are normally used, but in case of wind and solar, I'd rather say that generator weight rather account for the dynamics of renewable potential.
Could you please look into these points? You have done a really nice work and it would be great to polish it presentation. |
Thanks @ekatef for the review. I will let you know when the changes are ready. |
Hello @GbotemiB! |
Merged 😄 |
@ekatef |
This notebook describes an introduction to the Monte Carlo option in PyPSA-Earth configuration using Nigeria's power data.