Setting-up your first model (tutorial)

This is a step-by-step guide on how to set up your first model using the EBM model.

1. How to run the program from the command line?

For the commands to be excuted locally or in an IDE, it must be launched as a module rather than a program.

Example:

ebm heating-systems

should be excuted like:

python -m ebm heating-systems

2. Additional arguments

ebm <--switch> <step> <output filename>

The parameters listed above are optional. The default choice for the step parameter is energy-use, and the default output filename is output/ebm_output.xlsx.

Difference between switch and step

Option

Description

switch

Always preceded by --. Used to ensure different running options a user may want to use. Examples include: --help, --version, --debug and --open. A more detailed explanation of the options can be found using the --help switch.

step

Represents the calculation step you want to run. The steps are sequential. Any prerequisite to the chosen step will run automatically. The four steps available are: area-forecast, energy-requirements, heating-systems and energy-use.

3. Example of how to run your first model: test

Help command

Typing ebm –help will give you a list of most parameters:

ebm --help

  usage: ebm [-h] [--version] [--debug] [--categories [CATEGORIES ...]] [--input [INPUT]] [--force] [--open] [--csv-delimiter CSV_DELIMITER] [--create-input] [--horizontal-years] [{area-forecast,energy-requirements,heating-systems,energy-use}] [output_file]

Calculate EBM energy use 1.1.10

positional arguments:
  {area-forecast,energy-requirements,heating-systems,energy-use}

                        The calculation step you want to run. The steps are sequential. Any prerequisite to the chosen step will run
                            automatically.
  output_file           The location of the file you want to be written. default: output\ebm_output.xlsx
                            If the file already exists the program will terminate without overwriting.
                            Use "-" to output to the console instead

options:
  -h, --help            show this help message and exit
  --version, -v         show program version number and exit
  --debug               Run in debug mode. (Extra information written to stdout)
  --categories [CATEGORIES ...], --building-categories [CATEGORIES ...], -c [CATEGORIES ...]

                        One or more of the following building categories:
                            house, apartment_block, kindergarten, school, university, office, retail, hotel, hospital, nursing_home, culture, sports, storage_repairs.
                            The default is to use all categories.
  --input [INPUT], --input-directory [INPUT], -i [INPUT]
                        path to the directory with input files
  --force, -f           Write to <filename> even if it already exists
  --open, -o            Open <filename> with default application after writing. (Usually Excel)
  --csv-delimiter CSV_DELIMITER, --delimiter CSV_DELIMITER, -e CSV_DELIMITER
                        A single character to be used for separating columns when writing csv. Default: "," Special characters like ; should be quoted ";"
  --create-input
                        Create input directory containing all required files in the current working directory
  --horizontal-years, --horizontal, --horisontal
                        Show years horizontal (left to right)

4. Calculate the projected annual area requiring heating

# This is the default cammand, where the output file is area-forecast-vertical.xlsx located
# in the output directory
# The output file will be written in vertical format
ebm area-forecast output/area-forecast-vertical.xlsx
Output from using the command above

Building_category

TEK

Building_condition

Year

m2

House

PRE_TEK49

original_condition

2020

941109.5047

house

PRE_TEK49

original_condition

2021

494082.49

house

PRE_TEK49

original_condition

2022

494082.49

If the user wants the output file in horizontal format, the user can use the following command:

# This command will write the output file in horizontal format with the name area-forecast.xlsx
ebm --horizontal area-forecast output/area-forecast.xlsx
Output from using the command above (horizontal format)

building_category

TEK

building_condition

U

2020

2021

2022

house

PRE_TEK49

original_condition

m2

941 110

494 082

494 082

house

PRE_TEK49

small_measure

m2

1529 303

1976 330

1976 330

house

PRE_TEK49

renovation

m2

0

0

0

5. Calculate energy-requirements

The energy-requirements is calculated by multiplying the heating demand per square meter by the area from the previous step.

# This is the default cammand, where the output file is energy-requirements-vertical.xlsx located
# in the output directory
ebm energy-requirements output/energy-requirements-vertical.xlsx
Output from using the command above

building_category

TEK

building_condition

year

purpose

m2

original_kwh_m2

reduction_yearly

reduction_policy

reduction_condition

reduced_kwh_m2

behavior_factor

kwh_m2

energy_requirement

house

PRE_TEK49

original_condition

2020

heating_rv

941109.5047

155.290712

1

1

1

155.290712

1

155.290712

146145565.1

house

PRE_TEK49

original_condition

2020

heating_dhw

941109.5047

29.78125

1

1

1

29.78125

1

29.78125

28027417.44

house

PRE_TEK49

original_condition

2020

fans_and_pumps

941109.5047

0.58125

1

1

1

0.58125

1

0.58125

547019.8996

If the user wants the output file in horizontal format, the user can use the following command:

# This command will write the output file in horizontal format with the name energy-requirements.xlsx
ebm --horizontal energy-requirements output/energy-requirements.xlsx
Output from using the command above (horizontal format)

building_category

TEK

building_condition

U

2020

2021

2022

house

PRE_TEK49

original_condition

GWh

199

104

104

house

PRE_TEK49

small_measure

GWh

307

395

394

house

PRE_TEK49

renovation

GWh

0

0

0

6. Energy consumption

The energy consumption is calculated by multiplying the energy requirements from the previous step by the efficiency factor.

# This is the default command, where the output file is heating-systems-vertical.xlsx located
# in the output directory
ebm heating-systems output/heating-systems-vertical.xlsx
Output from using the command above

building_category

building_condition

purpose

TEK

year

heating_systems

heating_system_share

eq_ts

RV_GL

Grunnlast energivare

Grunnlast virkningsgrad

RV_SL

Spisslast energivare

Spisslast virkningsgrad

RV_EL

Ekstralast energivare

Ekstralast virkningsgrad

DHW_TV

Tappevann energivare

CL_KV

O_SV

RV_HP

hp_source

kwh

gwh

apartment_block

original_condition

cooling

PRE_TEK49

2020

DH

0.20675904

0

0

DH

0.99

0

Ingen

1

0

Ingen

1

0

DH

0

0

0

0

0

apartment_block

original_condition

cooling

PRE_TEK49

2020

DH - Bio

0.003394661

0

0

DH

0.99

0

Bio

0.65

0

Ingen

1

0

DH

0

0

0

0

0

apartment_block

original_condition

cooling

PRE_TEK49

2020

Electric boiler

0.056017026

0

0

Electricity

0.98

0

Ingen

1

0

Ingen

1

0

Electricity

0

0

0

0

0

7. Holiday homes energy consumption

# This is the default command, where the output file is energy-use-vertical.xlsx located
# in the output directory
ebm energy-use output/energy-use-vertical.xlsx
Output from using the command above

building_category

energy_source

U

2020

2021

2022

Bolig

Elektrisitet

GWh

42133

42039

41926

Bolig

Fjernvarme

GWh

2727

2732

2736

Bolig

Bio

GWh

6138

6123

6094

8. Example case

If the user wants to run the program with input files located in another directory, for instance the “calibration” directory, the user can use the following command:

# This command will run the program with input files located in the "calibration" directory
ebm --input calibration energy-use output/energy-use.xlsx

Last Updated on 2025-11-06.

Version: 1.0.1.