Skip to main content

Planning and Operation Model for Multi-Energy Systems

Project description

Planning and Operation Model for Multi-Energy Systems

Installation

I - Download or clone POMMES project

  • Downloading it
  • Or cloning it with git
     $ git clone https://git.persee.mines-paristech.fr/energy-alternatives/pommes.git
    

II - Pycharm (optional, recommended)

Using python Pycharm IDE which can be downloaded from this webpage facilitates the interaction with the tool.

III - Python environment

Python environment is built with Mamba.

Prerequisites

Choose the installation depending on your platform.

To integrate mamba in PowerShell, run in the Miniforge Prompt:

  • On Windows

    $ mamba init powershell
    

    Or

    $ mamba init cmd.exe
    
  • On Linux

    $ mamba init bash
    

Python environment creation

Ensure Mamba is initiated in your shell: see prerequisites if needed.

At project root, the file environment.yaml gives the requirements of a pommes-env python environment.

To create the environment, run at project root (meaning ensuring $ cd [path_to_pommes_directory_root]):

$ mamba env create -f environment.yaml

Then use this python interpreter for your study.

Setting the interpreter in Pycharm

You can set this environment as python interpreter in Pycharm using:

Settings > Project: pommes > Python interpreter > Add interpreter > Add local interpreter ... add_interpreter.png

Then:

Conda Environment > Load Environments > Use existing environment > pommes-env If needed, update the conda executable path:

[your installation directory]\miniforge3\condabin\conda.bat.

pommes-env.png

Contributing

All contributions are welcome with merge requests. Use pre-commit for code formatting.

$ pre-commit install

Solver installation

Solving optimisation model with linopy allows to interact easily with multiple solvers. Check linopy documentation to get all compatible solvers.

HiGHS solver is installed in the virtual environment with the highspy package. However, for the sake of performance, here is a short tutorial to get the commercial solver Gurobi which presents much better resolution speed, and which is free for academic use.

Gurobi

Gurobi is already installed in the python virtual environment with the gurobipy package. To generate a named academic license, visit the gurobi license webpage and sign in with your academic e-mail address.

You will get a license token.

Then go to the download page of the license tool packages You can then run the grbgetkey script and copy-paste your token in the console.

If you want to change the default directory of the gurobi.lic file, make sure that the corresponding environment variable is modified.

Getting started

The example study is stored in study\test_case. Data stored in study\test_case\data and the import is described in the study\test_case\config.yaml file.

Try to run the run_study.py first to get some results.

Explore the results in the study\test_case\output directory structured as follow:

output
   |-- ref_(suffix?)
         |-- constraints
            |-- annualised_totex_def.csv
            |-- ...
         |-- plots
            |-- energy_balance
               |-- 2020_electricity.html
            |-- energybalance.html
         |-- variables
            |-- annualised_totex.csv
            |-- ...
         |-- dual.nc
         |-- input.nc
         |-- model.nc
         |-- objective.csv
         |-- solution.nc

Explore it!

  • constraints/ gathers the lagrangians of the constraints
  • variables/ the solution
  • and some visualisations are available in plots/.

Run your own scenario

Inputs

To run your own study, copy-paste the test_case/ study, rename it with your study name. Let's take study_name for the example.

study
   |-- test_case
         |-- data
            |-- availability.csv
            |-- ...
         |-- config.yaml
   |-- study_name
         |-- data
            |-- availability.csv
            |-- ...
         |-- config.yaml

You can now change the inputs value of your scenario.

Waiting for an exhaustive description of the inputs, here are some guidelines:

  • all power units are in MW
  • all energy units in MWh
  • storage assets are considered as energy storage (not power or methane or hydrogen storage)
    • in (keep) represents the resource needed to charge (keep) 1 MWh of energy
    • out represents the resource produced by the storage when discharging 1 MWh of energy

Run the optimisation

Follow the workflow of the study\test_case\run_study.py script with the right study_name (and potentially change the solver)

Enjoy !

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pommes-0.0.2-py3-none-any.whl (80.3 kB view details)

Uploaded Python 3

File details

Details for the file pommes-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pommes-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 80.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pommes-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1fb80f19a8212ba6534d67f2b9585b09d7387b300bc7f8e0a60c7ecc9007e12f
MD5 ce30b69ab2ade67eb7d779f22fe5e7bd
BLAKE2b-256 ba418780f6c710c934f5f99528718eb944151379bbac6dbd565dbc8601464738

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page