You are here

Working with external data : Worked Examples

Using the scenario file mechanism

Choose the use-case that is closest to your own requirement. Note, however, that in a typical application you will probably have more than one instance of some of these approaches, and you will be mixing several approaches. For example, one model may have several single-valued variables, some spatial data, and some time-series data. Together, these constitute the 'scenario'.

One a scenario has been set up according to the various use-cases detailed below, and saved in a scenario file, the scenario file can be loaded in subsequent Simile sessions simply by loading it in the scenario (parameter) file dialogue window.

Case 1: providing a single value for a scalar (single-valued) variable

The variable could represent, for example, a model parameter, a site condition, or be used to set the initial value of a compartment.

Case 2: providing a set of values for a variable inside a multiple-instance submodel: values stored in the scenario file

You can use this method if the variable is inside a submodel with a small number of instances.

Case 3: providing a set of values for an array variable: values stored in the scenario file

You can use this method if the variable is an array with a small number of elements.

Case 4: providing a set of values for a variable in a fixed-membership multiple-instance submodel: values stored in a separate file

You can use this method if the variable is inside a submodel with a large number of instances.

Case 5: providing a set of values for an array variable: values stored in a separate file

You can use this method if the variable is an array with a large number of elements

Case 6: providing values for 2-dimensional array or submodel variables

Arrays with 2 or more dimensions can be specified in a variety of ways

Case 7: Providing data for points in a time series

Each point may be a single value or an array of values; special points also discussed.

Scenario files can contain information for all the file parameters in a model, or just those relating to a single submodel, or a certain part of the submodel hierarchy. If you have a model which has file parameters spread across a lot of submodels, then the file parameter dialogue will include a lot of nested sunken frames, coresponding to the nested submodels containing the parameters. Each of these frames has a title, which is 'TOP LEVEL' for the whole model, or the caption for a submodel. To the right of this is a set of buttons, for clearing, loading and saving the parameters in that submodel and those contained within it. Saving parameters for submodels allows you to keep separate sets of parameters for different parts of your model, and to build scenarios by loading separate scenario files for different parts of the model, rather than having a single file for each possible combination of sub-scenarios.

Important: a scenario file must be loaded into the same submodel context from which it was saved, since the locations of the parameter components are specified relative to that submodel context.

In: Contents >> Working with external data