## 2  Introduction to PROPT

PROPT is a software package intended to solve dynamic optimization problems. Such problems are usually described by

• A state-space model of a system. This can be either a set of ordinary differential equations (ODE) or differential algebraic equations (DAE).
• Initial and/or final conditions (sometimes also conditions at other points).
• A cost functional, i.e. a scalar value that depends on the state trajectories and the control function.
• Sometimes, additional equations and variables that, for example, relate the initial and final conditions to each other.

The goal of PROPT is to enable the formulation of such problem descriptions as seamlessly as possible, without having to worry about the mathematics of the actual solver. Once a problem has been properly defined, PROPT will take care of all the necessary steps in order to return a solution.2

PROPT uses pseudospectral collocation methods (and other options) for solving optimal control problems. This means that the solution takes the form of a polynomial, and this polynomial satisfies the DAE and the path constraints at the collocation points (Note that both the DAE and the path constraints can be violated between collocation points). The default choice is to use Gauss points as collocation points, although the user can specify any set of points to use.

It should be noted that the code is written in a general way, allowing for a DAE rather than just an ODE formulation with path constraints.

Parameter estimation for dynamic systems is intrinsically supported by the framework as scalar decision variables can be introduced in the formulation.

### 2.1  Overview of PROPT syntax

A PROPT problem is defined with tomSym objects and standard Matlab expressions (usually in cell arrays), which contain information about different aspects of the problem.

In general an optimal control consists of the following:

• Phases: A problem may contain several different phases, each with its own set of variables and equations.
• Independent: Variables that are independent (normally time).
• States: (Could also be called "dependent") States (short for state variables) are continuous functions of the independent variable. Control variables are (possibly) discontinuous functions of the same variable.
• Controls: Control variables (states that may be discontinuous).
• Scalars: A problem may also contain unknown scalar variables that are solved for at the same time as the controls and state trajectories.
• Parameters: Numeric constants that are used to define a problem.
• Expressions: Intermediate results in computations.
• Equations and inequalities: The core of the problem definition.
• Cost: A performance index or objective function to be minimized.

PROPT has many built-in features:

• Computation of the constant matrices used for the differentiation and integration of the polynomials used to approximate the solution to the trajectory optimization problem.
• Code manipulation to turn user-supplied expressions into Matlab code for the cost function f and constraint function c (with two levels of analytical derivative and sparsity patterns). The files are passed to a nonlinear programming solver (by default) in TOMLAB for final processing.
• Functionality for plotting and computing a variety of information for the solution to the problem.
• Integrated support for non-smooth (hybrid) optimal control problems.

Note: The tomSym and PROPT softwares are the first Matlab modules to enable complete source transformation for optimal control problem.

### 2.2  Vector representation

In PROPT, each state is represented by a scalar x0 and a vector x = [

 x1 ⋮ xN

], such that xi corresponds to the value of the state at the i:th collocation point.

State equations are written on vector form, and hence apply at all collocation points. The initial point is treated separately, so the state equations do not apply at the initial point.

The final state is not a free variable. Instead, it is computed via the interpolating polynomial.3

### 2.3  Global optimality

PROPT does not use Pontryagin’s maximum principle, rather it uses a pseudospectral method, however the results are mathematically equivalent. This means that if the solver prints "an optimal solution was found", the solution satisfies necessary, but not sufficient, conditions of optimality. It is guaranteed that the returned solution cannot be improved by an infinitesimal change in the trajectory, but there may exist completely different trajectories that are better.

A recommended procedure for finding other solutions is to set conservative bounds for all variables (states, controls and parameters) and change the solver to "multiMin". This will run a large number of optimizations from random starting points. If they all converge to the same minimum, this is an indication, but no guarantee, that the solution is indeed the global optimum.

In order guarantee that the global optimum is obtained, one must either solve the Hamilton-Jacobi-Bellman equation (which PROPT does not) or show that the problem is convex and therefore only has one optimum (which may not be the case). If ezsolve claims that the problem type is "LP" or "QP", the problem is convex, and the solution is a global optimum.

It is also worth mentioning that a solution computed by PROPT only satisfies the ODE and constraints in the specified collocation points. There is no guarantee that the solution holds between those points. A common way of testing the integrity of a solution is to re-run the computation using twice as many collocation points. If nothing changes, then there was probably enough points in the first computation.