Skip to content

Commit 5bce7a9

Browse files
committed
Add the focus_country feature in the model
1 parent 1f39e22 commit 5bce7a9

1 file changed

Lines changed: 50 additions & 1 deletion

File tree

docs/run/run_python_advanced.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,56 @@ python epm.py --input_folder input/your_data_folder --sensitivity
113113
- Only parameters enabled in the `sensitivity` dict are processed.
114114
- This approach supports automated scenario generation for robustness checks.
115115

116-
## C. Monte-Carlo analysis (ongoing development)
116+
## C. Single-Country Runs with Border Prices
117+
118+
For detailed country-level analysis, you can run a two-step workflow:
119+
120+
1. **Regional run** with `--focus_country` to extract border prices
121+
2. **Single-country run** using those prices as fixed external inputs
122+
123+
### Step 1: Run Regional Model with Focus Country
124+
125+
```bash
126+
python epm.py --folder_input data_test --focus_country DRC
127+
```
128+
129+
This runs the full regional model and generates single-country input files in `folder_input`:
130+
131+
```text
132+
input/data_test/
133+
├── config_drc.csv # Modified config for single-country run
134+
└── single_country_drc/
135+
├── zcmap_drc.csv # Only DRC zones
136+
├── zext_drc.csv # Neighbors as external zones
137+
├── pTradePrice_drc.csv # Border prices from pHourlyPrice
138+
├── pExtTransferLimit_drc.csv # Cross-border capacities
139+
└── pTransferLimit_drc.csv # Internal transmission only
140+
```
141+
142+
### Step 2: Run Single-Country Model
143+
144+
```bash
145+
python epm.py --folder_input data_test --config config_drc.csv
146+
```
147+
148+
The single-country model treats neighboring countries as external zones with fixed prices from the regional run.
149+
150+
### How It Works
151+
152+
- **Neighbors identified** from both `pTransferLimit.csv` (existing) and `pNewTransmission.csv` (candidate lines)
153+
- **Border prices** extracted from `pHourlyPrice` output, pivoted to `pTradePrice` format
154+
- **Multi-zone countries** supported (e.g., DRC includes both `DRC` and `DRC_South` zones)
155+
- **Price interpolation** handled automatically by input treatment for missing years
156+
157+
### CLI Reference
158+
159+
| Argument | Description |
160+
|-------------------|------------------------------------------------------------------|
161+
| `--focus_country` | Country code to generate single-country inputs for (e.g., `DRC`) |
162+
163+
---
164+
165+
## D. Monte-Carlo analysis (ongoing development)
117166

118167
EPM allows you to run Monte Carlo simulations to test how uncertainties (like fuel prices or demand) affect your results. This feature currently works only via the Python interface and is still under development.
119168

0 commit comments

Comments
 (0)