Download SOPS User Manual

Transcript
16
4. TRANSFERRING FROM STUDIO TO SOPS
After the model has been developed and tested in Studio, it must be transferred to
SOPS. Before you do this, make sure Studio is in Advance mode
(View>Workspace>Restore User Interface> Advanced). In Advanced mode you will
see an overview of “folders” on the left-hand-side. Right click and change the
“Component 1” name to a name of your liking with only characters and numbers (no
spaces!). Then right-click on “Simulation 1” and choose the option Optimize with
SOPS. This takes you to a “connection window” between Studio and SOPS, see Figure
4.1. Once things work well, you can choose to skip this step and move directly to SOPS
(tick off Build automatically and Continue automatically on successful builds).
Figure 4.1: Connection window
The connection window has five purposes:
- First, it shows that you use the CL (Microsoft) C++ compiler (if the GNU
option is shown, you have to change to Microsoft!). Appendix 1 explains how to install
the C++ compiler.
- Second, it gives error messages during the conversion to C++ code if you have
used functions in Studio that are not supported by SOPS. The error message will
normally show exactly what the problem is. Normally, it should be possible to capture
any relationship you want to include by choosing other modelling options - possibly
more cumbersome ones. Note that functions for randomness (RANDOM and
NORMAL) must be replaced by constants before transferring to SOPS (Variable type
Constant in Advanced window). You have to choose distributions for these constants in
SOPS.
- Third, it compiles the C++ code.
- Fourth, it tests the compiled code. Figure 4.2 shows what is tested. Note that the
C++ code runs about a thousand times faster than the Studio code. This is very
important since SOPS optimization requires large numbers of simulations. Minor
numerical differences may occur because Studio has routines to avoid round off errors.
- Fifth, when everything is ok, you click on continue and the transfer to SOPS
takes place.