Home > matlab > acado > packages > +acado > @OCP > minimizeMayerTerm.m

minimizeMayerTerm

PURPOSE ^

Adds an expression as a the Mayer term to be minimized.

SYNOPSIS ^

function minimizeMayerTerm(obj, varargin)

DESCRIPTION ^

Adds an expression as a the Mayer term to be minimized. 

  Usage:
    >> ocp.minimizeMayerTerm(expression)

  Parameters:
    expression     expression to be minimized     [  ]

  Example:
    >> ocp = acado.OCP(0.0, 1.0, 20);
    >> ocp.minimizeMayerTerm(x + p*p + q*q);
    or
    >> ocp.minimizeMayerTerm(x2);

  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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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

www.acadotoolkit.org/matlab
Generated on Tue 01-Jun-2010 20:14:12 by m2html © 2005