A complete Windows installer is available from the Deltares Download Portal. This will install a self-containing RTC-Tools 2 configuration including all prerequisites, and will not conflict with other Python or JModelica installations on the system.
- Download the installer from the Deltares Download Portal.
- Start the installation by opening the downloaded executable.
- Choose the desired location for RTC-Tools 2.
- Run the Basic Example via the Start Menu.
If the installation was succesful, you should see that the solver succeeds:
RTC-Tools 2 has the following system dependencies:
- Python >= 2.7 (not Python 3)
- JModelica == 1.16 (CasADi 2.4) with:
For most Linux distributions only Python is available from the standard repositories. JModelica and its dependencies will need to be built and installed from source. We refer to their respective installation instructions, and list below the instructions pertaining to RTC-Tools itself.
Acquiring the source¶
The latest RTC-Tools source can be downloaded using git:
# get RTC-Tools source git clone https://gitlab.com/deltares/rtc-tools.git # Get RTC-Tools's Modelica library git clone https://gitlab.com/deltares/rtc-tools-channel-flow.git
Ubuntu / Debian¶
Building RTC-Tools requires one additional Python package over JMmodelica:
# Change directory to where RTC-Tools was downloaded cd rtc-tools # Install additional dependencies of RTC-Tools pip install mock
Now all that remains is to actually build and install RTC-Tools:
python setup.py install
To check whether the installation was succesful, the basic example can be used. It is importent first to set the correct environment variables for JModelica and RTC-Tools. Luckily, JModelica comes with a convenient script which does most of this for you. Only the environment variable pointing to the Deltares Modelica library remains for the user to set:
export DELTARES_LIBRARY_PATH=\`readlink -f ../rtc-tools-channel-flow\` cd examples/basic/src # Set the correct environment variables, and run the example /path/to/JModelica/bin/jm_python.sh example.py
Building RTC-Tools on Windows is easiest by using the JModelica SDK. Be sure to:
- Build using JModelica’s CasADi 2.4 branch
- Update CasADi to the required version (see dependencies)
A further dependency is on Cython. Instructions for building extensions on Windows are available in the Cython docs.
Using the Visual C++ 2008 32-bit Command Prompt, it is then possible to build and install RTC-Tools by running:
python setup.py install
To check whether the installation was succesful, the basic example can be used. It is importent first to set the correct environment variables for JModelica and RTC-Tools. Luckily, JModelica comes with a convenient script which does this for you. Only the environment variable pointing to the Deltares Modelica library remains for the user to set:
set DELTARES_LIBRARY_PATH=C:\path\to\rtc-tools-channel-flow cd /D C:\path\to\rtc-tools\basic\src # Set the correct environment variables, and run the example C:\path\to\JModelica\Python.bat example.py
RTC-Tools uses the Modelica language to describe the mathematics of the system we wish to optimize. There are several editors for Modelica models, but the OpenModelica Connection Editor, or OMEdit, is a free and open-source graphical connection editor that can be used to construct RTC-Tools models. To download it for windows, click here: https://www.openmodelica.org/download/download-windows
Once installed, you can start OMEdit by clicking:
Start -> All Programs -> OpenModelica -> OpenModelica Connection Editor
With OMEdit installed, you can start using it by following along with the basic example, examples/basic.
RTC-Tools is run from a command line shell. If you installed using the Windows executable, the RTC-Tools Shell can be started by clicking:
Start -> All Programs -> RTC-Tools -> Shell
Once you have started the shell, navigate to the
src directory of the case
you wish to optimize, e.g.:
Then, to run the case with RTC-Tools, run the
src python script, e.g.:
You will see the progress of RTC-Tools in your shell. All your standard shell commands can be used in the RTC-Tools shell. For example, you can use:
python example.py > log.txt
to pipe RTC-Tools output to a log file.