00001
00010 #ifndef _power_electronics_H
00011 #define _power_electronics_H
00012
00013 #include <stdarg.h>
00014 #include "../powerflow/powerflow_object.h"
00015
00016 #include "gridlabd.h"
00017
00024 class power_electronics
00025 {
00026 private:
00027
00028
00029
00030 protected:
00031
00032 public:
00033
00034 set phases;
00035 enum GENERATOR_MODE {CONSTANT_V=1, CONSTANT_PQ=2, CONSTANT_PF=4, SUPPLY_DRIVEN=5} gen_mode_v;
00036 enum GENERATOR_STATUS {OFFLINE=1, ONLINE=2} gen_status_v;
00037 enum CONVERTER_TYPE{VOLTAGE_SOURCED=1, CURRENT_SOURCED=2} converter_type_v;
00038 enum SWITCH_TYPE {IDEAL_SWITCH=1, BJT=2, MOSFET=3, SCR=4, JFET=5, IBJT=6, DARLINGTON=7}switch_type_v;
00039 enum FILTER_TYPE {LOW_PASS=1, HIGH_PASS=2, BAND_STOP=3, BAND_PASS=4} filter_type_v;
00040 enum FILTER_IMPLEMENTATION {IDEAL_FILTER=1, CAPACITIVE=2, INDUCTIVE=3, SERIES_RESONANT=4, PARALLEL_RESONANT=5} filter_imp_v;
00041
00042 enum FILTER_FREQUENCY{F120HZ=1, F180HZ=2, F240HZ=3} filter_freq_v;
00043 enum POWER_TYPE{DC=1, AC=2} power_type_v;
00044
00045 double set_terminal_voltage;
00046 double max_current_step_size;
00047 double Rated_kW;
00048 double Max_P;
00049 double Min_P;
00050 double Max_Q;
00051 double Min_Q;
00052 double Rated_kVA;
00053 double Rated_kV;
00054 double Rinternal;
00055 double Rload;
00056 double Rtotal;
00057 double Rphase;
00058 complex Xphase;
00059 double Rground;
00060 double Rground_storage;
00061 double Rsfilter[3];
00062 double Rgfilter[3];
00063 double Xsfilter[3];
00064 double Xgfilter[3];
00065
00066 double Rsfilter_total;
00067 double Rgfilter_total;
00068 double Xsfilter_total;
00069 double Xgfilter_total;
00070
00071 char* parent_string;
00072
00073
00074 double Cinternal;
00075 double Cground;
00076 double Ctotal;
00077
00078 double Linternal;
00079 double Lground;
00080 double Ltotal;
00081
00082 double Vdc;
00083
00084 bool filter_120HZ;
00085 bool filter_180HZ;
00086 bool filter_240HZ;
00087 double pf_in;
00088 double pf_out;
00089 int number_of_phases_in;
00090 int number_of_phases_out;
00091 bool phaseAIn;
00092 bool phaseBIn;
00093 bool phaseCIn;
00094 bool phaseAOut;
00095 bool phaseBOut;
00096 bool phaseCOut;
00097
00098
00099
00100
00101
00102
00103
00104
00105 public:
00106 SWITCH_TYPE switch_type_choice;
00107
00108
00109
00110
00111 POWER_TYPE power_in;
00112 POWER_TYPE power_out;
00113 double efficiency;
00114 complex losses;
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155 public:
00156
00157 power_electronics(void);
00158 power_electronics(MODULE *module);
00159 int create(void);
00160 int init(OBJECT *parent);
00161
00162
00163 int filter_circuit_impact(FILTER_TYPE filter_type_choice, FILTER_IMPLEMENTATION filter_implementation_choice);
00164 complex filter_voltage_impact_source(complex desired_I_out, complex desired_V_out);
00165 complex filter_current_impact_source(complex desired_I_out, complex desired_V_out);
00166 complex filter_voltage_impact_out(complex source_I_in, complex source_V_in);
00167 complex filter_current_impact_out(complex source_I_in, complex source_V_in);
00168 double internal_switch_resistance(SWITCH_TYPE switch_type_choice);
00169 double calculate_loss(double Rtotal, double LTotal, double Ctotal, POWER_TYPE power_in, POWER_TYPE power_out);
00170 double calculate_frequency_loss(double frequency, double Rtotal, double Ltotal, double Ctotal);
00171
00172 TIMESTAMP presync(TIMESTAMP t0, TIMESTAMP t1);
00173 TIMESTAMP sync(TIMESTAMP t0, TIMESTAMP t1);
00174 TIMESTAMP postsync(TIMESTAMP t0, TIMESTAMP t1);
00175 public:
00176 static CLASS *oclass;
00177 static power_electronics *defaults;
00178 #ifdef OPTIONAL
00179 static CLASS *pclass;
00180 TIMESTAMPP plc(TIMESTAMP t0, TIMESTAMP t1);
00181 #endif
00182 };
00183
00184 #endif