# optimalControl

Class prodiving the functionality for solving nonlinear optimal control problems.

## Contents

- Syntax
- Description
- Input Arguments
- Output Arguments
- See Also
- References

## Syntax

obj = optimalControl(system,stageCost,terminalCost,X,U,Q,N,dt)

## Description

This class provides the functionality required for solving nonlinear optimal control problems of the form: min sum_k=0^{N-1} l_k(x_k,u_k) + V(x_N), s.t. x0 = x_0, \forall k \in {0,...,N-1}: x_{k+1} = f(x_k,u_k,0), \forall k \in {0,...,N}: x_k \in X, \forall k \in {0,...,N}: u_k \in U, where the stage cost functions l_k(x_k,u_k) might be time-varying, x0 denotes a given initial state, and the sets of admissible states and control inputs X and U, respectively, are assumed to be representable as polytopes. We use IPOPT [1] interfaced via CasADi [2] for solving the optimal control problem.

## Input Arguments

system | function handle for the continuous-time dynamics of the controlled system
stageCost | cell array storing function handles for the time-varying stage cost functions (cell array of dimension [N,1])
terminalCost | function handle for the terminal cost function
X | set of admissible states (class: interval / polytope)
U | set of admissible control inputs (class: interval / zonotope)
W | set of disturbances (class: contSet)
N | number of time steps (integer)
dt | sampling time (scalar double)
opts | structure with the following fields
.nw | dimension of the disturbance space (integer)

## Output Arguments

obj | generated instance of the class optimalControl

## See Also

-

## References

[1] A. Wächter and L. T. Biegler, 'On the Implementation of a Primal-Dual Interior Point Filter Line Search Algorithm for Large-Scale Nonlinear Programming', Mathematical Programming 106(1), pp. 25-57, 2006 [2] J. A. E. Andersson et al., 'CasADi – A software framework for nonlinear optimization and optimal control', Mathematical Programming Computation, vol. 11, no. 1, pp. 1–36, 2019.

© 2018-2026 I6 Technische Universität München `•` Website `•` License