MAiNGO
MAiNGOmodel.h
Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2019 Process Systems Engineering (AVT.SVT), RWTH Aachen University
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License 2.0 which is available at
6  * http://www.eclipse.org/legal/epl-2.0.
7  *
8  * SPDX-License-Identifier: EPL-2.0
9  *
10  * @file MAiNGOmodel.h
11  *
12  * @brief File containing declaration of the MAiNGOmodel class that needs to be
13  * specialized when specifying models via the C++ API of MAiNGO.
14  *
15  **********************************************************************************/
16 
17 #pragma once
18 
19 #include "evaluationContainer.h"
20 
21 #include "babOptVar.h"
22 #include "babUtils.h"
23 
24 #include "ffunc.hpp"
25 #include "functionWrapper.h"
26 
27 
28 #include <vector>
29 
30 
31 // Using declarations of all additional functions defined in MC++ for a comfortable use of these functions in the model
32 using mc::arh;
33 using mc::bounding_func;
34 using mc::cost_function;
35 using mc::covariance_function;
36 using mc::enthalpy_of_vaporization;
37 using mc::euclidean_norm_2d;
38 using mc::expx_times_y;
39 using mc::fabsx_times_x;
40 using mc::gaussian_probability_density_function;
41 using mc::iapws;
42 using mc::ideal_gas_enthalpy;
43 using mc::lb_func;
44 using mc::lmtd;
45 using mc::mc_print;
46 using mc::neg;
47 using mc::nrtl_dGtau;
48 using mc::nrtl_dtau;
49 using mc::nrtl_G;
50 using mc::nrtl_Gdtau;
51 using mc::nrtl_Gtau;
52 using mc::nrtl_tau;
53 using mc::p_sat_ethanol_schroeder;
54 using mc::pos;
55 using mc::regnormal;
56 using mc::rho_liq_sat_ethanol_schroeder;
57 using mc::rho_vap_sat_ethanol_schroeder;
58 using mc::rlmtd;
59 using mc::saturation_temperature;
60 using mc::sqr;
61 using mc::squash_node;
62 using mc::sum_div;
63 using mc::ub_func;
64 using mc::vapor_pressure;
65 using mc::xexpax;
66 using mc::xlog;
67 using mc::xlog_sum;
68 using std::max;
69 using std::min;
70 
71 
76 namespace maingo {
77 
91 class MAiNGOmodel {
92 
93  public:
94  using Var = mc::FFVar;
99  virtual ~MAiNGOmodel() {}
100 
106  virtual EvaluationContainer evaluate(const std::vector<Var> &optVars) = 0;
107 
111  virtual std::vector<OptimizationVariable> get_variables() = 0;
112 
116  virtual std::vector<double> get_initial_point() { return std::vector<double>(); }
117 
118  private:
119 };
120 
121 
122 } // namespace maingo
Definition: babOptVar.h:44
virtual EvaluationContainer evaluate(const std::vector< Var > &optVars)=0
Virtual function which has to be implemented by the user in order to enable evaluation of the model.
Auxiliary struct for representing bounds on an optimization variable.
Definition: babOptVar.h:57
Definition: babOptVar.h:41
Class for representing an optimization variable specified by the user.
Definition: babOptVar.h:100
constexpr VT VT_INTEGER
Definition: MAiNGOmodel.h:83
Struct for storing the values returned by model evaluation at the given point "var".
Definition: evaluationContainer.h:192
This class is the base class for models to be solved by MAiNGO.
Definition: MAiNGOmodel.h:91
constexpr VT VT_CONTINUOUS
Definition: MAiNGOmodel.h:81
namespace holding all essentials of MAiNGO
Definition: aleModel.h:31
mc::FFVar Var
Definition: MAiNGOmodel.h:94
virtual std::vector< OptimizationVariable > get_variables()=0
Virtual function which has to be implemented by the user in order to enable getting data on optimizat...
virtual std::vector< double > get_initial_point()
Virtual function which has to be implemented by the user in order to enable getting data on the initi...
Definition: MAiNGOmodel.h:116
mc::FFVar nrtl_tau(const mc::FFVar &T, const std::vector< double > p)
Definition: functionWrapper.h:206
mc::FFVar nrtl_dtau(const mc::FFVar &T, const std::vector< double > p)
Definition: functionWrapper.h:213
babBase::OptimizationVariable OptimizationVariable
Definition: MAiNGOmodel.h:78
VT
Enum for representing the Variable Type of an optimization variable as specified by the user.
Definition: babOptVar.h:40
constexpr VT VT_BINARY
Definition: MAiNGOmodel.h:82
virtual ~MAiNGOmodel()
Destructor.
Definition: MAiNGOmodel.h:99
babBase::Bounds Bounds
Definition: MAiNGOmodel.h:79
Definition: babOptVar.h:43