OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
experimental_data.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 //
3 // C++ Implementation: experimental_data
4 //
5 // Description: Used to read in an array of experimental data with column headers.
6 // For use with parameter estimation or generating polarization curves.
7 //
8 // Author: Marc Secanell <secanell@ualberta.ca>, Peter Dobson <pdobson@ualberta.ca> (C) 2009,2010
9 //
10 // Copyright: See COPYING file that comes with this distribution
11 //
12 // Created by: Marc Secanell, Peter Dobson (December 2009)
13 // Last updated: January, 2010
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELL__EXPERIMENTAL_DATA_H
18 #define _FUELCELL__EXPERIMENTAL_DATA_H
19 
20 //appframe
21 #include<appframe/base.h>
22 
23 //STL libraries:
24 #include<string>
25 #include<fstream>
26 #include<iostream>
27 #include<vector>
28 
29 namespace SIM
30 {
36  {
37  public:
38 
42  ExperimentalData(std::string filename);
47  {};
48 
52  void parse_data_names() const;
53 
57  void print_data() const;
62  void extract_vector(std::string label, std::vector<double>& data_vector);
63 
67  void get_experimental_values(std::vector<std::string>& name_OC, std::vector< std::vector<double> >& value_OC) const;
68 
69 // /**
70 // * function that gets the string vector and value array
71 // */
72 // void store_OCV_values(std::vector<std::string>& name_OC, std::vector< std::vector<double> >& value_OC, std::vector<double>& current);
73 
74 // /**
75 // * function that gets the string vector and value array
76 // */
77 // bool find_OCV(std::vector<double>& conditions, double& OCV);
78 
79  // Inline Functions
83  inline int get_num_rows() const
84  {
85  return experimental_values.size();
86  }
90  inline int get_num_columns() const
91  {
92  return experimental_values[0].size();
93  }
94 
95 
96  private:
101  void read_data_file();
102 
106  std::vector< std::vector<double> > experimental_values;
110  std::vector<std::string> data_names;
114  const std::string data_file;
118  std::vector<double> OCV_list;
119 
120  std::vector <std::vector<double> > OCV_conditions;
121 
122  };
123 
124 }
125 
126 #endif
127 
128 
129