From 5c2c12d37f1e8512ea736e23d8ae29734d85e1d0 Mon Sep 17 00:00:00 2001 From: Dae <65160408+phumthep@users.noreply.github.com> Date: Sun, 27 Oct 2024 15:25:37 -0400 Subject: [PATCH] Add installation guideline --- README.md | 34 +++++++++++++++++++++++-- docs/source/pages/quickstarter.rst | 41 ++++++++++++++++++++++++++---- 2 files changed, 68 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7cec635..30fbc69 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,40 @@ # PowNet: Unit Commitment / Economic Dispatch model in Python PowNet is a least-cost optimization model for simulating the Unit Commitment and Economic Dispatch (UC/ED) of large-scale (regional to country) power systems. In PowNet, a power system is represented by a set of nodes that include power plants, high-voltage substations, and import/export stations (for cross-border systems). The model schedules and dispatches the electricity supply from power plant units to meet hourly electricity demand in substations at a minimum cost. It considers the techno-economic constraints of both generating units and high-voltage transmission network. The power flow calculation is based on a Direct Current (DC) network (with N-1 criterion), which provides a reasonable balance between modelling accuracy and data and computational requirements. PowNet can easily integrate information about variable renewable resources (e.g., hydro, wind, solar) into the UC/ED process. For example, it can be linked with models that estimate the electricity supply available from renewable resources as a function of the climatic conditions. In addition, PowNet has provision to account for the effect of droughts on the generation of dispatchable thermal units (e.g., coal, oil, gas-fired units) that depend on freshwater availability. These features facilitate the application of PowNet to problems in the water-energy nexus domain that investigate the impact of water availability on electricity supply and demand. -A quick start tutorial is provided here: https://pownet.readthedocs.io/en/latest/pages/quickstarter.html - Read the PowNet Documentation here: https://pownet.readthedocs.io/en/latest + +## Installation + +Download or clone the PowNet 2.0 repository to your local machine. For example: if we want to clone to "C://user/pownet", + +``` +git clone https://github.com/your-username/pownet.git C://user/pownet +``` + +Next, open a terminal and navigate to the directory where you cloned the repository: + +``` +cd C://user/pownet +``` + +The following step is highly recommended: creating a virtual environment to manage dependencies. If using Conda, you can create an envrionment named "pownet": + +``` +conda create --name pownet +conda activate pownet +``` + +Now, you can install this PowNet package using pip, which is a manager for Python packages: + +``` +pip install -e . +``` + +This command installs the package in "editable" mode (-e) using pyproject.toml that is located in the root directory of PowNet. The editable mode allows you to edit PowNet codebase when you need to modify or implement new features. The pyproject.toml file specifies the dependencies required to run PowNet. + +A quick start tutorial to run a simple case study is provided here: https://pownet.readthedocs.io/en/latest/pages/quickstarter.html + ## Overview of PowNet ![overview_pownet](./docs/overview_pownet.png) diff --git a/docs/source/pages/quickstarter.rst b/docs/source/pages/quickstarter.rst index f3e2055..5215311 100644 --- a/docs/source/pages/quickstarter.rst +++ b/docs/source/pages/quickstarter.rst @@ -3,7 +3,38 @@ ============================ This tutorial demonstrates how to use PowNet 2.0 to simulate a dummy power system over a 24-hour horizon for two simulation days. -1. Model Overview +1. Installation +----------------- +Download or clone the PowNet 2.0 repository to your local machine. For example: if we want to clone to "C://user/pownet", + +.. code-block:: python + + git clone https://github.com/your-username/pownet.git C://user/pownet + +Next, open a terminal and navigate to the directory where you cloned the repository: + +.. code-block:: python + + cd C://user/pownet + +The following step is highly recommended: creating a virtual environment to manage dependencies. If using Conda, you can create an envrionment named "pownet": + +.. code-block:: python + + conda create --name pownet + conda activate pownet + +Now, you can install this PowNet package using pip, which is a manager for Python packages: + +.. code-block:: python + + pip install -e . + +This command installs the package in "editable" mode (-e) using pyproject.toml that is located in the root directory of PowNet. The editable mode allows you to edit PowNet codebase when you need to modify or implement new features. The pyproject.toml file specifies the dependencies required to run PowNet. + +Now you have PowNet 2.0 installed and ready to use! You can proceed with the rest of this tutorial to run your first simulation using a small case study. + +2. Model Overview ----------------- The dummy power system includes a variety of generation sources and a single buyer. @@ -22,7 +53,7 @@ The dummy power system includes a variety of generation sources and a single buy Supplier pBiomass -2. Setup +3. Setup ---------- * **Input Folder:** Define the directory containing the power system models (`input_folder`). This folder may contain multiple subdirectories. Ensure the `input_folder` contains a subdirectory named `model_name` with the necessary model data, which is a set of CSV files. @@ -34,7 +65,7 @@ The dummy power system includes a variety of generation sources and a single buy * `steps_to_run`: Specify the number of simulation steps (e.g., 2 for a two-day simulation). * `solver`: Select the optimization solver ('gurobi' or 'highs'). -3. Code Example +4. Code Example --------------- The following code has already been made available in the the `scripts` folder as `run_quickstart.py`. However, the code is also presented here. @@ -92,13 +123,13 @@ The following code has already been made available in the the `scripts` folder a main() -4. Running the Simulation +5. Running the Simulation ------------------------- 1. **Save:** Save the code above as a Python file (e.g., `run_tutorial.py`). 2. **Run:** Execute the script from your terminal using `python run_pownet.py`. -5. Outputs +6. Outputs ---------- * **Results:** Simulation results will be saved in the specified `output_folder`.