Home > matlab > acado > packages > +acado > @SimulationEnvironment > SimulationEnvironment.m

SimulationEnvironment

PURPOSE ^

Declaration of the Simulation Environment designed to test closed loop systems.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

Declaration of the Simulation Environment designed to test closed loop systems. 
 In a standard setup the Simulation Environment consists of a Process and a 
 Controller that are connected by signals.
 
  Usage:
    >> SimulationEnvironment(startTime, endTime, process, controller);

  Parameters:
    startTime                   [NUMERIC]
    endTime                  [NUMERIC]
    process                  [acado.Process]
    controller               [acado.Controller]

  Example:
    >> sim = acado.SimulationEnvironment( 0.0,3.0,process,controller );

  See also:
    acado.Process
    acado.Controller
    acado.SimulationEnvironment.init     initialization values

  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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 %Declaration of the Simulation Environment designed to test closed loop systems.
0002 % In a standard setup the Simulation Environment consists of a Process and a
0003 % Controller that are connected by signals.
0004 %
0005 %  Usage:
0006 %    >> SimulationEnvironment(startTime, endTime, process, controller);
0007 %
0008 %  Parameters:
0009 %    startTime                   [NUMERIC]
0010 %    endTime                  [NUMERIC]
0011 %    process                  [acado.Process]
0012 %    controller               [acado.Controller]
0013 %
0014 %  Example:
0015 %    >> sim = acado.SimulationEnvironment( 0.0,3.0,process,controller );
0016 %
0017 %  See also:
0018 %    acado.Process
0019 %    acado.Controller
0020 %    acado.SimulationEnvironment.init     initialization values
0021 %
0022 %  Licence:
0023 %    This file is part of ACADO Toolkit  - (http://www.acadotoolkit.org/)
0024 %
0025 %    ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
0026 %    Copyright (C) 2008-2009 by Boris Houska and Hans Joachim Ferreau, K.U.Leuven.
0027 %    Developed within the Optimization in Engineering Center (OPTEC) under
0028 %    supervision of Moritz Diehl. All rights reserved.
0029 %
0030 %    ACADO Toolkit is free software; you can redistribute it and/or
0031 %    modify it under the terms of the GNU Lesser General Public
0032 %    License as published by the Free Software Foundation; either
0033 %    version 3 of the License, or (at your option) any later version.
0034 %
0035 %    ACADO Toolkit is distributed in the hope that it will be useful,
0036 %    but WITHOUT ANY WARRANTY; without even the implied warranty of
0037 %    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0038 %    Lesser General Public License for more details.
0039 %
0040 %    You should have received a copy of the GNU Lesser General Public
0041 %    License along with ACADO Toolkit; if not, write to the Free Software
0042 %    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
0043 %
0044 %    Author: David Ariens
0045 %    Date: 2010
0046 %
0047 classdef SimulationEnvironment < acado.SimulationBlock & acado.OptimizationAlgorithmBase    
0048     properties (SetAccess='private')
0049        
0050         startTime = 0;
0051         endTime = 0;
0052         process;
0053         controller;
0054         
0055         initvector;
0056     end
0057     
0058     methods
0059         function obj = SimulationEnvironment(varargin)
0060 
0061             global ACADO_;
0062             ACADO_.count_optalgo = ACADO_.count_optalgo+1;
0063             obj.name = strcat(obj.name, num2str(ACADO_.count_optalgo));
0064             
0065             if (nargin == 4 && isa(varargin{1}, 'numeric') && isa(varargin{2}, 'numeric') && isa(varargin{3}, 'acado.Process') && isa(varargin{4}, 'acado.Controller'))
0066                 obj.startTime = varargin{1};   
0067                 obj.endTime = varargin{2};
0068                 obj.process = varargin{3};
0069                 obj.controller = varargin{4};
0070                 
0071             else
0072                error('ERROR: Invalid SimulationEnvironment call. <a href="matlab: help acado.SimulationEnvironment">help acado.SimulationEnvironment</a>'); 
0073             end
0074             
0075             ACADO_.helper.addInstruction(obj);
0076             
0077         end
0078         
0079         init(obj, varargin)
0080         getInstructions(obj, cppobj, get)
0081         
0082     end
0083 end
0084 
0085

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