The lookup table block computes an approximation to some function y=f(t) given data vector y. By default t is the current time point of the simulation, but can also be sent as an argument when calling the lookup table.
From the Projects window
From the Matrix window
From the Blocks window
Place the mouse cursor over the table and right-click on it. Select New | Lookup Table from the pop-up menu, or
In the title bar, select Lookup Table from the Type drop-down list and click on the button.
The block editor is shown by right-clicking the block in a window and selecting Edit. In the Blocks window, you can also show the block editor by selecting the block and clicking the button, or by double-clicking the right-most “validation” column of the block.
The block editor has three tabs:
|Note||Most block properties can be edited directly in the Blocks window.|
This page lets you edit basic properties such as name, sub-system and base unit. See editing properties for more information.
This page lets you specify time series, values and interpolation options.
Dimension - You can specify the dimension of the block by using the Type drop down list. Depending on the dimension the index drop down lists are activated.
Interpolation - The interpolation field will determine how values before, between and after the time-points are interpolated/extrapolated.
Interpolation-Extrapolation – Values between the specified time-points are linearly interpolated. Values before the first time point and after the last time-point will be extrapolated.
Interpolation-Use end values – Values between the specified time-points are linearly interpolated. The value for the first time point will be used when time is less than the first time point. The value for the last time point will be used when time is larger than the last time point.
Use input nearest – For each simulation time point the value for the nearest specified time is used.
Use input below – For each simulation time point the value for the nearest of the lower specified time points is used. If none of the specified time points is lower, then the nearest of all specified time points is used.
Use input above – For each simulation time point the value for the nearest of the higher specified time points is used. If none of the specified time points is higher, then the nearest of all specified time points is used.
Cyclic - When selected the time series will be “looped” and all values repeated. This feature is useful for periodic data, for instance one year dayly data of precipitation. Note that for cyclic lookup tables the final value(s) must be the same as the first value(s).
Lookup key - The key used when looking up data in the table.
Import - This button lets you import values for this lookup table from an Excel file. The recommended practise for importing values is to first export an empty lookup table with the correct indices and options as a template. In Excel, open the template and copy-paste the values into the template. When the data is added, the template can be imported into Ecolego again.
Export - This button lets you export values for this lookup table from an Excel file.
Data - The table always displays an empty last row where you can enter new values. Please note that values must be entered for each time point, although you may have different time points for different indices. If the lookup table has more than one dependency, a drop down list will be presented for each dependency where you can select the indices for which you enter data. The lookup table contains the following columns:
Time – This is where you enter the time series. If you have data in Excel, you can copy / paste a column from Excel directly into this table.
Data – This is where you enter the lookup data. If you have data in Excel, you can copy / paste a column from Excel directly into this table.
Link - Instead of filling in data manually, link the lookup table to a simulation result.
Select… - Click to select a result to which to link.
Linked - Select to activate/disactivate the link.
In most cases the lookup table is used for which is time dependent measurements, and where the data for the current time point is used. However, in some cases it can be useful to use the lookup table for other types of data. For instance,
In these cases the caller - the equation(s) referring to the lookup table - must specify the lookup key X. Also, the lookup table must be configured to require the lookup key rather than using the current time point.
As with expressions, a lookup table which requires arguments will never yield a simulation result.
In the Options section of the Values tab, change the Lookup key from Current time to As argument. The name of the “time” column in the Data table should now change to “X”.
As with any block, you specify the name or ID of the lookup table. You then specify the lookup key as a function argument using parenthesis.