Setting Up Import Links

You can use import links to bring data in from external Excel or CSV files. This greatly simplifies data organization and also lets you have multiple datasets that can be used to run different scenarios or to parametrize your model for different situations. There are two distinct ways to import data. The first brings in constants and graphical functions that directly change the corresponding model equations. The second brings in temporary changes to model variables for a run, or set of runs, that don't change any model equations. The two are discussed separately, but the rules for formatting the source data file are the same in both cases.

Bringing Data Directly into a Model

You can import constants and graphical functions to replace the values entered in your model equations. To do this, you need to create a link between the model and an Excel worksheet or a delimited text file. The worksheet or file should contain the names of the model variables that you want to import data into, and the values that you want to import.

When you set up an import link, you can make the link dynamic, so that it's executed whenever the source file changes, or you can just have it import values in when you explicitly ask it to. You can also disable links without removing them, so that you don't need to set them up again.

If you don't make the link dynamic, you'll need to perform a manual import whenever you want to update the values in the model. You can also perform a manual import on automatic links, but it'll only have an effect when you've changed values in an open Excel worksheet and haven't saved them - otherwise the values will be imported automatically when the file changes.

You can create as many import links as you want per model, but each source can only be used once.

If you're using Excel files, you can set up export and import links to use the same or different Excel files. For example, you can import values from one file into your model, and then export model run values to a different file to retain the "before" and "after" values in separate files. Or, you can import from and export to different tabs in the same file, although with automated links this will trigger another import (because the file changes). Exporting to and importing from the same sheet (or same delimited file) will not work.

Note: Since the software performs an import when you set up a link, you must have created an import file with valid data formats before you set up the link (and for CSV and tab delimited files, you must have saved all changes to the file) in order to import its data.

Note: If your import source includes variables that are not constants, or graphical functions values for those variables, they'll be ignored during the import process.

To Set Up an Import Link

  1. Open the model you want to set up an import link for.
  2. From the Edit menu, choose Import Data.

    The Import Data dialog box will open.

  3. Use the options in the dialog box to choose the file, the worksheet (if applicable), and whether or not to make the link dynamic.
  4. You can add as many links as you want.
  5. When you're finished setting up the import links, click OK.

    The selected data will be imported into the model.

Note: When data are imported automatically, no warning or error messages are given. You should verify the validity of your import file by importing manually when you set up the link. This will give you information about the import.

Temporarily Overriding Model Values

You can also import values that will temporarily override the value of a variable during simulation, but not make any changes to the equations, using Import Control Sheets. The data format for the file is the same, but you can specify any variable in the file, even variables that aren't constants. The value specified will be used in place of the computed value. For example, if the equation for x is y+1, and you've specified a value of 42 in the file, then x will be 42 no matter what value y takes on. If the variable is a graphical function, you can either specify a single value for it to take on, or a series of values to populate the graphical function. If you specify a series of values for a variable that's not a graphical function, only the first one will be used.

Temporary imports are controlled from the Import Control Sheets tab of the Properties Panel for the model. You can have any number of active control sheets drawn from your collection of available sheets. Each time you simulate, the active control sheets will be read. When you're working with Excel files, this means that changes you make will be reflected when you simulate, not when you save the Excel file.

You can specify both temporary and permanent imports, but they cann't come from the same source.

To Override Model Values with an Import Link

  1. Open the model you want to use.
  2. Double-click on a blank part of the model to open the Properties Panel and select the Import Control Sheets tab.

  3. Use the options in the panel to choose the file (and the worksheet) that you want.
  4. Drag the selected file and worksheet into the active list.

    Each time you simulate, the values in the specified source will be used.

Note: When you simulate, no warnings or errors will be shown. To see warnings and errors, click on the test button at the bottom of the panel.

Concept Link IconSee Also