Poles position

612 views
565 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
612
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Poles position

    1. 1. Poles Position A preliminary study for a unified time-series model data warehouse Davide Moraschi Competitiveness and Sustainability
    2. 2. <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 .
    3. 3. 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.
    4. 4. 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:
    5. 5. <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>
    6. 6. 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.
    7. 7. 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
    8. 8. Dimension Subscript Dimension Element Element Element Vector Range, Subrange Set Variable Variable Parameter Common name Vensim name GAMS name
    9. 9. WOOD = Variable CATCUSTOMER = Vector [AUT,URBAN,LPETROL] = Dimension AUT = Element
    10. 10. TSTRAD = Variable SS = Vector ( mmpdr , aus , nzl ) = Dimension mmpdr = Element
    11. 11. 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
    12. 12. VARIABLES EXECUTIONS DIMENSIONS VALUES ELEMENTS VECTORS Many-to-Many Many-to-Many Many-to-Many One-to-Many Many-to-Many
    13. 13. 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.
    14. 14. http://test.jrc.es/morasdaTests/Viewer.cfm
    15. 15. retval& = vensim_get_data( ByVal FileList(v%), ByVal VarList(i%) & SubList(ii%), ByVal &quot;time&quot;, varvals(0), timevals(0), ByVal ZERO) gdxdatareadstrstart(ap&, synr&, nrrecs&) gdxdatareadstr(ap&, astrelements, avals, afdim&)
    16. 16. 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

    ×