00001
00009 #ifndef _energy_storage_H
00010 #define _energy_storage_H
00011
00012 #include <stdarg.h>
00013 #include "../powerflow/powerflow_object.h"
00014
00015 #include "gridlabd.h"
00016
00017 class energy_storage
00018 {
00019 private:
00020
00021
00022
00023 protected:
00024
00025 public:
00026
00027 set phases;
00028 enum GENERATOR_MODE {CONSTANT_V=1, CONSTANT_PQ, CONSTANT_PF, SUPPLY_DRIVEN} gen_mode_v;
00029
00030 enum GENERATOR_STATUS {OFFLINE=1, ONLINE=2} gen_status_v;
00031 enum POWER_TYPE{DC=0, AC=1} power_type_v;
00032
00033 complex V_Max;
00034 complex I_Max;
00035 double E_Max;
00036 double Energy;
00037 bool recalculate;
00038 double margin;
00039
00040 double Max_P;
00041 double Min_P;
00042
00043
00044
00045 double Rated_kVA;
00046
00047
00048 double efficiency;
00049
00050 TIMESTAMP prev_time;
00051 double E_Next;
00052
00053
00054 complex V_In;
00055 complex I_In;
00056 complex V_Internal;
00057 double Rinternal;
00058 complex VA_Internal;
00059 complex I_Prev;
00060 complex I_Internal;
00061 double base_efficiency;
00062
00063 complex V_Out;
00064
00065 complex I_Out;
00066
00067 complex VA_Out;
00068
00069 complex *pCircuit_V;
00070 complex *pLine_I;
00071 bool connected;
00072
00073 public:
00074
00075 energy_storage(void);
00076 energy_storage(MODULE *module);
00077 int create(void);
00078 int init(OBJECT *parent);
00079
00080
00081
00082
00083 double calculate_efficiency(complex voltage, complex current);
00084
00085 TIMESTAMP presync(TIMESTAMP t0, TIMESTAMP t1);
00086 TIMESTAMP sync(TIMESTAMP t0, TIMESTAMP t1);
00087 TIMESTAMP postsync(TIMESTAMP t0, TIMESTAMP t1);
00088
00089 complex *get_complex(OBJECT *obj, char *name);
00090 complex calculate_v_terminal(complex v, complex i);
00091
00092 public:
00093 static CLASS *oclass;
00094 static energy_storage *defaults;
00095 #ifdef OPTIONAL
00096 static CLASS *pclass;
00097 TIMESTAMPP plc(TIMESTAMP t0, TIMESTAMP t1);
00098 #endif
00099 };
00100
00101 #endif
00102
00112 #ifndef _energy_storage_H
00113 #define _energy_storage_H
00114
00115 #include <stdarg.h>
00116 #include "gridlabd.h"
00117
00118 class energy_storage {
00119 private:
00120
00121 protected:
00122
00123 public:
00124
00125 public:
00126
00127 energy_storage(MODULE *module);
00128 int create(void);
00129 int init(OBJECT *parent);
00130 TIMESTAMP presync(TIMESTAMP t0, TIMESTAMP t1);
00131 TIMESTAMP sync(TIMESTAMP t0, TIMESTAMP t1);
00132 TIMESTAMP postsync(TIMESTAMP t0, TIMESTAMP t1);
00133 public:
00134 static CLASS *oclass;
00135 static energy_storage *defaults;
00136 #ifdef OPTIONAL
00137 static CLASS *pclass;
00138 TIMESTAMPP plc(TIMESTAMP t0, TIMESTAMP t1);
00139 #endif
00140 };
00141
00142 #endif
00143