Building a Modelยถ
Start here once you have:
a completed MORPHE2US.xlsx (see Model Components),
time series JSON files under
data/,the parser
MORPHE2US_pipeline.pyin the same folder.
๐งฐ Step 1: Prepare Your Input Filesยถ
MORPHE2US requires two key input files:
1. Excel File (.xlsx)ยถ
This file defines:
๐ก Technologies (names, efficiencies, costs, emissions)
๐งฑ Nodes and carriers (e.g., electricity, heat, gas)
๐ Demands and capacity limits
๐ Simulation timeline (years and time slices)
๐ Geographical zones (if any)
๐ Constraints (e.g., emissions limits)
๐ You can start from a template which can be provided.
2. Time Series File (.json)ยถ
This file provides time-dependent data, such as:
Electricity demand profiles
Heat demand
Wind capacity factors
Solar irradiation
Dynamic pricing (if applicable)
๐ Organize your input files like this:
morpheus_project/
โโโ data/
โ โโโ demand_el.json
โ โโโ ...
โ โโโ cf_wind.json
โโโ MORPHE2US.xlsx # your Excel inputs
โโโ MORPHE2US_pipeline.py # the parser
โ๏ธ Step 2: Generate the Modelยถ
Use the MORPHE2US parser script to convert your input files into a Spine Toolbox-compatible database.
๐ง Commandยถ
Run the following command from your project root:
python MORPHE2US_pipeline.py --excel MORPHE2US_Scenario_1.xlsx --output output_Scenario_1.json
The โexcel and โoutput parameters arenโt mandatory and are by default replaced by MORPHE2US.xlsx & output.json. When you use the default names, the simple following command can be executed:
python MORPHE2US_pipeline.py
This script:
โ Validates and parses the Excel/JSON files
๐ Converts the structure into Spine-compatible format
๐งฑ Creates a .json database ready to be loaded into Spine Toolbox
๐ก You can re-run the parser any time you update your input files.
๐งฉ Step 3: Load the Model into Spine Toolboxยถ
Now that the .json database has been created, you can open it using Spine Toolbox.
๐ Stepsยถ
Launch Spine Toolbox
Create or open a project with at least the following components:
1 Data Store (input SQLite database)
1 Run SpineOpt (optimization engine)
1 Data Store (output SQLite database)

In the input Data Store, use the integrated โImportโ function as shown below:

Once the changes have been made to the Data Store, commit them to save.
๐ Step 4: Verify and Validateยถ
Before running your model in Spine Toolbox, it is crucial to verify and validate the imported data to ensure accuracy and completeness.
๐ What to Checkยถ
1. Technologiesยถ
Verify that all technologies (e.g., wind turbines, electrolyzers) are correctly listed.
Check that their parameters (e.g., efficiency, costs, emissions) are filled and realistic.
2. Time Seriesยถ
Ensure that time series data (e.g., demand profiles, capacity factors) match the required resolution (hourly, daily, etc.).
Confirm that the time series aligns with the simulation timeline.
3. Nodes and Carriersยถ
Check that all nodes (e.g., electricity grid, heat network) and carriers (e.g., electricity, hydrogen) are correctly defined.
Validate that connections between nodes are properly established.
4. Parametersยถ
Review key parameters:
Costs (investment, operational)
Efficiencies
Emissions factors
Capacity limits
5. Scenarios and Temporal Layersยถ
Ensure that scenarios (below โMapsโ in Spine) are correctly defined.
Verify that years and time slices are properly configured.
โ Step 5: Ready to Runยถ
Your MORPHE2US model is now fully structured and loaded into Spine Toolbox.
You can now proceed to the next step:
๐ Running the Model