Creating a New Example Case
The best way to get started is by reviewing the existing example cases in the Macro repository, located in the MacroEnergyExamples.jl repo.
As described in Running Macro, an example case is a directory containing all the necessary data files to run the model. The folder should follow the structure outlined below:
MyCase
│
├── 📁 settings
│ └── macro_settings.yml
│
├── 📁 system
│ ├── commodities.json
│ ├── time_data.json
│ ├── nodes.json
│ ├── fuel_prices.csv
│ └── demand.csv
│
├── 📁 assets
│ ├── MyNewAsset1.json
│ ├── MyNewAsset2.json
| [...other asset types...]
│ └── availability.csv
│
└── system_data.jsonTo test the new sector and assets, make sure the following items are correctly set up:
The new sector is included in the commodities.json file.
The new sector is defined in the time_data.json file, with appropriate values for HoursPerTimeStep and HoursPerSubperiod.
Nodes for the new sector are included in the nodes.json file.
If applicable, add demand for the new sector at each relevant node in the demand.csv file.
New assets are defined in their respective JSON files within the assets folder.
If necessary, update the fuel_prices.csv file with the fuel prices for the new sector.
If necessary, update the availability.csv file with the availability information for the new assets.
The new sector is defined in the time_data.json file, with appropriate values for HoursPerTimeStep and HoursPerSubperiod.
Nodes for the new sector are included in the nodes.json file.
If applicable, add demand for the new sector at each relevant node in the demand.csv file.
New assets are defined in their respective JSON files within the assets folder.
If necessary, update the fuel_prices.csv file with the fuel prices for the new sector.
If necessary, update the availability.csv file with the availability information for the new assets.
- Double-check that the keys in
commodities.jsonandtime_data.jsonexactly match the name of the new sector (i.e., the Julia abstract type name it was added to the model). - Ensure that the values of the
typekeys in the node JSON entries match the name of the sector. - For each asset JSON file, verify that the
typekey matches the Juliastructname created, and that thecommoditykeys in theedgesandstoragesections are correct.