Skip to content
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 Improvement #930

Merged
merged 46 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
294bde2
monte-carlo improvement
GbotemiB Dec 1, 2023
9a0ddac
reorganize import
GbotemiB Dec 1, 2023
2e34dee
precommit
GbotemiB Dec 1, 2023
a717cf2
revised implementation based on input
GbotemiB Dec 12, 2023
1612fb0
Merge branch 'pypsa-meets-earth:main' into monte-carlo
GbotemiB Dec 12, 2023
c0dc3b4
Merge branch 'main' into monte-carlo
GbotemiB Dec 12, 2023
a382d9a
Merge branch 'monte-carlo' of https://github.com/GbotemiB/pypsa-earth…
GbotemiB Dec 12, 2023
feca2a4
removed unused comments
GbotemiB Dec 12, 2023
3585bd9
reviewed implementation on monte-carlo
GbotemiB Dec 15, 2023
24c3de7
removed var scale
GbotemiB Dec 18, 2023
e79566a
added seedling option
GbotemiB Dec 18, 2023
3de6594
Merge branch 'main' into monte-carlo
GbotemiB Dec 18, 2023
4b46adb
Merge branch 'main' into monte-carlo
GbotemiB Dec 18, 2023
f5b62c7
precommit
GbotemiB Dec 18, 2023
a8b7809
fixed legacy scale
GbotemiB Dec 19, 2023
9ee395c
added type hinting
GbotemiB Dec 19, 2023
37c0b7a
added feature to plot distribution
GbotemiB Dec 20, 2023
1ef294a
added new feature to clean rule with monte-carlo
GbotemiB Dec 20, 2023
72108af
fixed lognormal shape
GbotemiB Dec 22, 2023
d5dcb4e
fixed lognormal shape
GbotemiB Dec 22, 2023
9090fc3
reset monte-carlo option to falss
GbotemiB Dec 22, 2023
fb251ad
Merge branch 'main' into monte-carlo
GbotemiB Dec 23, 2023
8ac29f0
Merge branch 'main' into monte-carlo
GbotemiB Dec 24, 2023
b73c295
fixed case to lowerletter
GbotemiB Jan 3, 2024
7af5c4e
fixed case to lowerletter
GbotemiB Jan 3, 2024
c223592
fixed plots
GbotemiB Jan 9, 2024
c637206
fixed plots back to displot
GbotemiB Jan 9, 2024
ab20522
Merge branch 'main' into monte-carlo
GbotemiB Jan 12, 2024
9772850
modified clean rule
GbotemiB Jan 12, 2024
5f0f74d
revert defaults
GbotemiB Jan 12, 2024
34346be
added comments to enable monte-carlo
GbotemiB Jan 12, 2024
bb31bfe
commented out plots for rescaled distribution
GbotemiB Jan 12, 2024
f12cb5d
Merge branch 'pypsa-meets-earth:main' into monte-carlo
GbotemiB Jan 15, 2024
127d797
updated comments for MC
GbotemiB Jan 15, 2024
9577c83
Merge branch 'main' into monte-carlo
GbotemiB Jan 19, 2024
8079f22
more comments to config documentation
GbotemiB Jan 19, 2024
4862e9b
include monte-carlo into api-reference
GbotemiB Jan 23, 2024
c8e5e2f
modified description
GbotemiB Jan 23, 2024
171bde7
fix monte-carlo
GbotemiB Jan 24, 2024
cafc172
remove old comments from description
GbotemiB Jan 24, 2024
aead4a7
Merge branch 'main' into monte-carlo
GbotemiB Jan 24, 2024
7caed11
adjusted comments for readthedocs
GbotemiB Jan 24, 2024
d0fa469
fixed tables for monte-carlo in docs
GbotemiB Jan 24, 2024
f4053c1
Update config.default.yaml
GbotemiB Jan 24, 2024
5741ee7
removed unnecessary comments
GbotemiB Jan 25, 2024
5a1b2f1
fixed distribution issue
GbotemiB Jan 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -341,18 +341,36 @@ costs:


monte_carlo:
# Uniform: https://chaospy.readthedocs.io/en/master/api/chaospy.Uniform.html
# Normal: https://chaospy.readthedocs.io/en/master/api/chaospy.Normal.html
# LogNormal: https://chaospy.readthedocs.io/en/master/api/chaospy.LogNormal.html
# Triange: https://chaospy.readthedocs.io/en/master/api/chaospy.Triangle.html
# Beta: https://chaospy.readthedocs.io/en/master/api/chaospy.Beta.html
# Gamma: https://chaospy.readthedocs.io/en/master/api/chaospy.Gamma.html
# [mean, std] for Normal and LogNormal
# [lower_bound, upper_bound] for Uniform
# [lower_bound, midpoint, upper_bound] for Triangle
# [alpha, beta] for Beta
# [shape, scale] for Gamma
# TODO: Support inputs to simulate outages biggest lines "lines.p_nom_opt.max(): [-3000MW 0MW]""
# TODO: Support inputs to simulate outages of biggest power plant "generators.p_nom.max()": [-1000MW 0MW]
# ... user can add flexibly more features for the Monte-Carlo sampling
# as key: add below the pypsa object for the monte_carlo sampling, "network" is only allowed for filtering!
# as value: currently supported format [l_bound, u_bound] or empty [], represent multiplication factors for the object
options:
add_to_snakefile: false
davide-f marked this conversation as resolved.
Show resolved Hide resolved
samples: 7 # number of optimizations
sampling_strategy: "chaospy" # "pydoe2", "chaospy", "scipy", packages that are supported
pypsa_standard:
# User can add here flexibly more features for the Monte-Carlo sampling.
# Given as "key: value" format
# Key: add below the pypsa object for the monte_carlo sampling, "network" is only allowed for filtering!
# Value: currently supported format [l_bound, u_bound] or empty [], represent multiplication factors for the object
loads_t.p_set: [0.9, 1.1]
# generators_t.p_max_pu.loc[:, n.generators.carrier == "wind"]: [0.9, 1.1]
# generators_t.p_max_pu.loc[:, n.generators.carrier == "solar"]: [0.9, 1.1]
samples: 9 # number of optimizations. Note that number of samples when using scipy has to be the square of a prime number
sampling_strategy: "chaospy" # "pydoe2", "chaospy", "scipy", packages that are supported
uncertainties:
loads_t.p_set:
type: Uniform
args: [0, 1]
generators_t.p_max_pu.loc[:, n.generators.carrier == "wind"]:
type: LogNormal
args: [0, 2]
generators_t.p_min_pu.loc[:, n.generators.carrier == "wind"]:
type: Beta
args: [0.5, 2]


solving:
Expand Down
38 changes: 28 additions & 10 deletions config.tutorial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -337,18 +337,36 @@ costs:


monte_carlo:
davide-f marked this conversation as resolved.
Show resolved Hide resolved
# Uniform: https://chaospy.readthedocs.io/en/master/api/chaospy.Uniform.html
# Normal: https://chaospy.readthedocs.io/en/master/api/chaospy.Normal.html
# LogNormal: https://chaospy.readthedocs.io/en/master/api/chaospy.LogNormal.html
# Triange: https://chaospy.readthedocs.io/en/master/api/chaospy.Triangle.html
# Beta: https://chaospy.readthedocs.io/en/master/api/chaospy.Beta.html
# Gamma: https://chaospy.readthedocs.io/en/master/api/chaospy.Gamma.html
# [mean, std] for Normal and LogNormal
# [lower_bound, upper_bound] for Uniform
# [lower_bound, midpoint, upper_bound] for Triangle
# [alpha, beta] for Beta
# [shape, scale] for Gamma
# TODO: Support inputs to simulate outages biggest lines "lines.p_nom_opt.max(): [-3000MW 0MW]""
# TODO: Support inputs to simulate outages of biggest power plant "generators.p_nom.max()": [-1000MW 0MW]
# ... user can add flexibly more features for the Monte-Carlo sampling
# as key: add below the pypsa object for the monte_carlo sampling, "network" is only allowed for filtering!
# as value: currently supported format [l_bound, u_bound] or empty [], represent multiplication factors for the object
options:
add_to_snakefile: false
samples: 7 # number of optimizations
sampling_strategy: "chaospy" # "pydoe2", "chaospy", "scipy", packages that are supported
pypsa_standard:
# User can add here flexibly more features for the Monte-Carlo sampling.
# Given as "key: value" format
# Key: add below the pypsa object for the monte_carlo sampling, "network" is only allowed for filtering!
# Value: currently supported format [l_bound, u_bound] or empty [], represent multiplication factors for the object
loads_t.p_set: [0.9, 1.1]
# generators_t.p_max_pu.loc[:, n.generators.carrier == "wind"]: [0.9, 1.1]
# generators_t.p_max_pu.loc[:, n.generators.carrier == "solar"]: [0.9, 1.1]
samples: 9 # number of optimizations. Note that number of samples when using scipy has to be the square of a prime number
sampling_strategy: "chaospy" # "pydoe2", "chaospy", "scipy", packages that are supported
uncertainties:
loads_t.p_set:
type: Uniform
args: [0, 1]
generators_t.p_max_pu.loc[:, n.generators.carrier == "wind"]:
type: LogNormal
args: [0, 2]
generators_t.p_min_pu.loc[:, n.generators.carrier == "wind"]:
type: Beta
args: [0.5, 2]


solving:
Expand Down
Loading
Loading