24.05.2014 Views

pdf: 600KB - Potsdam Institute for Climate Impact Research

pdf: 600KB - Potsdam Institute for Climate Impact Research

pdf: 600KB - Potsdam Institute for Climate Impact Research

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

29<br />

6.6 Representation of the model in a database<br />

Represent a model in a database?! Seems like a strange idea, but consider the following example<br />

implemented in Microsoft Access (Fig. 6.2).<br />

Here we have a relational database with two tables: 'compartment' and 'flow'. The 'compartment'<br />

table has two fields: 'compartment name' and 'initial value'. The 'flow' table has 4 fields: 'flow<br />

name', source and destination compartments <strong>for</strong> the flow ('from' and 'to'), and the flow equation.<br />

This represents a complete specification of the model: an appropriate human (or computer-based)<br />

interpreter could write a program to simulate the behaviour of the model so defined. Though a<br />

simple example, it could be easily extended to handle parameters, intermediate variables,<br />

submodels, etc.<br />

But - it's in a database! So we could also do normal database-type operations: interrogate the<br />

structure of the model ("tell me the equations <strong>for</strong> all flows associated with the compartment<br />

'water'"); or print out a summary report on the model (number of compartments, number of<br />

outflows and inflows). If we add a 'model ID' field to each table, then we could store in<strong>for</strong>mation<br />

on many models in a single database, put it onto a web-enabled database, and enable anyone to<br />

retrieve models according to their structure, through their web browser. In other words, we can<br />

now do many things with the model that we could not do if it were implemented merely as a<br />

computer program in a conventional programming language.<br />

Fig. 6.2 Representation of the model in an Access database.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!