To run a simulation exercise with Lsd it is used:
The table below consists of three columns:
Now you can follow the steps indicated below. Using the program indicated
in the Instr. column follow the instruction at the top of any cell
in the right column. The text in bold indicates either a relevant window
or a menu and the menu entry to choose: menu/menu_entry. Many windows
will pop up during this exercise, partly from the program used, part from
new Netscape windows if you click on a link. Use the icon bar of your screen
to retrive the program you want to access.
Operation | Progr. | Menu choices and Comments |
Run the Lsd model program | LMM |
When Lsd starts, it shows two windows, Browser and Log. The model interfaces are initially empty, since no configuration is loaded. |
Load a configuration file | Lsd |
The Lsd Browser now shows the Object Root as containing some elements. A graphical representation of the model is shown in a new window. The Browser is thought as a control center to issue commands to the Lsd model program, and as the inspector for one Object type. The Browser is always pointed on an Object, and lists its Variables and the contained Objects. IMPORTANT: Close the windows using their buttons or keyboards shortcuts. Killing a window closes the whole Lsd model program. |
Give a first look to the model | Lsd |
The "scheleton" of the model are Objects, elements containing Parameters, Variables, or other Objects. Therefore, a model is represented by a hierarchy of Objects, whose "top" element is conventionally called Root. Root is the only Object that is always present in a model with a single instance, while the other Objects can be multiplied in as many instances as desired. Actually, the number of instances for each Object type is a parameter stored in the configuration file. Users can change these values, as we will see later. Variables and Parameters are labels attached with numbers. The obvious difference is that Variables can change values at each time step using a specific equation, while Parameters don't have an equation (although an equation for a Variable can overwrite the value of a Parameter). The goal of Objects in Lsd models is to contain Variables: multiplying the number of Objects, also all the Variables and the Parameters contained in that Object type are multiplied. This is similar to using vectors, but it is more efficient, and permits to easily create hierarchies. See the Lsd FAQ's for more details. It is possible to explore the model with the Browser (square
window on the top left part of the screen), which shows one single Object's
content. This is shown with some headers and two list boxes: Variables
(and Parameters) and the Descendants, Objects contained in that
type of Object. Variables are indicated with a integer number (the lagged
values used in the model for that Variable), and Parameters are indicated
with the letter "P". Variables labels can also be double-clicked to set
their options and see their documentation (see below).
Another representation of the model is shown (on the right of the Browser) in a symbolic format. It shows the hierarchy of the Objects and indicates also the number of copies, or instances, for each Object type. Moving the mouse pointer over the symbol for one Objects makes appear a small window listing the Variables and Parameters contained in the Object. It is possible to click on the symbol of an Object in the graphical representation of the model to move there with the Browser. Besides showing the content of an Object, the main Browser is the interface
of the Lsd model program. From its manus it is possible to change the configuration,
run a simulation launch the analysis of results, etc.
The structure of a model and the exact role of each item (Object, Variable
or Parameter) depends not only from its own content, but also from its
relation with the rest of the model. To better grasp this aspect Lsd models
offer the Model Reports. These may
The model report is the most useful documentation of the model. It contains all the information presented in such a way to provide very quickly any information requested. Its links permit to see:
Spend some time to "play" with the links of the model report, to see
how they show the model content. Do not try, at least for complex models,
to read systematically the document and to understand the whole model structure.
Just start from one component, look at its equations, or the equations
that use it, and continue along creating your own path through the model
structure.
|
Model Report | Lsd | The structure of a model and the exact role of each item (Object, Variable
or Parameter) depends not only from its own content, but also from its
relation with the rest of the model. To better grasp this aspect Lsd models
offer the Model Reports. These standard HTML documents that can be opened
using the menu Help/Model Report.
(It is possible that for some model configuration the Model Report is not available, which is indicated by an error message appearing when trying to open it. In this case you can create the report with two commands. Choose the command in menu Mode/Generate Automatic Description and after that the command in menu Model/Create Report, accepting the default options.) The reports are extremely useful to understand how the model works. They contain an introductory section with a verbal description of the model and three sections reporting:
|
Run a simulation | Lsd |
A simulation run consist in several time steps, during each of which all the Variables of the models are updated, using their equations to compute the new values. During the simulation run some Variables may be plotted in a self-scaling window called Run Time Plot, if the configuration is set for this. If no Variable is set to be plotted during the simulation (the so-called Run Time Plot), the Log window prints a line for each time step completed. More series are saved in the memory for later analysis (but not all data produced by the model at every time step are saved by default). During a simulation it is possible to use the buttons in the Log window:
|
Analyse the results | Lsd |
This command makes available the data stored in memory after a simulation run, or previously saved on a file (when requested choose Simulation for using the data from the latest exercise, or File to get data from a file). It permits to observe in detail the series of the simulation. The overall structure of this module is to list the elements available for analysis on the left box. Some of these must be selected and moved to the central box for elaboration, activated with the buttons in the lower part of the window. The right box contains the list of the graphs produced. Try to explore the data available (see here for the manual on this topic). There is a large number of possible options to produce time series, cross-section or XY scatter plot graphs. Moreover, users can produce statistics on the data available and save data files in a variety of formats. It is also possible to launch gnuplot, a package for function and data-plotting (Lsd distribution for Windows contains also Gnuplot for Windows, while Unix users are expected to already have it). See carefully the manual
for this module to fully exploit its functionalities.
|
Interpret the results | Lsd
and Netsc. |
When finished, exit the Analysis of Result module with the menu Exit. |
Reload the configuration | Lsd |
After a simulation exercise Lsd contains in memory the values computed at the last time step. The system prevents the use of these values as the starting values of a new simulation run, and therefore a new configuration must be loaded. Note that it is possible to save the model status as new configuration, which can be loaded to continue a simulation exercise. |
Edit the number of instances
for the Objects |
Lsd |
One obvious request to test a simulation model is to modify the number of Objects (and therefore the number of Variables, Parameters and other Objects they contain). With this interface it is possible to modify any group of Objects, always maintaining the same model structure (i.e. the new Objects at higher level in the hierarchy will contain the same type of descending Objects at lower levels. But there will be, by default, only one instance of such descending Objects). See the Lsd help on this. When finished, click on Exit to the return to the Browser. |
Edit the initial values | Lsd |
When starting a simulation Lsd needs to know the values to assign to the Parameters. Moreover, the models usually contain Variables used with past values, that must be inserted for use in the very first steps of the simulation. This command allows users to modify such values, for one Object type. Note that the hierarchical structure of the Lsd models forces to use multi-digit indexing to identify the Object instance containing a given Parameter or lagged Variable value. The initialization of values is requested also for the Objects created when modifying the number of Objects. They are assigned a default value (copied from the very first instance of that type of Object in the model), but usually the user may want to modify this. Although the data may be inserted manually, when there are very many values it is convenient to use the Set All button to set all the initial values for a single line. See the Lsd manual on this. When finished, click on Ok to return to the Browser. |
Edit the simulation settings | Lsd |
Note that running more than a simulation exercise cause the system to save the data in files. |
Edit the choices on which
series to save, to plot at run time, or to debug |
Lsd |
See the Lsd manual on this. These choices can also be changed individually for each element, or can be set off for the whole model using Remove ... in menu Run. |
Save the configuration | Lsd |
|
Run the newly configured model | Lsd |
|
Test other aspects of Lsd | Lsd |
|
Open another model | LMM |
|
Create your own model | LMM | As you have seen, using an existing model permit to modify every numerical aspect of the simulation, but you are constrained to keep the model structure (Objects, Variables and Parameters) and the equations unchanged. This is because the structure influences the way the equations compute their values for the Variables. And the equations are implemented as compiled code within the Lsd model program. Follow the tutorial 3 to learn to create a new Lsd model. |