Code repository

From HUES Platform Wiki

Welcome to the code repository. The repository includes two types of code elements, "scripts" and "snippets".

  • Scripts are small utility programs for e.g. data processing, transformation or visualization.
  • Snippets are small blocks of useful code that you would like to share with others.

Users with a HUES Platform account may also add new scripts or snippets to the repository.

Add a script or snippet to the repository

Snippets are pasted directly into the wiki. Scripts must be uploaded.

List of scripts

Script nameAuthorTagsDescription
Swiss buildings GIS heat demand databaseStefan Schneider (UNIGE)Geo-dependent Energy DemandThe Swiss buildings GIS heat demand database allows building a database containing an estimation of the yearly final energy demand for space heating and domestic hot water production for each EGID of the Swiss Federal Building Register (Reg-Bl).

The current module provides scripts to create the database and the database tables, to load configuration data and to compute the estimated heat demand per building.

The user of this database needs to make a contract with the Federal Office of Statistics (BFS) to get a copy of the Reg-Bl.
IDF ViewerChristoph WaibelIdf
Pareto front
A tool to load in geometry of multiple IDF files and display these in 3D. Additionally, an associated excel file can be loaded, which refers each IDF-file to a point on a 2D-graph. Now, the user is able to hover over the points of the 2D-graph and display only the 3D-geometry of that IDF file, where the mouse points at. This tool is especially helpful in a parametric study, where multiple design solutions have to be compared quickly. E.g. in a multi-objective optimization, the results can be plotted in the 2D-graph to display a 2-objective Pareto-front and the user may now efficiently elaborate the geometrical relationships between the trade-offs of both objectives .
Read AIMMS solution headerRalph EvinsAIMMS
Energy hub
Read .sol file using manual referencing within the XML as its faster than a full recursive evaluation If nargout == 1, only reads header (inc objective value), which is much faster for big datasets
Parse XMLRalph EvinsMatlabParse an XML file into a Matlab struct
Rolling Horizon AIMMSJulien MarquantEnergy hub model
Rolling horizon
Computational time
Solving the optimal configuration and operating strategy of an energy hub combining multiple energy sources for a whole year can become computationally demanding. Indeed the effort to solve a mixed-integer linear programming (MILP) problem grows dramatically with the number of integer variables. Rolling Horizon approach (RH) is part of the commonly employed decomposition methods; as the Bender decomposition, Lagrangean decomposition, and Bi-level decomposition; used in order to reduce the computational burden to solve mathematical time-dependent problem with high number of variables. Indeed rather than solving a complex problem considering all its time horizon frame, the problem is solved by planning intervals representing a smaller part of the horizon, allowing to reduce the size of the problem per interval, by breaking down one problem in easily solved sub-problems. From an existing AIMMS model, the implementation of a rolling horizon approach is done in two stages: 1) Systematic creation of a second model using Python script '' (procedure described in documentation, section 2.1): 2) Manual tuning directly done on AIMMS file situated in 'MainProject -> ProjectName.ams' (procedure described in documentation, section 2.2).
Edit AIMMS modelRalph EvinsAIMMS
Energy hub
Edit an AIMMS model by manipulating the .ams file
Read AIMMS variable namesRalph EvinsAIMMS
Energy hub
Read variable and constraint names from .lis file
Read AIMMS dataRalph EvinsAIMMS
Energy hub
Execute AIMMS sequenceRalph EvinsAIMMS
Energy hub
EnergyPlus batch run moduleRalph EvinsBuilding simulation
This module automates the setup and execution of multiple building energy models implemented in EnergyPlus, and consists of a set of Matlab scripts for building, editing and running an EnergyPlus model, and parsing the output. The module works by inserting specified parametric objects into a template EnergyPlus IDF file.
  • eplus_run: Execute model
  • eplus_runmulti: Execute multiple models
  • eplus_build: Specifies object properties.
  • eplus_edit: Find and replace an entry for an object in an IDF
  • eplus_readcsv: Read the output data from csv file according to column headings
  • eplus_add: Add an object to an inital IDF
  • eplus_buildpara: Generate all combinations of some options and make associated * parametric objects
  • eplus_paralist: Assign statistical properties and make associated parametric objects
  • eplus_makelayout: Build a complex layout of many zones
Arc-gis to geo-dependent-energy-web-serviceJulien MarquantWebServiceLinking arc-gis database to geo-dependent energy demand web-service. Allowing to extract heating energy demand for each defined rasters in arcgis.

The following script MappingDistrict.cs allows to read your arcgis database in csv format with as arguments the location of the center of your raster in CHLV02 geo referenced system.

As output the script writes back a result file with all informations required according to the information available in the WebService database
Unsupervised k-medoids typical daysJulien Marquant
Georgios Mavromatidis
Typical daysThe typical day method used in Dominguez-Munoz et al. (2011) are implemented in a MATLAB code. The k-medoids clustering method is employed selecting k typical days able to represent the full year demand pro file. 3 peaks days for heating, cooling and electricity demand pro files are added. The k number of days is selected by the user. The unsupervised typical days function select the number k of typical days which best represents the full year demand profile. This is done based on a minimization of error between the load duration curves for heating, cooling and electricity and the Davies-Bouldin index representing the intra and inter clusters relation (Davies and Bouldin (1979)). The user select the number k of typical days depending on the pareto front and the computation time.

List of snippets

Snippet nameAuthorTags
Reading GIS shape file, cleaning data and performing various statisticsPython
Swiss building db
Uploading the model and running cplex solver on the clusterBoran MorvajPython
Batch run CPlex models on Hypatia from MatlabRalph EvinsHypatia
Batch run EnergyPlus models from MatlabRalph EvinsEnergyPlus
Job submission on HypatiaRalph EvinsHypatia
CPlex on HypatiaRalph EvinsHypatia
EnergyPlus on HypatiaRalph EvinsHypatia
Matlab on HypatiaRalph EvinsHypatia
SSH from MatlabRalph EvinsHypatia
Read AIMMS .lis fileBoran MorvajAIMMS
Read cplex .sol fileBoran MorvajCplex
Run AIMMS model from MatLabRalph EvinsAIMMS
Energy hub