.. _tracking a setpoint: Tracking a Setpoint ~~~~~~~~~~~~~~~~~~~ .. image:: ../../images/graig-coch-2117306_640.jpg .. :href: https://pixabay.com/en/graig-coch-dam-wales-reservoir-uk-2117306/ .. pixabay content is released under a CC0 Public Domain licence - no attribution needed Overview -------- The purpose of this example is to understand the technical setup of an RTC- Tools simulation model, how to run the model, and how to access the results. The scenario is the following: A reservoir operator is trying to keep the reservoir's volume close to a given target volume. They are given a six-day forecast of inflows given in 12-hour increments. To keep things simple, we ignore the waterlevel-storage relation of the reservoir and head-discharge relationships in this example. To make things interesting, the reservoir operator is only able to release water at a few discrete flow rates, and only change the discrete flow rate every 12 hours. They have chosen to use the RTC- Tools simulator to see if a simple proportional controller will be able to keep the system close enough to the target water volume. The folder ``\simulation`` contains a complete RTC-Tools simulation problem. An RTC-Tools directory has the following structure: * ``input``: This folder contains the model input data. These are several files in comma separated value format, ``csv``. * ``model``: This folder contains the Modelica model. The Modelica model contains the physics of the RTC-Tools model. * ``output``: The folder where the output is saved in the file ``timeseries_export.csv``. * ``src``: This folder contains a Python file. This file contains the configuration of the model and is used to run the model . The Model --------- The first step is to develop a physical model of the system. The model can be viewed and edited using the OpenModelica Connection Editor (OMEdit) program. For how to download and start up OMEdit, see :ref:`getting-started-omedit`. Make sure to load the Deltares library before loading the example: #. Load the Deltares library into OMEdit * Using the menu bar: *File -> Open Model/Library File(s)* * Select ``\Deltares\package.mo`` #. Load the example model into OMEdit * Using the menu bar: *File -> Open Model/Library File(s)* * Select ``