Poles Position A preliminary study for a unified time-series model data warehouse Davide Moraschi Competitiveness and Sustainability
<ul><li>Google search on keywords Vensim AND database gives an extremely low number of results . </li></ul><ul><li>The documentation of the software says : </li></ul>Database Notes The structure of the database will determine both the complexity of the statements needed to pass information back and forth with Vensim and the efficiency with which these statements can be executed. If you are passing small amounts of data then it is best to use the most convenient database structure and write very explicit queries and output statements. If you are passing a larger amount of data you may want to emulate the simple example that comes with Vensim . You can then use Triggers or other mechanisms supported by the database you are using to do any necessary internal transformations prior to Vensim’s database reads and successive to its database writes .
Simple Database Example The model odbctest.mdl along with the Microsoft Access Database odbctest.mdb provides a simple example of the ODBC connectivity. The database has a table describing variables along with a unique index for each variable subscript combination. There are no internal constraints on referential integrity in this database, but those should be included for a more complete application.
Data access from Vensim is done via ODBC and vdi/vdo files. The syntax of these files is briefly explained in the documentation: VDI files are treated as standard changes files and read when simulation starts:
<ul><li>Google search on keywords Gams AND database gives an acceptable number of results . </li></ul><ul><li>Most of them refer to <Grant Application Management System>, <Guide to Available Mathematical Software>, < Geospatial Analysis and Modeling Section>, and so on. </li></ul><ul><li>There is a very detailed article written by Erwin Kalvelagen on how to interface Gams and other applications, but there is no mention to how a database should be designed. </li></ul>
Data access from GAMS is done via GDX files. This is a proprietary binary format, and several tools are available to produce such files from different sources.
In order to create a “common” database we must first create a “common” nomenclature. In Vensim we speak about Variables, Subscripts, Ranges, Subranges In GAMS we speak about Parameters, Sets, Elements
Dimension Subscript Dimension Element Element Element Vector Range, Subrange Set Variable Variable Parameter Common name Vensim name GAMS name
WOOD = Variable CATCUSTOMER = Vector [AUT,URBAN,LPETROL] = Dimension AUT = Element
TSTRAD = Variable SS = Vector ( mmpdr , aus , nzl ) = Dimension mmpdr = Element
TIME SERIES Identification TIME SERIES Value … 0.5853 0.5868 0.5875 0.5906 … 1998 1997 1996 1995 … 5 Y1995 4 Y1994 7 Y1993 5 Y1992 1 Y1976
Visual Basic GDX File VPM File GDXIO.DLL VENDLL32.DLL OO4O GDXIO and VENDLL32 are standard windows API libraries, can be called from any DLL compliant programming language. OO4O is a COM interface, can be called from any COM aware programming language.
SQL2GMS is a tool to convert data from an SQL database into GAMS readable format. The source is any data source accessible through Microsoft’s Data Access components including ADO , ODBC and OLEDB . The target is a GAMS Include File or a GAMS GDX File . SQL2GMS, Version 3.0, November 2006 Erwin Kalvelagen, GAMS Development Corp