# DIDO (software)

DIDO (/ˈdaɪdoʊ/ DY-doh) is a MATLAB optimal control toolbox for solving general-purpose optimal control problems. It is widely used in academia, industry, and NASA. Hailed as a breakthrough software, DIDO is based on the pseudospectral optimal control theory of Ross and Fahroo. The latest enhancements to DIDO are described in Ross.

## Usage

DIDO utilizes trademarked expressions and objects that facilitate a user to quickly formulate and solve optimal control problems. Rapidity in formulation is achieved through a set of DIDO expressions which are based on variables commonly used in optimal control theory. For example, the state, control and time variables are formatted as:
* primal.states,
* primal.controls, and
* primal.time
The entire problem is codified using the key words, cost, dynamics, events and path:
* problem.cost
* problem.dynamics
* problem.events, and
* problem.path
A user runs DIDO using the one-line command:
[cost, primal, dual] = dido(problem, algorithm),
where the object defined by algorithm allows a user to choose various options. In addition to the cost value and the primal solution, DIDO automatically outputs all the dual variables that are necessary to verify and validate a computational solution. The output dual is computed by an application of the covector mapping principle.

## Theory

DIDO implements a spectral algorithm based on pseudospectral optimal control theory founded by Ross and his associates. The covector mapping principle of Ross and Fahroo eliminates the curse of sensitivity associated in solving for the costates in optimal control problems. DIDO generates spectrally accurate solutions whose extremality can be verified using Pontryagin's Minimum Principle. Because no knowledge of pseudospectral methods is necessary to use it, DIDO is often used as a fundamental mathematical tool for solving optimal control problems. That is, a solution obtained from DIDO is treated as a candidate solution for the application of Pontryagin's minimum principle as a necessary condition for optimality.

## Applications

DIDO is used world wide in academia, industry and government laboratories. Thanks to NASA, DIDO was flight-proven in 2006. On November 5, 2006, NASA used DIDO to maneuver the International Space Station to perform the zero-propellant maneuver.
Since this flight demonstration, DIDO was used for the International Space Station and other NASA spacecraft. It is also used in other industries. Most recently, DIDO has been used to solve traveling salesman type problems in aerospace engineering.

## MATLAB optimal control toolbox

DIDO is primarily available as a stand-alone MATLAB optimal control toolbox. That is, it does not require any third-party software like SNOPT or IPOPT or other nonlinear programming solvers. In fact, it does not even require the MATLAB Optimization Toolbox.
The MATLAB/DIDO toolbox does not require a "guess" to run the algorithm. This and other distinguishing features have made DIDO a popular tool to solve optimal control problems.
The MATLAB optimal control toolbox has been used to solve problems in aerospace, robotics and search theory.

## History

The optimal control toolbox is named after Dido, the legendary founder and first queen of Carthage who is famous in mathematics for her remarkable solution to a constrained optimal control problem even before the invention of calculus. Invented by Ross, DIDO was first produced in 2001. The software is widely cited and has many firsts to its credit:
* First general-purpose object-oriented optimal control software
* First general-purpose pseudospectral optimal control software
* First flight-proven general-purpose optimal control software
* First embedded general-purpose optimal control solver
* First guess-free general-purpose optimal control solver

## Versions

The early versions, widely adopted in academia, have undergone significant changes since 2007. The latest version of DIDO, available from Elissar Global, does not require a "guess" to start the problem and eliminates much of the minutia of coding by simplifying the input-output structure. Low-cost student versions Archived 2021-04-21 at the Wayback Machine and discounted academic versions are also available from Elissar Global.