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
23 #include <application_core/event.h>
25 
26 //STL libraries:
27 #include<string>
28 #include<fstream>
29 #include<iostream>
30 #include<vector>
31 
32 using namespace dealii;
33 
34 namespace SIM
35 {
41  {
42  public:
43 
47  ExperimentalData(std::string filename);
52  {};
53 
57  void parse_data_names() const;
58 
62  void print_data() const;
67  void extract_vector(std::string label, std::vector<double>& data_vector);
68 
72  void get_experimental_values(std::vector<std::string>& name_OC, std::vector< std::vector<double> >& value_OC) const;
73 
74 // /**
75 // * function that gets the string vector and value array
76 // */
77 // void store_OCV_values(std::vector<std::string>& name_OC, std::vector< std::vector<double> >& value_OC, std::vector<double>& current);
78 
79 // /**
80 // * function that gets the string vector and value array
81 // */
82 // bool find_OCV(std::vector<double>& conditions, double& OCV);
83 
84  // Inline Functions
88  inline int get_num_rows() const
89  {
90  return experimental_values.size();
91  }
95  inline int get_num_columns() const
96  {
97  return experimental_values[0].size();
98  }
99 
100 
101  private:
106  void read_data_file();
107 
111  std::vector< std::vector<double> > experimental_values;
115  std::vector<std::string> data_names;
119  const std::string data_file;
123  std::vector<double> OCV_list;
124 
125  std::vector <std::vector<double> > OCV_conditions;
126 
127  };
128 
129 }
130 
131 #endif
132 
133 
134 
std::vector< std::vector< double > > experimental_values
array of experimental values used in NLS parameter study
Definition: experimental_data.h:111
int get_num_rows() const
function that gets the string vector and value array
Definition: experimental_data.h:88
std::vector< std::vector< double > > OCV_conditions
Definition: experimental_data.h:125
const std::string data_file
String specifying the data file to be read.
Definition: experimental_data.h:119
Description: Used to read in an array of experimental data with column headers.
Definition: experimental_data.h:40
std::vector< std::string > data_names
names of operating conditions for experimental values used in NLS parameter study ...
Definition: experimental_data.h:115
~ExperimentalData()
Destructor.
Definition: experimental_data.h:51
int get_num_columns() const
function that returns the number of data points (rows) in the data file
Definition: experimental_data.h:95
std::vector< double > OCV_list
vector of values holding the open circuit voltage for the data provided
Definition: experimental_data.h:123