


Adds an expression as a the Lagrange term to be maximized.
IMPORTANT NOTICE: LAGRANGE TERMS ARE NOT YET IMPLEMENTED TO BE USED
TOGHETHER WITH MATLAB ODE CALLS. ONLY USE THEM WHEN DEFINING
A DIFFERENTIAL EQUATION INSIDE ACADO.
Usage:
>> ocp.maximizeLagrangeTerm(expression)
Parameters:
expression expression to be maximized [ ]
Example:
>> ocp = acado.OCP(0.0, 1.0, 20);
>> ocp.maximizeLagrangeTerm(x);
Licence:
This file is part of ACADO Toolkit - (http://www.acadotoolkit.org/)
ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
Copyright (C) 2008-2009 by Boris Houska and Hans Joachim Ferreau, K.U.Leuven.
Developed within the Optimization in Engineering Center (OPTEC) under
supervision of Moritz Diehl. All rights reserved.
ACADO Toolkit is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
ACADO Toolkit is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with ACADO Toolkit; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Author: David Ariens
Date: 2009

0001 function maximizeLagrangeTerm(obj, varargin) 0002 % Adds an expression as a the Lagrange term to be maximized. 0003 % 0004 % IMPORTANT NOTICE: LAGRANGE TERMS ARE NOT YET IMPLEMENTED TO BE USED 0005 % TOGHETHER WITH MATLAB ODE CALLS. ONLY USE THEM WHEN DEFINING 0006 % A DIFFERENTIAL EQUATION INSIDE ACADO. 0007 % 0008 % Usage: 0009 % >> ocp.maximizeLagrangeTerm(expression) 0010 % 0011 % Parameters: 0012 % expression expression to be maximized [ ] 0013 % 0014 % Example: 0015 % >> ocp = acado.OCP(0.0, 1.0, 20); 0016 % >> ocp.maximizeLagrangeTerm(x); 0017 % 0018 % Licence: 0019 % This file is part of ACADO Toolkit - (http://www.acadotoolkit.org/) 0020 % 0021 % ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. 0022 % Copyright (C) 2008-2009 by Boris Houska and Hans Joachim Ferreau, K.U.Leuven. 0023 % Developed within the Optimization in Engineering Center (OPTEC) under 0024 % supervision of Moritz Diehl. All rights reserved. 0025 % 0026 % ACADO Toolkit is free software; you can redistribute it and/or 0027 % modify it under the terms of the GNU Lesser General Public 0028 % License as published by the Free Software Foundation; either 0029 % version 3 of the License, or (at your option) any later version. 0030 % 0031 % ACADO Toolkit is distributed in the hope that it will be useful, 0032 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0033 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0034 % Lesser General Public License for more details. 0035 % 0036 % You should have received a copy of the GNU Lesser General Public 0037 % License along with ACADO Toolkit; if not, write to the Free Software 0038 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 0039 % 0040 % Author: David Ariens 0041 % Date: 2009 0042 % 0043 0044 if (isa(varargin{1}, 'acado.Expression')) 0045 0046 obj.maxLagrangeTerms{end+1} = varargin{1}; 0047 0048 else 0049 error('ERROR: Invalid OCP.maximizeLagrangeTerm call. <a href="matlab: help acado.OCP.maximizeLagrangeTerm">help acado.OCP.maximizeLagrangeTerm</a>'); 0050 0051 end 0052 0053 end