PROPT
Encyclopedia
The PROPT MATLAB
MATLAB
MATLAB is a numerical computing environment and fourth-generation programming language. Developed by MathWorks, MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages,...

 Optimal Control
Optimal control
Optimal control theory, an extension of the calculus of variations, is a mathematical optimization method for deriving control policies. The method is largely due to the work of Lev Pontryagin and his collaborators in the Soviet Union and Richard Bellman in the United States.-General method:Optimal...

 Software is a new generation platform for solving applied optimal control (with ODE
Ordinary differential equation
In mathematics, an ordinary differential equation is a relation that contains functions of only one independent variable, and one or more of their derivatives with respect to that variable....

 or DAE formulation) and parameters estimation
Estimation theory
Estimation theory is a branch of statistics and signal processing that deals with estimating the values of parameters based on measured/empirical data that has a random component. The parameters describe an underlying physical setting in such a way that their value affects the distribution of the...

 problems.

The platform was developed by MATLAB Programming Contest Winner, Per Rutquist in 2008. The most recent version has support for binary and integer variables as well as an automated scaling module.

Description

PROPT is a combined modeling
Mathematical model
A mathematical model is a description of a system using mathematical concepts and language. The process of developing a mathematical model is termed mathematical modeling. Mathematical models are used not only in the natural sciences and engineering disciplines A mathematical model is a...

, compilation and solver engine, built upon the TomSym
TomSym
The TomSym MATLAB symbolic modeling engine is a platform for modeling applied optimization and optimal control problems.- Description :TomSym is complete modeling environment in Matlab with support for most built-in mathematical operators in Matlab. It is a combined modeling, compilation and...

 modeling class, for generation of highly complex optimal control problems. PROPT uses a pseudospectral
Gauss pseudospectral method
The Gauss pseudospectral method , one of many topics named after Carl Friedrich Gauss, is a direct transcription method for discretizing a continuous optimal control problem into a nonlinear program . The Gauss pseudospectral method differs from several other pseudospectral methods in that the...

 Collocation method
Collocation method
In mathematics, a collocation method is a method for the numerical solution of ordinary differential equations, partial differential equations and integral equations...

 (with Gauss or Chebyshev points) for solving optimal control problems. This means that the solution takes the form of a Polynomial
Polynomial
In mathematics, a polynomial is an expression of finite length constructed from variables and constants, using only the operations of addition, subtraction, multiplication, and non-negative integer exponents...

, and this polynomial satisfies the DAE and the path constraints
Constraint (mathematics)
In mathematics, a constraint is a condition that a solution to an optimization problem must satisfy. There are two types of constraints: equality constraints and inequality constraints...

 at the collocation points.

In general PROPT has the following main functions:
  • Computation of the constant matrices
    Matrix (mathematics)
    In mathematics, a matrix is a rectangular array of numbers, symbols, or expressions. The individual items in a matrix are called its elements or entries. An example of a matrix with six elements isMatrices of the same size can be added or subtracted element by element...

     used for the differentiation
    Derivative
    In calculus, a branch of mathematics, the derivative is a measure of how a function changes as its input changes. Loosely speaking, a derivative can be thought of as how much one quantity is changing in response to changes in some other quantity; for example, the derivative of the position of a...

     and integration
    Integral
    Integration is an important concept in mathematics and, together with its inverse, differentiation, is one of the two main operations in calculus...

     of the polynomials used to approximate the solution to the Trajectory optimization
    Trajectory optimization
    Trajectory optimization is the process of designing a trajectory that minimizes or maximizes some measure of performance within prescribed constraint boundaries...

     problem.

  • Source transformation to turn user-supplied expressions
    Expression (mathematics)
    In mathematics, an expression is a finite combination of symbols that is well-formed according to rules that depend on the context. Symbols can designate numbers , variables, operations, functions, and other mathematical symbols, as well as punctuation, symbols of grouping, and other syntactic...

     into MATLAB code for the cost function and constraint function that are passed to a Nonlinear programming
    Nonlinear programming
    In mathematics, nonlinear programming is the process of solving a system of equalities and inequalities, collectively termed constraints, over a set of unknown real variables, along with an objective function to be maximized or minimized, where some of the constraints or the objective function are...

     solver in TOMLAB
    TOMLAB
    The TOMLAB Optimization Environment is a modeling platform for solving applied optimization problems in MATLAB.-Description:TOMLAB is a general purpose development and modeling environment in MATLAB for research, teaching and practical solution of optimization problems...

    . The source transformation package TomSym automatically generates first and second order derivatives.

  • Functionality for plotting and computing a variety of information for the solution to the problem.

  • Automatic detection of the following:
    • Linear and quadratic objective.
    • Simple bounds, linear and nonlinear constraints.
    • Non-optimized expressions.

  • Integrated support for non-smooth
    Smooth function
    In mathematical analysis, a differentiability class is a classification of functions according to the properties of their derivatives. Higher order differentiability classes correspond to the existence of more derivatives. Functions that have derivatives of all orders are called smooth.Most of...

     (hybrid) optimal control problems.

  • Module for automatic scaling of difficult space related problem.

  • Support for binary and integer variables, controls or states.

Modeling

The PROPT system uses the TomSym symbolic source transformation engine to model optimal control problems. It is possible to define independent
Dependent and independent variables
The terms "dependent variable" and "independent variable" are used in similar but subtly different ways in mathematics and statistics as part of the standard terminology in those subjects...

 variables, dependent functions, scalars and constant parameters:


toms tf
toms t
p = tomPhase('p', t, 0, tf, 30);
x0 = {tf

20};
cbox = {10 <= tf <= 40};

toms z1
cbox = {cbox; 0 <= z1 <= 500};
x0 = {x0; z1

0};

ki0 = [1e3; 1e7; 10; 1e-3];

States and controls

States and controls only differ in the sense that states need be continuous between phases.


tomStates x1
x0 = {icollocate({x1

0})};

tomControls u1
cbox = {-2 <= collocate(u1) <= 1};
x0 = {x0; collocate(u1

-0.01)};

Boundary, path, event and integral constraints

A variety of boundary, path, event and integral constraints are shown below:


cbnd = initial(x1

1); % Starting point for x1
cbnd = final(x1

1); % End point for x1
cbnd = final(x2

2); % End point for x2
pathc = collocate(x3 >= 0.5); % Path constraint for x3
intc = {integrate(x2)

1}; % Integral constraint for x2
cbnd = final(x3 >= 0.5); % Final event constraint for x3
cbnd = initial(x1 <= 2.0); % Initial event constraint x1

Single-phase optimal control example

Van der Pol Oscillator

Minimize:



Subject to:



To solve the problem with PROPT the following code can be used (with 60 collocation points):


toms t
p = tomPhase('p', t, 0, 5, 60);
setPhase(p);

tomStates x1 x2 x3
tomControls u

% Initial guess
x0 = {icollocate({x1

0; x2

1; x3

0})
collocate(u

-0.01)};

% Box constraints
cbox = {-10 <= icollocate(x1) <= 10
-10 <= icollocate(x2) <= 10
-10 <= icollocate(x3) <= 10
-0.3 <= collocate(u) <= 1};

% Boundary constraints
cbnd = initial({x1

0; x2

1; x3

0});

% ODEs and path constraints
ceq = collocate({dot(x1)

(1-x2.^2).*x1-x2+u
dot(x2)

x1; dot(x3)

x1.^2+x2.^2+u.^2});

% Objective
objective = final(x3);

% Solve the problem
options = struct;
options.name = 'Van Der Pol';
solution = ezsolve(objective, {cbox, cbnd, ceq}, x0, options);

Multi-phase optimal control example

One-dimensional rocket with free end time and undetermined phase shift

Minimize:



Subject to:



The problem is solved with PROPT by creating two phases and connecting them:


toms t
toms tCut tp2
p1 = tomPhase('p1', t, 0, tCut, 20);
p2 = tomPhase('p2', t, tCut, tp2, 20);

tf = tCut+tp2;

x1p1 = tomState(p1,'x1p1');
x2p1 = tomState(p1,'x2p1');
x1p2 = tomState(p2,'x1p2');
x2p2 = tomState(p2,'x2p2');

% Initial guess
x0 = {tCut

10
tf

15
icollocate(p1,{x1p1

50*tCut/10;x2p1

0;})
icollocate(p2,{x1p2

50+50*t/100;x2p2

0;})};

% Box constraints
cbox = {
1 <= tCut <= tf-0.00001
tf <= 100
0 <= icollocate(p1,x1p1)
0 <= icollocate(p1,x2p1)
0 <= icollocate(p2,x1p2)
0 <= icollocate(p2,x2p2)};

% Boundary constraints
cbnd = {initial(p1,{x1p1

0;x2p1

0;})
final(p2,x1p2

100)};

% ODEs and path constraints
a = 2; g = 1;
ceq = {collocate(p1,{
dot(p1,x1p1)

x2p1
dot(p1,x2p1)

a-g})
collocate(p2,{
dot(p2,x1p2)

x2p2
dot(p2,x2p2)

-g})};

% Objective
objective = tCut;

% Link phase
link = {final(p1,x1p1)

initial(p2,x1p2)
final(p1,x2p1)

initial(p2,x2p2)};

%% Solve the problem
options = struct;
options.name = 'One Dim Rocket';
constr = {cbox, cbnd, ceq, link};
solution = ezsolve(objective, constr, x0, options);

Parameter estimation example
Parameter estimation problem

Minimize:



Subject to:



In the code below the problem is solved with a fine grid (10 collocation points). This solution is subsequently fine-tuned using 40 collocation points:


toms t p1 p2
x1meas = [0.264;0.594;0.801;0.959];
tmeas = [1;2;3;5];

% Box constraints
cbox = {-1.5 <= p1 <= 1.5
-1.5 <= p2 <= 1.5};

%% Solve the problem, using a successively larger number collocation points
for n=[10 40]
p = tomPhase('p', t, 0, 6, n);
setPhase(p);
tomStates x1 x2

% Initial guess
if n 10
x0 = {p1

0; p2

0};
else
x0 = {p1

p1opt; p2

p2opt
icollocate({x1

x1opt; x2

x2opt})};
end

% Boundary constraints
cbnd = initial({x1

p1; x2

p2});

% ODEs and path constraints
x1err = sum((atPoints(tmeas,x1) - x1meas).^2);
ceq = collocate({dot(x1)

x2; dot(x2)

1-2*x2-x1});

% Objective
objective = x1err;

%% Solve the problem
options = struct;
options.name = 'Parameter Estimation';
options.solver = 'snopt';
solution = ezsolve(objective, {cbox, cbnd, ceq}, x0, options);

% Optimal x, p for starting point
x1opt = subs(x1, solution);
x2opt = subs(x2, solution);
p1opt = subs(p1, solution);
p2opt = subs(p2, solution);
end

Optimal control problems supported

  • Aerodynamic trajectory control
  • Bang-bang control
    Bang-bang control
    In control theory, a bang–bang controller , also known as a hysteresis controller, is a feedback controller that switches abruptly between two states. These controllers may be realized in terms of any element that provides hysteresis...

  • Chemical engineering
    Chemical engineering
    Chemical engineering is the branch of engineering that deals with physical science , and life sciences with mathematics and economics, to the process of converting raw materials or chemicals into more useful or valuable forms...

  • Dynamic systems
    Dynamical system
    A dynamical system is a concept in mathematics where a fixed rule describes the time dependence of a point in a geometrical space. Examples include the mathematical models that describe the swinging of a clock pendulum, the flow of water in a pipe, and the number of fish each springtime in a...

  • General optimal control
  • Large-scale linear control
  • Multi-phase system control
  • Mechanical engineering
    Mechanical engineering
    Mechanical engineering is a discipline of engineering that applies the principles of physics and materials science for analysis, design, manufacturing, and maintenance of mechanical systems. It is the branch of engineering that involves the production and usage of heat and mechanical power for the...

     design
  • Nondifferentiable control
  • Parameters estimation for dynamic systems
  • Singular control
    Singular control
    In optimal control, problems of singular control are problems that are difficult to solve because a straightforward application of Pontryagin's minimum principle fails to yield a complete solution. Only a few such problems have been solved, such as Merton's portfolio problem in financial economics...


External links

  • TOMLAB - Developer and distributor of the software.
  • TomSym - Source transformation engine used in software.
  • PROPT - Home page for PROPT.
  • SNOPT - Default solver used in PROPT.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK