Skip to content

Commit 9adcd23

Browse files
committed
Update quickstarter.rst
Modify the guideline to match with the updated version.
1 parent ef24847 commit 9adcd23

File tree

2 files changed

+83
-34
lines changed

2 files changed

+83
-34
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
# PowNet: Unit Commitment / Economic Dispatch model in Python
33
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.
44

5+
A quick start tutorial is provided here: https://pownet.readthedocs.io/en/latest/pages/quickstarter.html
6+
57
Read the PowNet Documentation here: https://pownet.readthedocs.io/en/latest

docs/source/pages/quickstarter.rst

Lines changed: 81 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,105 @@
11

2-
**4. Quickstarter Notebook**
2+
**4. PowNet 2.0 Quick Start Guide**
33
============================
4+
This tutorial demonstrates how to use PowNet 2.0 to simulate a dummy power system over a 24-hour horizon for two simulation days.
45

5-
**1. Install Jupyter Notebook**
6+
1. Model Overview
7+
-----------------
68

7-
.. code:: shell
9+
The dummy power system includes a variety of generation sources and a single buyer.
810

9-
>>> pip install jupyterlab
11+
::
1012

11-
**2. Launch a Jupyter Notebook from the terminal**
13+
pOil
14+
|
15+
|
16+
Node 3 --- pGas
17+
|
18+
|
19+
Node 1 --- Node 2 --- pHydro --- Buyer
20+
| |
21+
| |
22+
Supplier pBiomass
1223

13-
.. code:: shell
1424

15-
>>> jupyter lab
25+
2. Setup
26+
----------
1627

17-
**3. Download PowNet from CIS Lab GitHub Repo**
28+
* **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.
1829

19-
.. code:: shell
20-
21-
>>> ! git clone https://github.com/Critical-Infrastructure-Systems-Lab/PowNet.git
30+
* **Model Year:** Specify the simulation year (`model_year`). This value must match the year associated with the time series data files within the `input_folder/model_name` directory.
2231

23-
**4. Change directory to PowNet folder**
32+
* **Simulation Parameters:**
33+
* `sim_horizon`: Define the simulation horizon in hours (e.g., 24 for a daily simulation).
34+
* `steps_to_run`: Specify the number of simulation steps (e.g., 2 for a two-day simulation).
35+
* `solver`: Select the optimization solver ('gurobi' or 'highs').
2436

25-
.. code:: python
37+
3. Code Example
38+
---------------
2639

27-
>>> import os
28-
29-
>>> os.chdir('PowNet/')
30-
31-
>>> os.getcwd()
40+
The following code has already been made available in the the `scripts` folder as `run_quickstart.py`. However, the code is also presented here.
3241

33-
**5. Make changes in user input variables**
34-
35-
.. code:: python
42+
.. code-block:: python
3643
37-
>>> %load main.py
44+
""" This script provides an example of how to run PowNet 2.0.
45+
"""
3846
39-
*Make changes in* ``main.py`` *loaded in the notebaook [e.g.,* ``MODEL_NAME`` *to define region of interest,* ``T`` *for Simulation Horizon,
40-
or* ``use_gurobi`` *to choose optimization solver] and then save changes.*
47+
import os
48+
from pownet.core import Simulator
4149
42-
.. code:: python
4350
44-
>>> %save main.py
51+
def main():
4552
46-
**6. Add the PYTHONPATH environment variable**
53+
# --------- User inputs
4754
48-
.. code:: python
55+
input_folder = "..//model_library"
56+
output_folder = "..//temptemp"
4957
50-
>>> import sys
51-
52-
>>> sys.path.append('/Path/to/PowNet Directory/src/')
58+
model_name = "dummy"
59+
model_year = 2016
5360
54-
**7. Run PowNet Simulation**
61+
# Simulation parameters
62+
sim_horizon = 24
63+
steps_to_run = 2
64+
solver = "gurobi" # or highs
5565
56-
.. code:: python
66+
# --------- End of user inputs
5767
58-
>>> %run main.py
68+
# Run the simulation
69+
simulator = Simulator(
70+
input_folder=input_folder,
71+
model_name=model_name,
72+
model_year=model_year,
73+
)
74+
75+
simulator.run(
76+
sim_horizon=sim_horizon,
77+
steps_to_run=steps_to_run,
78+
solver=solver,
79+
)
80+
81+
# Write the simulation results
82+
if not os.path.exists(output_folder):
83+
os.makedirs(output_folder)
84+
simulator.write_results(output_folder)
85+
86+
# Plot the results
87+
simulator.plot_fuelmix("bar", output_folder)
88+
simulator.plot_unit_status(output_folder)
89+
90+
91+
if __name__ == "__main__":
92+
main()
93+
94+
95+
4. Running the Simulation
96+
-------------------------
97+
98+
1. **Save:** Save the code above as a Python file (e.g., `run_tutorial.py`).
99+
2. **Run:** Execute the script from your terminal using `python run_pownet.py`.
100+
101+
5. Outputs
102+
----------
103+
104+
* **Results:** Simulation results will be saved in the specified `output_folder`.
105+
* **Plots:** The code generates plots of the fuel mix and unit status, also saved in the `output_folder`.

0 commit comments

Comments
 (0)