WOLFRAM SYSTEMMODELER TUTORIAL

Simulation CenterIntroduction

Introduction | Options | Experiment Browser | Plot Windows | 3D Animation | Initializing Experiments | FFT Analysis | Importing and Exporting | Keyboard Shortcuts | Input Variable Data Files | CombiTimeTable File | Simulation Settings Files | Simulation Result Files | Communication with Simulation

By default, Simulation Center starts with three windows: the Experiment Browser (A), a plot window (B), and the Log (C). The Experiment Browser and Log can be dragged and dropped wherever preferred within the main window of Simulation Center, or outside to make windows floating. The plot windows can be dragged and dropped within the main window, but not outside.

1.gif

Customizing the Windows

All Simulation Center windows, except plot windows, can be dragged and dropped anywhere within the main window or outside it as floating windows.

The window locations and sizes are saved when the application is closed, and restored when the application is opened the next time. To reset all windows to the default configuration, choose View Reset Window Layout.

Version and License Details

The version of Simulation Center can be found by choosing About SystemModeler from the Help menu.

2.gif

The About SystemModeler dialog box.

The dialog will also show the name of the licensee and the activation key. Click the System Information button to get more information about, for example, compilers, the WSMLink, and Modelica libraries.

Creating New Experiments

A new experiment is created by choosing New from the File menu. This will open a dialog where you specify which model you want to create an experiment for. Select the desired model from the model dropdown list. The model dropdown list contains all models that are currently open in Model Center. It is also possible to create an experiment for any model that is loaded into the SystemModeler environment by typing the name of the model and pressing the Enter key.

When you select the desired model and click OK or press Enter, a new experiment with the most recent updates of the model will be created. The new experiment will be initialized from the experiment settings in the model; see Options for how to set the experiment settings for a model. All values that are not defined by the model's experiment settings will be initialized from the default experiment settings; see the section on default experiment settings.

3.gif

The New Experiment dialog box.

Note that if the model is later edited in Model Center, the experiment will not be automatically updated. To use the updated model, use the rebuild functionality (see section Rebuild Experiments) or create a new experiment.

If the translation process fails, for instance because the model is erroneous, an error message will be shown in the Log window.

Rebuild Experiments

If the model is edited in Model Center, the experiment needs to be rebuilt in order for it to use the most current model code. To rebuild the currently active experiment, choose Simulate Rebuild or click the Rebuild button in the Experiment Browser.

The Rebuild button in the Experiment toolbar.

If any parameter value or initial value in the experiment is not equal to that specified in the model, the Resolve Conflicts dialog will appear. In this dialog you can select if the value from the model or the value from the experiment should be used.

5.gif

The Resolve Conflicts dialog.

Open Experiments

You can open a SystemModeler experiment file (*.sme) in Simulation Center by choosing File Open. Alternatively, you can drop one or several SystemModeler experiment files anywhere in the Simulation Center window. Recently used files are available in the File Recent Files menu. Click on one of the menu items to open the corresponding file.

Saving Experiments

To save the currently active experiment, choose File Save. When an experiment is saved for the first time, a dialog box letting you choose a file name and location for the experiment will appear. Experiments are saved as SystemModeler experiment files.

To save the currently active experiment to a new file, choose File Save As.

Closing Experiments

To close the currently active experiment, choose File Close or right-click the experiment name in the Experiment Browser and choose Close.

Simulating

Starting a Simulation

To simulate the active experiment, choose Simulate from the Simulate menu or click the Simulate button on the Experiment Browser. During the simulation, the current simulation time (model time) is shown in the Experiment Browser toolbar. To simulate several experiments in parallel, switch to the desired experiments one at a time and click the Simulate button.

If a plot window is already open for the experiment that is being simulated, the window will be updated on a regular basis during the simulation with the values of the selected plot variables in the Experiment Browser. This makes it possible to study partial results of simulations before the simulation is completed.

6.gif

The Experiment Browser toolbar.

7.gif

The Simulate button in the Experiment Browser toolbar.

Interrupting a Simulation

An ongoing simulation can be interrupted at any time by choosing Simulate Stop or by clicking the Stop button on the Experiment Browser toolbar.

8.gif

The Stop button in the Experiment Browser toolbar.

Resuming an Interrupted Simulation

It is possible to resume an interrupted simulation by choosing Simulate Resume. This will initialize all state variables and discrete variables to the value they had at the time that the simulation was interrupted and continue the simulation from that point in time.

Pausing a Simulation

An ongoing simulation can be paused at any time by choosing Simulate Pause or by clicking the Pause button on the Experiment Browser toolbar. To continue the simulation, click the Pause button again.

9.gif

The Pause button in the Experiment Browser toolbar.

Transfer Results to Mathematica

The result from a simulation can be copied to Mathematica by clicking the Copy result as Mathematica object button on the Experiment Browser toolbar. This will place code for importing the simulation result to Mathematica on the clipboard. To complete the transfer, paste the content into Mathematica. It is also possible to copy the trajectory for a specific plot variable by right-clicking the desired plot variable in the Plot tab and selecting Copy as Mathematica object.

The Copy as Mathematica object button in the Experiment Browser toolbar.

Viewing Generated Code

The generated C code can be viewed by choosing View Generated Source Code. That will open the source view for the active experiment. To search for a string in the source view, choose Edit Find. In the find dialog that pops up, type in the search string and press Enter to go to the next match.

Introduction | Options | Experiment Browser | Plot Windows | 3D Animation | Initializing Experiments | FFT Analysis | Importing and Exporting | Keyboard Shortcuts | Input Variable Data Files | CombiTimeTable File | Simulation Settings Files | Simulation Result Files | Communication with Simulation