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

Issue 518 - Myopic Implementation #554

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from
Open

Conversation

lfreese
Copy link

@lfreese lfreese commented Feb 21, 2025

Closes #518 .

Changes proposed in this Pull Request

Added a myopic approach for foresight. Currently missing a few of the 'opts' to work properly with Myopic and that is still being developed (should be completed soon). The current working opt is REM.

Myopic implementation is essentially a for loop in solve_network.py/solve_network after the optimization, copying the p_nom_opt from that time period and saving it as the p_nom to be used for the next period of optimization, and are made non-extendable. The links and lines minimum is set to the previous time period's optimum. Much of this is a simpler version of the add_brownfield.py in PyPSA-eur, as we do not deal with H2 and pipelines, but that may be necessary down the line.

Checklist

  • I tested my contribution locally and it seems to work fine.
  • Code and workflow changes are sufficiently documented.
  • [n/a] Changed dependencies are added to envs/environment.yaml.
  • [n/a] Changes in configuration options are added in all of config.default.yaml.
  • Changes in configuration options are also documented in doc/configtables/*.csv.

trevorb1 and others added 10 commits January 27, 2025 18:59
Update DAGs for documentation site
…ight if statements in the solve_network function to pull the foresight type from a config file. Foresight type option still needs to be added to the repo_data/config/ files, as it is just manually added into the workflow/config currently to avoid init_pypsa_usa.sh reuse. With precommit fixes.
…l running, gives same results as without myopic since we are not pulling from prior timesteps
…tput matches expectations. output does combine first year with the existing infrastructure (need to fix). added in the time dependent components. added a limited part of c in the c.iterate_components, to just include what was in the previous timestep.
…izon, previously was years equal to the investment horizon
… level checks but is giving reasonable results for myopic output. Key change was creating a deep copy of the c.pnl and adding all rather than just input time variables back in after removal
@ktehranchi ktehranchi changed the base branch from master to develop February 27, 2025 14:58
@ktehranchi ktehranchi changed the title Issue 518 Issue 518 - Myopic Implementation Feb 27, 2025
status, condition = n.optimize.optimize_transmission_expansion_iteratively(
**kwargs,
)
for i, planning_horizon in enumerate(n.investment_periods):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case we are solving a perfect foresight model which has multiple investment_periods, we wouldn't want to enter this for loop, correct?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made a fix for this, will push

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Myopic Implementation
4 participants