glycemia.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-2009 by Boris Houska and Hans Joachim Ferreau, K.U.Leuven.
6  * Developed within the Optimization in Engineering Center (OPTEC) under
7  * supervision of Moritz Diehl. All rights reserved.
8  *
9  * ACADO Toolkit is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 3 of the License, or (at your option) any later version.
13  *
14  * ACADO Toolkit is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with ACADO Toolkit; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  *
23  */
24 
25 
35 
36  // Define a Right-Hand-Side:
37  // -------------------------
38 
39  DifferentialState G ; // blood glucose concentration
40  DifferentialState I ; // blood insulin concentration
41  DifferentialState X ; // effect of insulin on net glucose disappearance
42  DifferentialState I2; // effect of endogenous insulin
43 
44  Control FI; // exogenous insulin flow
45 
46  Disturbance w0;
47  Disturbance w1;
48  Disturbance w2;
49  Disturbance w3;
50 
51  Parameter FG; // carbohydrate calories flow
52  Parameter P1;
53  Parameter P2;
54  Parameter P3;
55  Parameter C1;
56  Parameter C2;
57  Parameter C3;
58  Parameter C4;
59  Parameter C5;
60  Parameter n;
61  Parameter alpha;
62  Parameter gamma;
63 
64  const double s = 0.1 ;
65 
67 
68  z = exp(I2/s);
69 
70  *f << dot(G) == (-P1 - X) * G + P1 * C1 + FG/C2 + w0;
71  *f << dot(I) == alpha * s *log(1 + z) - n*(I-C4) + FI/C3 + w1;
72  *f << dot(X) == -P2 * X + P3 * 0.001 * (I-C4) + w2;
73  *f << dot(I2) == gamma * (G - C5) - n * (I2) + w3;
74 }
75 
void glycemia(DifferentialEquation *f)
Definition: glycemia.cpp:34
Expression dot(const Expression &arg)
#define C1
#define C2
IntermediateState exp(const Expression &arg)
Allows to setup and evaluate differential equations (ODEs and DAEs) based on SymbolicExpressions.
IntermediateState log(const Expression &arg)


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