TRUST is an open-source software tool developed for data-driven controller synthesis of dynamical systems with unknown mathematical models, ensuring either stability or safety properties. By collecting only a single input-state trajectory from the unknown system and satisfying a rank condition that ensures the system is persistently excited according to Willems et al.'s fundamental lemma, TRUST aims to design either control Lyapunov functions (CLF) or control barrier certificates (CBC), along with their corresponding stability or safety controllers. The tool implements sum-of-squares (SOS) optimization programs solely based on data to enforce stability or safety properties across four system classes:
- continuous-time nonlinear polynomial systems,
- continuous-time linear systems,
- discrete-time nonlinear polynomial systems, and
- discrete-time linear systems.
TRUST is a Python-based web application featuring an intuitive, reactive graphic user interface (GUI) built with web technologies. It can be accessed at https://trust.tgo.dev or installed locally, and supports both manual data entry and data file uploads. Leveraging the power of the Python backend and a JavaScript frontend, TRUST is designed to be highly user-friendly and accessible across desktop, laptop, tablet, and mobile devices. We apply TRUST to a set of physical benchmarks with unknown dynamics, ensuring either stability or safety properties across the four supported classes of models.
If you are a reviewer for the HSCC committee, the instructions for how to install and reproduce the results of our paper can be found here.
We recommend running the tool via Docker, instructions in the installation section following.
A hosted version of the tool is available at https://trust.tgo.dev for you to explore the tool's capabilities, but note that the capacity of the server is limited and is unlikely to perform as well as a local installation.
We have made every effort to ensure the following instructions are comprehensive for the Docker container under consideration.
Docker is used for this project to simplify the installation process. You can download and install Docker by following their instructions for your operating system at https://docs.docker.com/get-docker/.
Since the underlying packages that TRUST uses rely on the MOSEK solver, we will now install the MOSEK license (a free trial is available and it is free for academic users). Fill in your details to get a Mosek license at https://www.mosek.com/license/request/?i=acp.
The license file will be emailed to you with instructions of where to place the file in your home directory. This license is required within the TRUST GUI, where you will be prompted to upload the file.
You can download the repository from Github at https://github.com/thatgardnerone/TRUST. Simply navigate to the page and click the green "Code" button, then "Download ZIP". Once downloaded, unzip the folder to your home directory which on Windows is usually C:\Users\YourUsername
and on macOS and Linux is /home/YourUsername
.
Change the folder name to TRUST
to simplify the later steps.
The following steps will be run in a terminal. You can open a terminal on macOS by pressing Cmd + Space
and typing "Terminal", or on Windows by pressing Win + R
and typing cmd
, then pressing Enter
. On Linux, search for it in the applications menu as it varies by distribution.
Once you have a terminal open, navigate to the TRUST
folder by running the following
# On macOS and Linux
cd ~/TRUST
Or on Windows
cd $HOME\TRUST
The project contains an example environment file .env.example
, containing environment configuration variables that you may change, if needed.
You can copy the example to a new file called .env
by running:
# On macOS and Linux
cp .env.example .env
Or on Windows
copy .env.example .env
Next, build and run the Docker container by running:
# On any OS
docker compose up --build -d
Finally, you can now access the locally installed tool by navigating to http://127.0.0.1:5000
in your web browser.
We present some selected examples graphically to demonstrate some use cases of TRUST.
All the examples can be found in the folder TRUST/storage/cases
where the case studies are organised in subfolders each containing the necessary data files and inputs for the example.
For each of the safety examples, the following conventions are used.
- The initial region is shown in blue.
- The unsafe region(s) are shown in red.
- The gamma level set is shown in dashed red lines.
- The lambda level set is shown in dashed blue lines.
- Trajectories are shown in black, starting from the initial region and staying within the safe level set.
Note: These figures were rendered using a MATLAB script that is not included in the repository. Please feel free to reach out if you would like to know more about how these figures were generated.
First figure: ct-NPS predator-prey system
Second figure: ct-NPS Van der Pol oscillator system
First figure: ct-LS DC motor system
Second figure: ct-LS room temperature system
Third figure: ct-LS two-tank system
First figure: dt-NPS predator-prey system
Second figure: dt-NPS Lorenz system
First figure: dt-LS DC motor system
Second figure: dt-LS room temperature system
Third figure: 3D dt-LS room temperature system
Fourth figure: dt-LS two-tank system
First figure: ct-NPS predator-prey system
Second figure: ct-NPS Van der Pol oscillator system
First figure: ct-LS DC motor system
Second figure: ct-LS room temperature system
Third figure: ct-LS two-tank system
First figure: dt-NPS academic system
Second figure: dt-NPS Lorenz system
First figure: dt-LS DC motor system
Second figure: dt-LS room temperature system
Third figure: 3D dt-LS room tem§perature system
Fourth figure: dt-LS two-tank system
TRUST is developed as a responsive and reactive Python Flask web application, offering an intuitive, user-friendly interface that allows seamless interaction. If a user error occurs, TRUST provides responsive error messages to guide the user in correcting their input. Listed below are some common errors that may be returned to the user:
- For an invalid "state space", "initial set" or "unsafe set(s)": "Provided spaces are not valid. Please provide valid lower and upper bounds."
- For an invalid shape of (\Theta(x)): "Theta_x should be of shape ({N}, {n})".
- If monomials are provided with commas: "Monomial terms should be split by semicolon"; if they are not suitable for the set dimensions: "Monomials must be in terms of x1 (to xn)"; if some unspecified error has occurred with the monomials: "Invalid monomial terms."
- If the rank condition is not met for nonlinear polynomial systems: "The number of samples, T, must be greater than the number of monomial terms, N", or "The N0 data is not full row-rank" depending on which part of the rank condition failed. Similarly for linear systems: "The number of samples, T, must be greater than the number of states, n", or "The X0 data is not full row-rank" again depending on which part of the rank condition failed.
- If data files are uploaded with an invalid format: "Unable to parse uploaded file(s)".
- If the MOSEK solver cannot find a solution for the given values: "Solution Failure," with a dynamic error description provided by the solver. If the MOSEK solver did find a solution but the solution does not contain an SOS decomposition: "No SOS decomposition found," with a dynamic error description. Similarly, if the solution does not contain valid SOS constraints: "Constraints are not sum-of-squares."
- Any other errors in the tool will be caught with the generic error message: "An unknown error occurred," and a brief description that can be reported.
The arXiv version of the paper is located here.
@misc{TRUST2025,
title={TRUST: StabiliTy and Safety ContRoller Synthesis for Unknown Dynamical Models Using a Single Trajectory},
author={Jamie Gardne, Ben Wooding, Amy Nejati, and Abolfazl Lavaei},
year={2025},
eprint={tbc},
journal={28th ACM International Conference on Hybrid Systems: Computation and Control (HSCC 2025)},
primaryClass={eess.SY}
}
If you encounter any issues or have feedback, please open an issue in the repository or submit a pull request. We appreciate your input and will address it as soon as possible.
This work is licensed under a Creative Commons Attribution 4.0 International License.