Menu

VirGIL

Anonymous

Introduction

The Virtual Grid Integration Laboratory (VirGIL) is a modular co-simulation platform designed to study interactions between demand response strategies, building comfort, communication networks, and power system operation. It couples power systems, buildings, communications, and control and optimization under a master algorithm. VirGIL uses a modular architecture, based on the Functional Mock-up Interface (FMI), where several different modules can be added, exchanged, and tested. It further integrates Quantized State System (QSS) methods for simulation. VirGIL couples a commercial power system simulation tool, trusted by power system operators, DigSILENT Powerfactory. The goal is to reduce the barriers to the industry for adopting, investigating, and subsequently deploying demand response strategies in their daily operation. The current use case uses the LBNL network and real consumption data.

How to Install and Run VirGIL

Steps:

  1. Install Ptolemy (see instructions below)
  2. Install OMNET (see instructions below)
  3. Install PowerFMU_Server on Windows: go to VirGIL/Powerfactory-Windows/ and read the Install_PowerFMU.docx for instructions
  4. Get the IP Address of the Windows Machine and create the PowerFMU for Linux. Go to VirGIL/PowerFMU-Linux and read the instructions.
  5. Run Ptolemy

Simple Demo of the Building and the PV only

  1. Open VirGIL-DEMO/BuildingFMU_2FMUs/VirGIL_Final_LoadSheddingPercent_2FMUs_ONLY_BuildingPV/ElectricalBuildingComm_Complex_New_Composite.xml
  2. Run it (press the triangle that looks like play) -- this demo is only for the buildings and the PV and does not require connection to the Windows Server for Powerfactory

Full VirGIL Demo

  1. Start the Windows Server for Powerfactory (see instructions in VirGIL/Powerfactory-Windows/Install_PowerFMU.docx)
  2. Make sure you have created the PowerFMU with the correct IP Address for your Windows Server and have replaced the powerfmulocal.fmu file inside VirGIL-DEMO/BuildingFMU_2FMUs/VirGIL_Final_LoadSheddingPercent_2FMUs_local/ (see instructions in VirGIL/PowerFMU-Linux)
  3. Only after replacing the correct FMU go to the next step.
  4. Open VirGIL-DEMO/BuildingFMU_2FMUs/VirGIL_Final_LoadSheddingPercent_2FMUs_local/ElectricalBuildingComm_Complex_New_Composite.xml
  5. Press Play
  6. The only reason this should not work is if Modelica FMUs are asking for the DYMOLA License Server. The only case this should happen is due to the Controller, i.e. VirGilControl_GridController_0SCH.fmu. We will fix that.

Linux Installation of Ptolemy

Get the necessary packages

sudo apt-get install subversion 
sudo apt-get install default-jdk 
sudo apt-get install ant

Ptolemy Standard Berkeley Version

svn co https://repo.eecs.berkeley.edu/svn-anon/projects/eal/ptII/trunk ptII
cd ptII
export PTII=`pwd` 
./configure
ant
cd bin
make
./vergil

If you have build errors with ant:

sudo apt-get install eclipse-platform
eclipse
workbench
New Java Project
Name: ptII_qss
Location: the whole ptII folder
Allow output folders for source folders (this is a checkbox)
Then, create the project
Right click on the project name
Run As... --> Run Configurations... 
Java Application
Name: vergil
Main Class: ptolemy.vergil.VergilApplication
Run

TO RUN PTOLEMY:

go to the folder ptII

cd ptII
export PTII=`pwd`
./bin/vergil

Linux Installation of OMNET++ for VirGIL

This is a quick “check-list” with the steps needed to install the commsFMU.

Install all OMNeT++ dependencies.

OMNeT++ requires that the Ubuntu machine where it is going to be run count with a number of installed libraries. To do so, run the following commands on a terminal window:

sudo apt-get update
sudo apt-get upgrade

Answer “yes” to the question in case there exist new updates.

sudo apt-get install build-essential gcc g++ bison flex perl tcl-dev tk-dev libxml2-dev zlib1g-dev default-jre doxygen graphviz libwebkitgtk-1.0-0 openmpi-bin libopenmpi-dev libpcap-dev

Install simulator libraries. In order for the FMU to work, it needs to access the simulator libraries. These libraries are placed at VirGIL//OMNeT/FMU_installation/simulator_libraries. Copy all .so files in the simulator_libraries folder into the file system. When shared libraries are used in Ubuntu, the operating system looks for libraries in the current path and in paths contained in the $LD_LIBRARY_PATH environment variable. For this reason, we need to include the folder where we copied the simulator libraries in this variable. The easiest (and permanent) way is to include this variable in the .bashrc script, which is run every time a user logs in. To do so, edit the file placed in ~/.bashrc with any text editor (notice it is a hidden file, so it won't be visible in the file explorer) and copy at the end of the file the following line:

export LD_LIBRARY_PATH=absolute_path_to_the_simulator_libraries

where “absolute_path_to_the_simulator_libraries” is … the absolute path where you placed the simulator libraries. Save and close the file. For this change to take effect you need to re-log in the system. You can do so by typing: “su – your_user_name” in a terminal window.

Now you should be able to work with the commsFMU.


Related

Wiki: Mission

MongoDB Logo MongoDB