%% optimalControl
% Class prodiving the functionality for solving
% nonlinear optimal control problems.
%
%% Syntax
%
% <html>
%        <div class="syntax">
% obj = optimalControl(system,stageCost,terminalCost,X,U,Q,N,dt) <br>
%        </div>
% </html>
%
%% 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
%
% <html>
% <table cellspacing="0" cellpadding="4" width="" border="1" frame="box" rules="none" class="">
% <tbody valign="top">
%    <tr bgcolor="#F2F2F2">
%    <td>
%        <p class="table">
%            system
%        </p>
%    </td>
%    <td>
%        <p class="table">
%            function handle for the continuous-time
%            dynamics of the controlled system
%        </p>
%    </td>
%    </tr>
%    <tr bgcolor="#F2F2F2">
%    <td>
%        <p class="table">
%            stageCost
%        </p>
%    </td>
%    <td>
%        <p class="table">
%            cell array storing function handles for the
%            time-varying stage cost functions
%            (cell array of dimension [N,1])
%        </p>
%    </td>
%    </tr>
%    <tr bgcolor="#F2F2F2">
%    <td>
%        <p class="table">
%            terminalCost
%        </p>
%    </td>
%    <td>
%        <p class="table">
%            function handle for the terminal cost function
%        </p>
%    </td>
%    </tr>
%    <tr bgcolor="#F2F2F2">
%    <td>
%        <p class="table">
%            X
%        </p>
%    </td>
%    <td>
%        <p class="table">
%            set of admissible states
%            (class: interval / polytope)
%        </p>
%    </td>
%    </tr>
%    <tr bgcolor="#F2F2F2">
%    <td>
%        <p class="table">
%            U
%        </p>
%    </td>
%    <td>
%        <p class="table">
%            set of admissible control inputs
%            (class: interval / zonotope)
%        </p>
%    </td>
%    </tr>
%    <tr bgcolor="#F2F2F2">
%    <td>
%        <p class="table">
%            W
%        </p>
%    </td>
%    <td>
%        <p class="table">
%            set of disturbances
%            (class: contSet)
%        </p>
%    </td>
%    </tr>
%    <tr bgcolor="#F2F2F2">
%    <td>
%        <p class="table">
%            N
%        </p>
%    </td>
%    <td>
%        <p class="table">
%            number of time steps
%            (integer)
%        </p>
%    </td>
%    </tr>
%    <tr bgcolor="#F2F2F2">
%    <td>
%        <p class="table">
%            dt
%        </p>
%    </td>
%    <td>
%        <p class="table">
%            sampling time
%            (scalar double)
%        </p>
%    </td>
%    </tr>
%    <tr bgcolor="#F2F2F2">
%    <td>
%        <p class="table">
%            opts
%        </p>
%    </td>
%    <td>
%        <p class="table">
%            structure with the following fields
%        </p>
%        <p class="table">
% <table cellspacing="0" cellpadding="4" width="" border="1" frame="box" rules="none" class="inner">
% <tbody valign="top">
%    <tr bgcolor="#F2F2F2">
%    <td>
%        <p class="table">
%            .nw
%        </p>
%    </td>
%    <td>
%        <p class="table">
%            dimension of the disturbance space
%            (integer)
%        </p>
%    </td>
%    </tr>
% </tbody>
% </table>
%        </p>
%    </td>
%    </tr>
% </tbody>
% </table>
% </html>
%
%% Output Arguments
%
% <html>
% <table cellspacing="0" cellpadding="4" width="" border="1" frame="box" rules="none" class="">
% <tbody valign="top">
%    <tr bgcolor="#F2F2F2">
%    <td>
%        <p class="table">
%            obj
%        </p>
%    </td>
%    <td>
%        <p class="table">
%            generated instance of the class optimalControl
%        </p>
%    </td>
%    </tr>
% </tbody>
% </table>
% </html>
%
%% See Also
% <matlab:doc('-') ->
%
%% 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.
%

%%
% <html>
%   <hr>
%   <p class="copy">&copy; 2018-2026 I6 Technische Universit&auml;t M&uuml;nchen
%        <tt class="minicdot">&#149;</tt>
%        <a href="https://tumcps.github.io/AROC/">Website</a>
%        <tt class="minicdot">&#149;</tt>
%        <a href="file:txts/LICENSE.txt">License</a>
%   </p>
% <div>
% <table>
%  <tr>
%   <td style="background-color:#ffffff; border:0; width:25%; vertical-align:middle; text-align:center">
%             <img src="img/logoAroc.png" alt="logoAroc" height="40px">
%      </td>
%   <td style="background-color:#ffffff; border:0; width:25%; vertical-align:middle; text-align:center">
%      <img src="img/logoCora.png" alt="logoCora" height="40px"></td>
%   <td style="background-color:#ffffff; border:0; width:25%; vertical-align:middle; text-align:center">
%      <img src="img/logoChair.png" alt="logoChair" height="40px"></td>
%   <td style="background-color:#ffffff; border:0; width:25%; vertical-align:middle; text-align:center">
%      <img src="img/logoTum.png" alt="logoTum" height="40px"></td>
%  </tr>
% </table>
% </div>
% </html>
