Creating and Removing a Variable Alias (Ghost)

A variable alias (also called a ghost) is a copy of a stock, flow, converter, or module that lets you use the original variable elsewhere in your model. The variable alias isn't a new, separate variable. Instead, it's a shortcut to the original variable.

Variable aliases help you keep your diagrams tidy by letting you use the same variable in separate locations in your model. This helps you keep connections neat, as the following pictures illustrate.

Note: You can also use the ghost tool to connect variables across modules and to assign module inputs and outputs automatically.

A ghost of a variable has no independent identity; it's just an image of the building block that it was ghosted from. The ghosted replica has no equation of its own. When you double-click a ghosted replica, the Equation panel that opens belongs to the original variable that the replica copies. No matter how many ghosted replicas of a given building block you create, only one equation exists, because only one building block exists. You can change the styles for each ghost separately, but nothing else.

A ghost adds no real structure to a model. Ghosted stocks have no inflows or outflows; ghosted flows and ghosted converters (when you "ghost" a flow, its ghost appears as a converter) have no input connectors. Ghosts are read-only information holders. You can draw connectors from them. Nothing can go into them.

Ghosting Modules

If you create a ghost of a module you can use it to connect to other modules or to cross level module outputs use in the model. For example:

To create connections from a ghost of a module first create the cross level ghost from the original module, then draw a connector from the ghost of the module to the cross level output (module 1.in module 1) or to the other module (Module 3). Changing the connector will allow you to clean up appearance, but has no effect on module structure.

To Create an Alias

  1. In Edit mode, navigate to the stock, flow, or converter you want to create an alias for.
  2. On the Build toolbar, click the ghost tool .
  3. Click once on the stock, flow, or converter that you want to ghost.

    The mouse pointer changes from the ghost pointer to a small image of the type of building block you're ghosting.

  4. Click the diagram where you want to place the ghost.

  5. Use the ghosted variable by adding connections between it and other model variables as needed.

Note At step 3 instead of clicking on an existing variable you can click on a blank part of the model and then select a variable from the find dialog that appears. This lets you add the ghost without scrolling to the original variable position.

To Remove an Alias

If the ghost has no connectors out of it you can select it and delete it. If the ghost does have connectors out and you delete it the equations it is used in via those connectors will be marked invalid. To leave the equations valid you can drag the ghost onto the original variable (or another ghost of that variable) and the ghost will be removed and its connectors changed to start from the variable you dragged onto. No changes will be made model equations in this case.

Concept Link IconSee Also