/QuITOv2

Primary LanguageMATLABGNU General Public License v3.0GPL-3.0

QuITO v.2 : Quasi-Interpolation based Trajectory Optimization

QuITO v.2 is a MATLAB-based numerical software package for solving constrained nonlinear optimal control problems via direct optimization. The base algorithm is a novel direct multiple shooting technique that employs a special kind of quasi-interpolation technique on piecewise uniform grid to approximate the control trajectory. The change-point localization and the mesh refinement modules in QuITO v.2 automatically detects irregular regions in the numerical optimal control and iteratiely refine the time-grid until a presepecified tolerance in the minimzed cost is reached. Currently, QuITO v.2 can handle the following problem specifications:

  • Dynamics (ODEs): linear, nonlinear;
  • Constraint: state, control, mixed (which can be a nonlinear function of states and control);
  • Boundary specification: boundary values, constraints of terminal states.

The following table collects all the pre-loaded optimal control problem examples in QuITO v.2:

Problem Dynamics State/Control/Mixed Constraints Singular Control Additional Function
Aly Chan Nonlinear No, Yes, No No
Bang Bang problem Nonlinear No, Yes, No No Mesh Refinement
Bressan problem Nonlinear No, Yes, No Yes Mesh Refinement
Bryson Denham Linear Yes, No, No No
Catalyst Mixing problem Nonlinear No, Yes, No Yes Mesh Refinement
Double integrator tracking Linear Yes, Yes, No No
Inverted pendulum on a cart Linear Yes, Yes, No No
Multi-agent AUV path planning Nonlinear Yes, Yes, No No Mesh Refinement
Rayleigh problem (with control constraints) Nonlinear No, Yes, No No
Rayleigh problem (with mixed constraints) Nonlinear No, No, Yes No
Robot Path Planning Linear Yes, No, No No
SIRI problem Nonlinear Yes, Yes, No Yes Mesh Refinement
VanDerPol control constrainted Nonlinear No, Yes, No Yes
VanDerPol state constrainted Nonlinear Yes, No, No No

Implementation details for all the individual examples are given in their README.md files which can be found within their directories. Simply click and scroll down.

How to cite?

In case you're using QuITO v.2 (or it's previous version https://github.com/chatterjee-d/QuITO.git), consider citing the articles:

  1. S. Ganguly, N. Randad, D. Chatterjee, R. Banavar, Constrained trajectory synthesis via quasi-interpolation, IEEE CDC 2022, https://ieeexplore.ieee.org/abstract/document/9992892
  2. S. Ganguly, N. Randad, R. A. D'Silva, M. Raj, D. Chatterjee, QuITO: Numerical software for constrained nonlinear optimal control problems, SoftwareX, Elsevier, https://www.sciencedirect.com/science/article/pii/S2352711023002534.
  3. S. Ganguly, R. A. D'Silva D. Chatterjee, QuITO v.2: Trajectory Optimization with Uniform Error Guarantees under Path Constraints https://doi.org/10.48550/arXiv.2404.13681

Contributors

  1. Rihan Aaron D'Silva
  2. Siddhartha Ganguly
  3. Debasish Chatterjee

How to install?

Step I: install CasADi

QuITO uses CasADi, an open-source framework for nonlinear optimization, for its optimization routine. CasADi can be downloaded from here: https://web.casadi.org/get.

  • Once the .zip file is downloaded from the mentioned webpage, extract the contents onto a desired folder.
  • Navigate to that folder in MATLAB and execute the following commands in MATLAB Command Window:
addpath(genpath('<path to the folder in which CasADi files are extracted to>'));
import casadi.*;

To check CasADi installation, try executing the following lines in the MATLAB Command Window:

x = MX.sym('x')
disp(jacobian(sin(x),x))

If any error is thrown, this implies an irregular installation of CasADi, and the user is advised to follow the above instructions again closely. Also, please keep in mind that CasADi might have to be imported to MATLAB every time MATLAB is restarted, depending on the user's system settings.

Next, download and unzip the QuITO package source files into a desired folder, and add the included src folder and its all subfolders to MATLAB's path directory. It can be done in the following ways:

  • Access through the Set Path button on the Home ribbon and add the subfolders or,
  • Open the package folder on MATLAB (which can be verified from the address field on the top). You can run pwd command on the MATLAB terminal to check whether the package directory is currently open. Then run the following command on the MATLAB terminal addpath(genpath(fullfile(pwd, 'src'))) to add the src folder and its subfolders to MATLAB’s path.

Step II (using QuITO v.2): running the pre-loaded examples and adding your own problem

You can run the pre-loaded examples, formulate your own problems, and then solve it by employing QuITO easily. There are two ways to achieve that:

(a) Run the main.m file:

The examples contain the following files:

  • example.m: contains system specifications, constraint profile, etc., specific to an example;
  • options.m: contains integration schemes, solver options, etc.;
  • postProcess.m: contains options for plotting the state-action trajectories;
  • main.m: the main/primary file the user needs to run by specifying the number of steps $N&gt;0$ and the shape parameter $D&gt;0$.

To solve any example problem, the main.m file needs to be executed. We recommend the IPOPT (Interior Point Optimization) solver for nonlinear optimization problems and is already available within CasADI. For details, visit: https://coin-or.github.io/Ipopt.

Same steps need to be followed when the user wants to solve their own problems. Simply populate the example.m, options.m and postProcess,m files and execute the main.m file by setting the desirable parameters $(N,D)$.

The other hassle free and quick option is to use the GUI. Have a look at the installation steps.

(b) Use the Graphical User Interface (GUI)

Installation

The QuITO .2 toolbox is packaged in the form of a MATLAB app with a Graphical Interface to ease the process of making use of the toolbox. To install the GUI, navigate to the Graphical Interface directory, and in that directory, find the installation file, QuITO - Graphical Interface.mlappinstall. Clicking on which MATLAB throws a pop-up prompting the user to install the application. Once the app is installed, the user can find it in the APPS section on MATLAB's toolbar on the top.

Instructions to Use

  1. Before starting the app, please ensure CasADI is installed and correctly imported onto MATLAB's path. The same can be verified using the commands path and ver on the Command Window.
  2. Once verified, navigate to the base directory of QuITO v.2, and open the MATLAB app named QuITO from the APPS section on MATLAB's toolbar at the top of the window.
  3. Here, the user can select their preferred Example Problem or any User-Defined Template Problem from the dropdown, input values for Number of Steps (N), Shape Parameter (D), Generating function and Meshing strategy, and simply click on the Run button.
  4. The user must ensure the current working directory on MATLAB is always the base directory of the QuITO toolbox.