parameter_estimation_algorithm.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ACADO Toolkit.
3  *
4  * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
5  * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
6  * Milan Vukov, Rien Quirynen, KU Leuven.
7  * Developed within the Optimization in Engineering Center (OPTEC)
8  * under supervision of Moritz Diehl. All rights reserved.
9  *
10  * ACADO Toolkit is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 3 of the License, or (at your option) any later version.
14  *
15  * ACADO Toolkit is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with ACADO Toolkit; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 
35 
36 
37 
39 
40 
41 
42 //
43 // PUBLIC MEMBER FUNCTIONS:
44 //
45 
46 
49 
51 }
52 
53 
55  :OptimizationAlgorithm( ocp_ ){
56 
58 }
59 
60 
62  :OptimizationAlgorithm( arg ){
63 
64 
65 }
66 
67 
69 
70 }
71 
72 
73 
75 
76  if( this != &arg ){
77 
79  }
80  return *this;
81 }
82 
83 
85 
86  DMatrix tmp;
87  returnValue returnvalue;
88  int offset;
89  int np;
90  int run1,run2;
91 
92  returnvalue = getVarianceCovariance( tmp );
93  if( returnvalue != SUCCESSFUL_RETURN ) return ACADOERROR(returnvalue);
94 
95  if( iter.p == 0 ){
96  pVar.init(0,0);
97  return SUCCESSFUL_RETURN;
98  }
99 
100  offset = 0;
101 
102  if( iter.x != 0 ) offset += iter.x->getNumValues();
103  if( iter.xa != 0 ) offset += iter.xa->getNumValues();
104 
105  np = iter.p->getNumValues();
106  pVar.init( np, np );
107 
108  for( run1 = 0; run1 < np; run1++ )
109  for( run2 = 0; run2 < np; run2++ )
110  pVar( run1, run2 ) = tmp( offset+run1, offset+run2 );
111 
112  return SUCCESSFUL_RETURN;
113 }
114 
115 
117 
119 }
120 
121 
123 
125 }
126 
127 
129 
131 }
132 
133 
135 
137 }
138 
139 
141 
142  if( nlpSolver == 0 ) return ACADOERROR( RET_MEMBER_NOT_INITIALISED );
143  return nlpSolver->getVarianceCovariance( var );
144 }
145 
146 
147 
148 
149 //
150 // PROTECTED MEMBER FUNCTIONS:
151 //
152 
154 {
155  return OptimizationAlgorithm::initializeNlpSolver( _userInit );
156 }
157 
158 
160  )
161 {
162  return SUCCESSFUL_RETURN;
163 }
164 
165 
166 
167 
168 
169 
171 
172 // end of file.
virtual returnValue initializeNlpSolver(const OCPiterate &_userInit)
Data class for storing generic optimization variables.
Definition: ocp_iterate.hpp:57
VariablesGrid * x
virtual returnValue initializeObjective(Objective *F)
void init(unsigned _nRows=0, unsigned _nCols=0)
Definition: matrix.hpp:135
ParameterEstimationAlgorithm & operator=(const ParameterEstimationAlgorithm &arg)
returnValue getAlgebraicStateVarianceCovariance(DMatrix &xaVar)
User-interface to formulate and solve optimal control problems and static NLPs.
Allows to pass back messages to the calling function.
returnValue getControlCovariance(DMatrix &uVar)
returnValue getParameterVarianceCovariance(DMatrix &pVar)
#define CLOSE_NAMESPACE_ACADO
VariablesGrid * xa
User-interface to formulate and solve parameter estimation problems.
returnValue getDistubanceVarianceCovariance(DMatrix &wVar)
returnValue getDifferentialStateVarianceCovariance(DMatrix &xVar)
Data class for defining optimal control problems.
Definition: ocp.hpp:89
virtual returnValue getVarianceCovariance(DMatrix &var)=0
VariablesGrid * p
#define BEGIN_NAMESPACE_ACADO
virtual returnValue initializeNlpSolver(const OCPiterate &_userInit)
OptimizationAlgorithm & operator=(const OptimizationAlgorithm &arg)
Stores and evaluates the objective function of optimal control problems.
Definition: objective.hpp:123
#define ACADOERROR(retval)


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:55