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.py in 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ยถ

  1. Launch Spine Toolbox

  2. 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)

  3. In the input Data Store, use the integrated โ€œImportโ€ function as shown below:

  4. 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