


Executes next single step. CPP code will be generated when this method is called
When running your problem, the output struct will be {'U', 'P'} with U the
optimized controls and P the optimized parameters.
Usage:
>> step( startTime )
>> step( startTime, x0 )
>> step( startTime, x0, y_ref )
Parameters:
startTime [NUMERIC]
x0 [VECTOR]
y_ref [MATRIX, first column are time points]
Example:
>> controller.step(0, x0);
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: 2010

0001 function step(obj, varargin) 0002 %Executes next single step. CPP code will be generated when this method is called 0003 % When running your problem, the output struct will be {'U', 'P'} with U the 0004 % optimized controls and P the optimized parameters. 0005 % 0006 % Usage: 0007 % >> step( startTime ) 0008 % >> step( startTime, x0 ) 0009 % >> step( startTime, x0, y_ref ) 0010 % 0011 % Parameters: 0012 % startTime [NUMERIC] 0013 % x0 [VECTOR] 0014 % y_ref [MATRIX, first column are time points] 0015 % 0016 % Example: 0017 % >> controller.step(0, x0); 0018 % 0019 % Licence: 0020 % This file is part of ACADO Toolkit - (http://www.acadotoolkit.org/) 0021 % 0022 % ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. 0023 % Copyright (C) 2008-2009 by Boris Houska and Hans Joachim Ferreau, K.U.Leuven. 0024 % Developed within the Optimization in Engineering Center (OPTEC) under 0025 % supervision of Moritz Diehl. All rights reserved. 0026 % 0027 % ACADO Toolkit is free software; you can redistribute it and/or 0028 % modify it under the terms of the GNU Lesser General Public 0029 % License as published by the Free Software Foundation; either 0030 % version 3 of the License, or (at your option) any later version. 0031 % 0032 % ACADO Toolkit is distributed in the hope that it will be useful, 0033 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0034 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0035 % Lesser General Public License for more details. 0036 % 0037 % You should have received a copy of the GNU Lesser General Public 0038 % License along with ACADO Toolkit; if not, write to the Free Software 0039 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 0040 % 0041 % Author: David Ariens 0042 % Date: 2010 0043 % 0044 0045 obj.do_one_step = 1; 0046 0047 0048 if (nargin == 2) 0049 obj.step_startTime = acado.DoubleConstant(varargin{1}); 0050 0051 elseif (nargin == 3) 0052 obj.step_startTime = acado.DoubleConstant(varargin{1}); 0053 obj.step_x0 = acado.Vector(varargin{2}); 0054 0055 elseif (nargin == 4) 0056 obj.step_startTime = acado.DoubleConstant(varargin{1}); 0057 obj.step_x0 = acado.Vector(varargin{2}); 0058 obj.step_y_ref = acado.Matrix(varargin{3}); 0059 0060 else 0061 error('ERROR: Invalid step(r) call. <a href="matlab: help acado.Controller.step">help acado.Controller.step</a>'); 0062 0063 end 0064 0065 0066 0067 end