00001 #ifndef _electrical_data_h_
00002 #define _electrical_data_h_
00003 #include <vector>
00004 #include <complex>
00005 #include "local_typedefs.h"
00006 #include "AdmittanceNetwork.h"
00007
00014 class ElectricalData
00015 {
00016 public:
00028 struct load_param_t
00029 {
00030 load_param_t();
00031
00032 double Kpi,
00033 Kpc,
00034 Kp1,
00035 Kp2,
00036 npv1,
00037 npf1,
00038 npv2,
00039 npf2,
00040
00041 Kqi,
00042 Kqc,
00043 Kq1,
00044 Kq2,
00045 nqv1,
00046 nqf1,
00047 nqv2,
00048 nqf2;
00049 };
00053 struct line_t
00054 {
00056 line_t():
00057 from(0),to(0),y(),B(),
00058 tside(-1),turns(1.0),phase_shift(0.0){}
00062 line_t(unsigned from, unsigned to, Complex y):
00063 from(from),to(to),y(y),B(),tside(-1),turns(1.0),phase_shift(0.0){}
00065 unsigned from, to;
00067 Complex y;
00069 Complex B;
00071 int tside;
00073 double turns;
00075 double phase_shift;
00076 };
00080 struct genr_t
00081 {
00084 genr_t();
00086 double Tspd1, Tspd2;
00088 double Ef_max;
00090 Complex Xd;
00092 double M;
00094 double R;
00096 double Te;
00098 double Vref;
00100 double Agc;
00102 double D;
00104 double FreqTol;
00106 double w0;
00108 double Ef0;
00110 double T0;
00112 double Pm0;
00114 double C0;
00116 double Pe0;
00117 };
00118
00120 ElectricalData(){}
00122 virtual unsigned getGenrCount() = 0;
00124 virtual unsigned getNodeCount() = 0;
00126 virtual const std::vector<unsigned>& getGenrs() = 0;
00128 virtual const std::vector<line_t>& getLines() = 0;
00133 virtual Complex getAdmittance(unsigned node) = 0;
00137 virtual load_param_t getLoadParams(unsigned node) = 0;
00141 virtual genr_t getGenrParams(unsigned genr) = 0;
00147 void buildAdmitMatrix(AdmittanceNetwork& Y);
00149 virtual ~ElectricalData(){}
00150 };
00151
00152 #endif