00001
00081 #include <stdlib.h>
00082 #include <stdio.h>
00083 #include <errno.h>
00084 #include <math.h>
00085 #include "solvers.h"
00086 #include "house_e.h"
00087 #include "lock.h"
00088 #include "complex.h"
00089
00090 #ifndef WIN32
00091 char *_strlwr(char *s)
00092 {
00093 char *r=s;
00094 while (*s!='\0')
00095 {
00096 *s = (*s>='A'&&*s<='Z') ? (*s-'A'+'a') : *s;
00097 s++;
00098 }
00099 return r;
00100 }
00101 #endif
00102
00103
00104 set house_e::implicit_enduses_active = IEU_ALL;
00105 static double aux_cutin_temperature = 10;
00106
00108
00110 struct s_implicit_enduse_list {
00111 char *implicit_name;
00112 struct {
00113 double breaker_amps;
00114 int circuit_is220;
00115 struct {
00116 double z, i, p;
00117 } fractions;
00118 double power_factor;
00119 double heat_fraction;
00120 } load;
00121 char *shape;
00122 char *schedule_name;
00123 char *schedule_definition;
00124 } implicit_enduse_data[] =
00125 {
00126
00127 { "LIGHTS",
00128 {30, false, {0.5,0.1,0.4}, 0.97, 0.9},
00129 "type:analog; schedule: residential-lights-default; power: 0.76 kW",
00130 "residential-lights-default",
00131 "positive; nonzero; weekday-summer {"
00132 "* 0 * 4-9 1-5 0.380; * 1 * 4-9 1-5 0.340; * 2 * 4-9 1-5 0.320; * 3 * 4-9 1-5 0.320;"
00133 "* 4 * 4-9 1-5 0.320; * 5 * 4-9 1-5 0.350; * 6 * 4-9 1-5 0.410; * 7 * 4-9 1-5 0.450;"
00134 "* 8 * 4-9 1-5 0.450; * 9 * 4-9 1-5 0.450; * 10 * 4-9 1-5 0.450; * 11 * 4-9 1-5 0.450;"
00135 "* 12 * 4-9 1-5 0.450; * 13 * 4-9 1-5 0.440; * 14 * 4-9 1-5 0.440; * 15 * 4-9 1-5 0.450;"
00136 "* 16 * 4-9 1-5 0.470; * 17 * 4-9 1-5 0.510; * 18 * 4-9 1-5 0.540; * 19 * 4-9 1-5 0.560;"
00137 "* 20 * 4-9 1-5 0.630; * 21 * 4-9 1-5 0.710; * 22 * 4-9 1-5 0.650; * 23 * 4-9 1-5 0.490"
00138 "}"
00139 "weekend-summer {"
00140 "* 0 * 4-9 6-0 0.410; * 1 * 4-9 6-0 0.360; * 2 * 4-9 6-0 0.330; * 3 * 4-9 6-0 0.320;"
00141 "* 4 * 4-9 6-0 0.320; * 5 * 4-9 6-0 0.320; * 6 * 4-9 6-0 0.340; * 7 * 4-9 6-0 0.390;"
00142 "* 8 * 4-9 6-0 0.440; * 9 * 4-9 6-0 0.470; * 10 * 4-9 6-0 0.470; * 11 * 4-9 6-0 0.470;"
00143 "* 12 * 4-9 6-0 0.470; * 13 * 4-9 6-0 0.460; * 14 * 4-9 6-0 0.460; * 15 * 4-9 6-0 0.460;"
00144 "* 16 * 4-9 6-0 0.470; * 17 * 4-9 6-0 0.490; * 18 * 4-9 6-0 0.520; * 19 * 4-9 6-0 0.540;"
00145 "* 20 * 4-9 6-0 0.610; * 21 * 4-9 6-0 0.680; * 22 * 4-9 6-0 0.630; * 23 * 4-9 6-0 0.500"
00146 "}"
00147 "weekday-winter {"
00148 "* 0 * 10-3 1-5 0.4200; * 1 * 10-3 1-5 0.3800; * 2 * 10-3 1-5 0.3700; * 3 * 10-3 1-5 0.3600;"
00149 "* 4 * 10-3 1-5 0.3700; * 5 * 10-3 1-5 0.4200; * 6 * 10-3 1-5 0.5800; * 7 * 10-3 1-5 0.6900;"
00150 "* 8 * 10-3 1-5 0.6100; * 9 * 10-3 1-5 0.5600; * 10 * 10-3 1-5 0.5300; * 11 * 10-3 1-5 0.5100;"
00151 "* 12 * 10-3 1-5 0.4900; * 13 * 10-3 1-5 0.4700; * 14 * 10-3 1-5 0.4700; * 15 * 10-3 1-5 0.5100;"
00152 "* 16 * 10-3 1-5 0.6300; * 17 * 10-3 1-5 0.8400; * 18 * 10-3 1-5 0.9700; * 19 * 10-3 1-5 0.9800;"
00153 "* 20 * 10-3 1-5 0.9600; * 21 * 10-3 1-5 0.8900; * 22 * 10-3 1-5 0.7400; * 23 * 10-3 1-5 0.5500"
00154 "}"
00155 "weekend-winter {"
00156 "* 0 * 10-3 6-0 0.4900; * 1 * 10-3 6-0 0.4200; * 2 * 10-3 6-0 0.3800; * 3 * 10-3 6-0 0.3800;"
00157 "* 4 * 10-3 6-0 0.3700; * 5 * 10-3 6-0 0.3800; * 6 * 10-3 6-0 0.4300; * 7 * 10-3 6-0 0.5100;"
00158 "* 8 * 10-3 6-0 0.6000; * 9 * 10-3 6-0 0.6300; * 10 * 10-3 6-0 0.6300; * 11 * 10-3 6-0 0.6100;"
00159 "* 12 * 10-3 6-0 0.6000; * 13 * 10-3 6-0 0.5900; * 14 * 10-3 6-0 0.5900; * 15 * 10-3 6-0 0.6100;"
00160 "* 16 * 10-3 6-0 0.7100; * 17 * 10-3 6-0 0.8800; * 18 * 10-3 6-0 0.9600; * 19 * 10-3 6-0 0.9700;"
00161 "* 20 * 10-3 6-0 0.9400; * 21 * 10-3 6-0 0.8800; * 22 * 10-3 6-0 0.7600; * 23 * 10-3 6-0 0.5800"
00162 "}"
00163 },
00164
00165 { "PLUGS",
00166 {30, false, {0.0,0.0,1.0}, 0.90, 0.9},
00167 "type:analog; schedule: residential-plugs-default; power: 0.36 kW",
00168 "residential-plugs-default",
00169 "positive; nonzero; weekday-summer {"
00170 "* 0 * 4-9 1-5 0.380; * 1 * 4-9 1-5 0.340; * 2 * 4-9 1-5 0.320; * 3 * 4-9 1-5 0.320;"
00171 "* 4 * 4-9 1-5 0.320; * 5 * 4-9 1-5 0.350; * 6 * 4-9 1-5 0.410; * 7 * 4-9 1-5 0.450;"
00172 "* 8 * 4-9 1-5 0.450; * 9 * 4-9 1-5 0.450; * 10 * 4-9 1-5 0.450; * 11 * 4-9 1-5 0.450;"
00173 "* 12 * 4-9 1-5 0.450; * 13 * 4-9 1-5 0.440; * 14 * 4-9 1-5 0.440; * 15 * 4-9 1-5 0.450;"
00174 "* 16 * 4-9 1-5 0.470; * 17 * 4-9 1-5 0.510; * 18 * 4-9 1-5 0.540; * 19 * 4-9 1-5 0.560;"
00175 "* 20 * 4-9 1-5 0.630; * 21 * 4-9 1-5 0.710; * 22 * 4-9 1-5 0.650; * 23 * 4-9 1-5 0.490"
00176 "}"
00177 "weekend-summer {"
00178 "* 0 * 4-9 6-0 0.410; * 1 * 4-9 6-0 0.360; * 2 * 4-9 6-0 0.330; * 3 * 4-9 6-0 0.320;"
00179 "* 4 * 4-9 6-0 0.320; * 5 * 4-9 6-0 0.320; * 6 * 4-9 6-0 0.340; * 7 * 4-9 6-0 0.390;"
00180 "* 8 * 4-9 6-0 0.440; * 9 * 4-9 6-0 0.470; * 10 * 4-9 6-0 0.470; * 11 * 4-9 6-0 0.470;"
00181 "* 12 * 4-9 6-0 0.470; * 13 * 4-9 6-0 0.460; * 14 * 4-9 6-0 0.460; * 15 * 4-9 6-0 0.460;"
00182 "* 16 * 4-9 6-0 0.470; * 17 * 4-9 6-0 0.490; * 18 * 4-9 6-0 0.520; * 19 * 4-9 6-0 0.540;"
00183 "* 20 * 4-9 6-0 0.610; * 21 * 4-9 6-0 0.680; * 22 * 4-9 6-0 0.630; * 23 * 4-9 6-0 0.500"
00184 "}"
00185 "weekday-winter {"
00186 "* 0 * 10-3 1-5 0.4200; * 1 * 10-3 1-5 0.3800; * 2 * 10-3 1-5 0.3700; * 3 * 10-3 1-5 0.3600;"
00187 "* 4 * 10-3 1-5 0.3700; * 5 * 10-3 1-5 0.4200; * 6 * 10-3 1-5 0.5800; * 7 * 10-3 1-5 0.6900;"
00188 "* 8 * 10-3 1-5 0.6100; * 9 * 10-3 1-5 0.5600; * 10 * 10-3 1-5 0.5300; * 11 * 10-3 1-5 0.5100;"
00189 "* 12 * 10-3 1-5 0.4900; * 13 * 10-3 1-5 0.4700; * 14 * 10-3 1-5 0.4700; * 15 * 10-3 1-5 0.5100;"
00190 "* 16 * 10-3 1-5 0.6300; * 17 * 10-3 1-5 0.8400; * 18 * 10-3 1-5 0.9700; * 19 * 10-3 1-5 0.9800;"
00191 "* 20 * 10-3 1-5 0.9600; * 21 * 10-3 1-5 0.8900; * 22 * 10-3 1-5 0.7400; * 23 * 10-3 1-5 0.5500"
00192 "}"
00193 "weekend-winter {"
00194 "* 0 * 10-3 6-0 0.4900; * 1 * 10-3 6-0 0.4200; * 2 * 10-3 6-0 0.3800; * 3 * 10-3 6-0 0.3800;"
00195 "* 4 * 10-3 6-0 0.3700; * 5 * 10-3 6-0 0.3800; * 6 * 10-3 6-0 0.4300; * 7 * 10-3 6-0 0.5100;"
00196 "* 8 * 10-3 6-0 0.6000; * 9 * 10-3 6-0 0.6300; * 10 * 10-3 6-0 0.6300; * 11 * 10-3 6-0 0.6100;"
00197 "* 12 * 10-3 6-0 0.6000; * 13 * 10-3 6-0 0.5900; * 14 * 10-3 6-0 0.5900; * 15 * 10-3 6-0 0.6100;"
00198 "* 16 * 10-3 6-0 0.7100; * 17 * 10-3 6-0 0.8800; * 18 * 10-3 6-0 0.9600; * 19 * 10-3 6-0 0.9700;"
00199 "* 20 * 10-3 6-0 0.9400; * 21 * 10-3 6-0 0.8800; * 22 * 10-3 6-0 0.7600; * 23 * 10-3 6-0 0.5800"
00200 "}"
00201 },
00202
00203 { "CLOTHESWASHER",
00204 {20, false, {0.0,0.0,1.0}, 0.9, 1.0},
00205 "type:analog; schedule: residential-clotheswasher-default; energy: 0.75 kWh; power: 1 kW",
00206 "residential-clotheswasher-default",
00207 "positive; nonzero; weekday-summer {"
00208 "* 0 * 4-9 1-5 0.0029; * 1 * 4-9 1-5 0.0019; * 2 * 4-9 1-5 0.0014; * 3 * 4-9 1-5 0.0013;"
00209 "* 4 * 4-9 1-5 0.0018; * 5 * 4-9 1-5 0.0026; * 6 * 4-9 1-5 0.0055; * 7 * 4-9 1-5 0.0126;"
00210 "* 8 * 4-9 1-5 0.0181; * 9 * 4-9 1-5 0.0208; * 10 * 4-9 1-5 0.0229; * 11 * 4-9 1-5 0.0216;"
00211 "* 12 * 4-9 1-5 0.0193; * 13 * 4-9 1-5 0.0170; * 14 * 4-9 1-5 0.0145; * 15 * 4-9 1-5 0.0135;"
00212 "* 16 * 4-9 1-5 0.0135; * 17 * 4-9 1-5 0.0142; * 18 * 4-9 1-5 0.0145; * 19 * 4-9 1-5 0.0148;"
00213 "* 20 * 4-9 1-5 0.0146; * 21 * 4-9 1-5 0.0141; * 22 * 4-9 1-5 0.0110; * 23 * 4-9 1-5 0.0062"
00214 "}"
00215 "weekend-summer {"
00216 "* 0 * 4-9 6-0 0.0031; * 1 * 4-9 6-0 0.0019; * 2 * 4-9 6-0 0.0013; * 3 * 4-9 6-0 0.0012;"
00217 "* 4 * 4-9 6-0 0.0012; * 5 * 4-9 6-0 0.0016; * 6 * 4-9 6-0 0.0027; * 7 * 4-9 6-0 0.0066;"
00218 "* 8 * 4-9 6-0 0.0157; * 9 * 4-9 6-0 0.0220; * 10 * 4-9 6-0 0.0258; * 11 * 4-9 6-0 0.0251;"
00219 "* 12 * 4-9 6-0 0.0231; * 13 * 4-9 6-0 0.0217; * 14 * 4-9 6-0 0.0186; * 15 * 4-9 6-0 0.0157;"
00220 "* 16 * 4-9 6-0 0.0156; * 17 * 4-9 6-0 0.0151; * 18 * 4-9 6-0 0.0147; * 19 * 4-9 6-0 0.0150;"
00221 "* 20 * 4-9 6-0 0.0156; * 21 * 4-9 6-0 0.0148; * 22 * 4-9 6-0 0.0106; * 23 * 4-9 6-0 0.0065"
00222 "}"
00223 "weekday-winter {"
00224 "* 0 * 10-3 1-5 0.0036; * 1 * 10-3 1-5 0.0024; * 2 * 10-3 1-5 0.0020; * 3 * 10-3 1-5 0.0019;"
00225 "* 4 * 10-3 1-5 0.0026; * 5 * 10-3 1-5 0.0040; * 6 * 10-3 1-5 0.0062; * 7 * 10-3 1-5 0.0118;"
00226 "* 8 * 10-3 1-5 0.0177; * 9 * 10-3 1-5 0.0211; * 10 * 10-3 1-5 0.0215; * 11 * 10-3 1-5 0.0203;"
00227 "* 12 * 10-3 1-5 0.0176; * 13 * 10-3 1-5 0.0155; * 14 * 10-3 1-5 0.0133; * 15 * 10-3 1-5 0.0130;"
00228 "* 16 * 10-3 1-5 0.0145; * 17 * 10-3 1-5 0.0159; * 18 * 10-3 1-5 0.0166; * 19 * 10-3 1-5 0.0164;"
00229 "* 20 * 10-3 1-5 0.0154; * 21 * 10-3 1-5 0.0149; * 22 * 10-3 1-5 0.0110; * 23 * 10-3 1-5 0.0065"
00230 "}"
00231 "weekend-winter {"
00232 "* 0 * 10-3 6-0 0.0044; * 1 * 10-3 6-0 0.0030; * 2 * 10-3 6-0 0.0022; * 3 * 10-3 6-0 0.0020;"
00233 "* 4 * 10-3 6-0 0.0021; * 5 * 10-3 6-0 0.0021; * 6 * 10-3 6-0 0.0030; * 7 * 10-3 6-0 0.0067;"
00234 "* 8 * 10-3 6-0 0.0145; * 9 * 10-3 6-0 0.0244; * 10 * 10-3 6-0 0.0310; * 11 * 10-3 6-0 0.0323;"
00235 "* 12 * 10-3 6-0 0.0308; * 13 * 10-3 6-0 0.0285; * 14 * 10-3 6-0 0.0251; * 15 * 10-3 6-0 0.0224;"
00236 "* 16 * 10-3 6-0 0.0215; * 17 * 10-3 6-0 0.0203; * 18 * 10-3 6-0 0.0194; * 19 * 10-3 6-0 0.0188;"
00237 "* 20 * 10-3 6-0 0.0180; * 21 * 10-3 6-0 0.0151; * 22 * 10-3 6-0 0.0122; * 23 * 10-3 6-0 0.0073"
00238 "}"
00239 },
00240
00241 { "WATERHEATER",
00242 {30, true, {0.0,0.0,1.0}, 1.0, 0.5},
00243 "type:analog; schedule: residential-waterheater-default; energy: 1 kWh; power: 5 kW",
00244 "residential-waterheater-default",
00245 "positive; nonzero; weekday-summer {"
00246 "* 0 * 4-9 1-5 0.21; * 1 * 4-9 1-5 0.16; * 2 * 4-9 1-5 0.13; * 3 * 4-9 1-5 0.12;"
00247 "* 4 * 4-9 1-5 0.15; * 5 * 4-9 1-5 0.26; * 6 * 4-9 1-5 0.51; * 7 * 4-9 1-5 0.76;"
00248 "* 8 * 4-9 1-5 0.77; * 9 * 4-9 1-5 0.76; * 10 * 4-9 1-5 0.71; * 11 * 4-9 1-5 0.61;"
00249 "* 12 * 4-9 1-5 0.54; * 13 * 4-9 1-5 0.49; * 14 * 4-9 1-5 0.43; * 15 * 4-9 1-5 0.41;"
00250 "* 16 * 4-9 1-5 0.43; * 17 * 4-9 1-5 0.52; * 18 * 4-9 1-5 0.60; * 19 * 4-9 1-5 0.60;"
00251 "* 20 * 4-9 1-5 0.59; * 21 * 4-9 1-5 0.60; * 22 * 4-9 1-5 0.55; * 23 * 4-9 1-5 0.37"
00252 "}"
00253 "weekend-summer {"
00254 "* 0 * 4-9 6-0 0.23; * 1 * 4-9 6-0 0.17; * 2 * 4-9 6-0 0.14; * 3 * 4-9 6-0 0.13;"
00255 "* 4 * 4-9 6-0 0.13; * 5 * 4-9 6-0 0.17; * 6 * 4-9 6-0 0.26; * 7 * 4-9 6-0 0.45;"
00256 "* 8 * 4-9 6-0 0.69; * 9 * 4-9 6-0 0.85; * 10 * 4-9 6-0 0.84; * 11 * 4-9 6-0 0.76;"
00257 "* 12 * 4-9 6-0 0.65; * 13 * 4-9 6-0 0.58; * 14 * 4-9 6-0 0.49; * 15 * 4-9 6-0 0.46;"
00258 "* 16 * 4-9 6-0 0.46; * 17 * 4-9 6-0 0.50; * 18 * 4-9 6-0 0.54; * 19 * 4-9 6-0 0.55;"
00259 "* 20 * 4-9 6-0 0.56; * 21 * 4-9 6-0 0.56; * 22 * 4-9 6-0 0.49; * 23 * 4-9 6-0 0.38"
00260 "}"
00261 "weekday-winter {"
00262 "* 0 * 10-3 1-5 0.25; * 1 * 10-3 1-5 0.19; * 2 * 10-3 1-5 0.16; * 3 * 10-3 1-5 0.15;"
00263 "* 4 * 10-3 1-5 0.18; * 5 * 10-3 1-5 0.34; * 6 * 10-3 1-5 0.74; * 7 * 10-3 1-5 1.20;"
00264 "* 8 * 10-3 1-5 1.10; * 9 * 10-3 1-5 0.94; * 10 * 10-3 1-5 0.82; * 11 * 10-3 1-5 0.71;"
00265 "* 12 * 10-3 1-5 0.62; * 13 * 10-3 1-5 0.55; * 14 * 10-3 1-5 0.48; * 15 * 10-3 1-5 0.47;"
00266 "* 16 * 10-3 1-5 0.54; * 17 * 10-3 1-5 0.68; * 18 * 10-3 1-5 0.83; * 19 * 10-3 1-5 0.82;"
00267 "* 20 * 10-3 1-5 0.74; * 21 * 10-3 1-5 0.68; * 22 * 10-3 1-5 0.57; * 23 * 10-3 1-5 0.40"
00268 "}"
00269 "weekend-winter {"
00270 "* 0 * 10-3 6-0 0.29; * 1 * 10-3 6-0 0.22; * 2 * 10-3 6-0 0.17; * 3 * 10-3 6-0 0.15;"
00271 "* 4 * 10-3 6-0 0.16; * 5 * 10-3 6-0 0.19; * 6 * 10-3 6-0 0.27; * 7 * 10-3 6-0 0.47;"
00272 "* 8 * 10-3 6-0 0.82; * 9 * 10-3 6-0 1.08; * 10 * 10-3 6-0 1.15; * 11 * 10-3 6-0 1.08;"
00273 "* 12 * 10-3 6-0 0.98; * 13 * 10-3 6-0 0.87; * 14 * 10-3 6-0 0.77; * 15 * 10-3 6-0 0.69;"
00274 "* 16 * 10-3 6-0 0.72; * 17 * 10-3 6-0 0.78; * 18 * 10-3 6-0 0.83; * 19 * 10-3 6-0 0.79;"
00275 "* 20 * 10-3 6-0 0.72; * 21 * 10-3 6-0 0.64; * 22 * 10-3 6-0 0.53; * 23 * 10-3 6-0 0.43"
00276 "}"
00277 },
00278
00279 { "REFRIGERATOR",
00280 {20, false, {0.1,0.0,0.9}, 0.9, 1.0},
00281 "type:analog; schedule: residential-refrigerator-default; energy: 1 kWh; power: 750 W",
00282 "residential-refrigerator-default",
00283 "positive; nonzero; weekday-summer {"
00284 "* 0 * 4-9 1-5 0.187; * 1 * 4-9 1-5 0.182; * 2 * 4-9 1-5 0.176; * 3 * 4-9 1-5 0.170;"
00285 "* 4 * 4-9 1-5 0.168; * 5 * 4-9 1-5 0.168; * 6 * 4-9 1-5 0.177; * 7 * 4-9 1-5 0.174;"
00286 "* 8 * 4-9 1-5 0.177; * 9 * 4-9 1-5 0.180; * 10 * 4-9 1-5 0.180; * 11 * 4-9 1-5 0.183;"
00287 "* 12 * 4-9 1-5 0.192; * 13 * 4-9 1-5 0.192; * 14 * 4-9 1-5 0.194; * 15 * 4-9 1-5 0.196;"
00288 "* 16 * 4-9 1-5 0.205; * 17 * 4-9 1-5 0.217; * 18 * 4-9 1-5 0.225; * 19 * 4-9 1-5 0.221;"
00289 "* 20 * 4-9 1-5 0.216; * 21 * 4-9 1-5 0.214; * 22 * 4-9 1-5 0.207; * 23 * 4-9 1-5 0.195"
00290 "}"
00291 "weekend-summer {"
00292 "* 0 * 4-9 6-0 0.187; * 1 * 4-9 6-0 0.181; * 2 * 4-9 6-0 0.176; * 3 * 4-9 6-0 0.169;"
00293 "* 4 * 4-9 6-0 0.166; * 5 * 4-9 6-0 0.164; * 6 * 4-9 6-0 0.167; * 7 * 4-9 6-0 0.169;"
00294 "* 8 * 4-9 6-0 0.180; * 9 * 4-9 6-0 0.184; * 10 * 4-9 6-0 0.187; * 11 * 4-9 6-0 0.187;"
00295 "* 12 * 4-9 6-0 0.195; * 13 * 4-9 6-0 0.200; * 14 * 4-9 6-0 0.201; * 15 * 4-9 6-0 0.203;"
00296 "* 16 * 4-9 6-0 0.209; * 17 * 4-9 6-0 0.218; * 18 * 4-9 6-0 0.222; * 19 * 4-9 6-0 0.221;"
00297 "* 20 * 4-9 6-0 0.217; * 21 * 4-9 6-0 0.216; * 22 * 4-9 6-0 0.207; * 23 * 4-9 6-0 0.196"
00298 "}"
00299 "weekday-winter {"
00300 "* 0 * 10-3 1-5 0.1530; * 1 * 10-3 1-5 0.1500; * 2 * 10-3 1-5 0.1460; * 3 * 10-3 1-5 0.1420;"
00301 "* 4 * 10-3 1-5 0.1400; * 5 * 10-3 1-5 0.1450; * 6 * 10-3 1-5 0.1520; * 7 * 10-3 1-5 0.1600;"
00302 "* 8 * 10-3 1-5 0.1580; * 9 * 10-3 1-5 0.1580; * 10 * 10-3 1-5 0.1560; * 11 * 10-3 1-5 0.1560;"
00303 "* 12 * 10-3 1-5 0.1630; * 13 * 10-3 1-5 0.1620; * 14 * 10-3 1-5 0.1590; * 15 * 10-3 1-5 0.1620;"
00304 "* 16 * 10-3 1-5 0.1690; * 17 * 10-3 1-5 0.1850; * 18 * 10-3 1-5 0.1920; * 19 * 10-3 1-5 0.1820;"
00305 "* 20 * 10-3 1-5 0.1800; * 21 * 10-3 1-5 0.1760; * 22 * 10-3 1-5 0.1670; * 23 * 10-3 1-5 0.1590"
00306 "}"
00307 "weekend-winter {"
00308 "* 0 * 10-3 6-0 0.1560; * 1 * 10-3 6-0 0.1520; * 2 * 10-3 6-0 0.1470; * 3 * 10-3 6-0 0.1430;"
00309 "* 4 * 10-3 6-0 0.1420; * 5 * 10-3 6-0 0.1430; * 6 * 10-3 6-0 0.1430; * 7 * 10-3 6-0 0.1500;"
00310 "* 8 * 10-3 6-0 0.1610; * 9 * 10-3 6-0 0.1690; * 10 * 10-3 6-0 0.1670; * 11 * 10-3 6-0 0.1660;"
00311 "* 12 * 10-3 6-0 0.1740; * 13 * 10-3 6-0 0.1760; * 14 * 10-3 6-0 0.1740; * 15 * 10-3 6-0 0.1750;"
00312 "* 16 * 10-3 6-0 0.1790; * 17 * 10-3 6-0 0.1910; * 18 * 10-3 6-0 0.1930; * 19 * 10-3 6-0 0.1870;"
00313 "* 20 * 10-3 6-0 0.1840; * 21 * 10-3 6-0 0.1780; * 22 * 10-3 6-0 0.1700; * 23 * 10-3 6-0 0.1600"
00314 "}"
00315 },
00316
00317 { "DRYER",
00318 {30, true, {0.9,0.0,0.1}, 0.99, 0.15},
00319 "type:analog; schedule: residential-dryer-default; energy: 2.5 kWh; power: 5 kW",
00320 "residential-dryer-default",
00321 "positive; nonzero; weekday-summer {"
00322 "* 0 * 4-9 1-5 0.036; * 1 * 4-9 1-5 0.013; * 2 * 4-9 1-5 0.007; * 3 * 4-9 1-5 0.005;"
00323 "* 4 * 4-9 1-5 0.005; * 5 * 4-9 1-5 0.017; * 6 * 4-9 1-5 0.048; * 7 * 4-9 1-5 0.085;"
00324 "* 8 * 4-9 1-5 0.115; * 9 * 4-9 1-5 0.156; * 10 * 4-9 1-5 0.179; * 11 * 4-9 1-5 0.185;"
00325 "* 12 * 4-9 1-5 0.172; * 13 * 4-9 1-5 0.162; * 14 * 4-9 1-5 0.145; * 15 * 4-9 1-5 0.136;"
00326 "* 16 * 4-9 1-5 0.133; * 17 * 4-9 1-5 0.134; * 18 * 4-9 1-5 0.127; * 19 * 4-9 1-5 0.130;"
00327 "* 20 * 4-9 1-5 0.141; * 21 * 4-9 1-5 0.154; * 22 * 4-9 1-5 0.138; * 23 * 4-9 1-5 0.083"
00328 "}"
00329 "weekend-summer {"
00330 "* 0 * 4-9 6-0 0.041; * 1 * 4-9 6-0 0.017; * 2 * 4-9 6-0 0.008; * 3 * 4-9 6-0 0.005;"
00331 "* 4 * 4-9 6-0 0.005; * 5 * 4-9 6-0 0.007; * 6 * 4-9 6-0 0.018; * 7 * 4-9 6-0 0.047;"
00332 "* 8 * 4-9 6-0 0.100; * 9 * 4-9 6-0 0.168; * 10 * 4-9 6-0 0.205; * 11 * 4-9 6-0 0.220;"
00333 "* 12 * 4-9 6-0 0.211; * 13 * 4-9 6-0 0.210; * 14 * 4-9 6-0 0.188; * 15 * 4-9 6-0 0.168;"
00334 "* 16 * 4-9 6-0 0.154; * 17 * 4-9 6-0 0.146; * 18 * 4-9 6-0 0.138; * 19 * 4-9 6-0 0.137;"
00335 "* 20 * 4-9 6-0 0.144; * 21 * 4-9 6-0 0.155; * 22 * 4-9 6-0 0.131; * 23 * 4-9 6-0 0.081"
00336 "}"
00337 "weekday-winter {"
00338 "* 0 * 10-3 1-5 0.0360; * 1 * 10-3 1-5 0.0160; * 2 * 10-3 1-5 0.0100; * 3 * 10-3 1-5 0.0070;"
00339 "* 4 * 10-3 1-5 0.0090; * 5 * 10-3 1-5 0.0230; * 6 * 10-3 1-5 0.0610; * 7 * 10-3 1-5 0.1030;"
00340 "* 8 * 10-3 1-5 0.1320; * 9 * 10-3 1-5 0.1750; * 10 * 10-3 1-5 0.2050; * 11 * 10-3 1-5 0.2130;"
00341 "* 12 * 10-3 1-5 0.1940; * 13 * 10-3 1-5 0.1770; * 14 * 10-3 1-5 0.1610; * 15 * 10-3 1-5 0.1560;"
00342 "* 16 * 10-3 1-5 0.1640; * 17 * 10-3 1-5 0.1710; * 18 * 10-3 1-5 0.1610; * 19 * 10-3 1-5 0.1590;"
00343 "* 20 * 10-3 1-5 0.1670; * 21 * 10-3 1-5 0.1690; * 22 * 10-3 1-5 0.1380; * 23 * 10-3 1-5 0.0820"
00344 "}"
00345 "weekend-winter {"
00346 "* 0 * 10-3 6-0 0.0390; * 1 * 10-3 6-0 0.0190; * 2 * 10-3 6-0 0.0110; * 3 * 10-3 6-0 0.0070;"
00347 "* 4 * 10-3 6-0 0.0080; * 5 * 10-3 6-0 0.0090; * 6 * 10-3 6-0 0.0160; * 7 * 10-3 6-0 0.0430;"
00348 "* 8 * 10-3 6-0 0.1010; * 9 * 10-3 6-0 0.1810; * 10 * 10-3 6-0 0.2640; * 11 * 10-3 6-0 0.3050;"
00349 "* 12 * 10-3 6-0 0.3110; * 13 * 10-3 6-0 0.3060; * 14 * 10-3 6-0 0.2850; * 15 * 10-3 6-0 0.2700;"
00350 "* 16 * 10-3 6-0 0.2600; * 17 * 10-3 6-0 0.2450; * 18 * 10-3 6-0 0.2200; * 19 * 10-3 6-0 0.1980;"
00351 "* 20 * 10-3 6-0 0.1880; * 21 * 10-3 6-0 0.1790; * 22 * 10-3 6-0 0.1480; * 23 * 10-3 6-0 0.0930"
00352 "}"
00353 },
00354
00355 { "FREEZER",
00356 {20, false, {0.1,0.0,0.9}, 0.9, 1.0},
00357 "type:analog; schedule: residential-freezer-default; energy: 750 Wh; power: 500 W",
00358 "residential-freezer-default",
00359 "positive; nonzero; weekday-summer {"
00360 "* 0 * 4-9 1-5 0.210; * 1 * 4-9 1-5 0.213; * 2 * 4-9 1-5 0.208; * 3 * 4-9 1-5 0.202;"
00361 "* 4 * 4-9 1-5 0.203; * 5 * 4-9 1-5 0.198; * 6 * 4-9 1-5 0.190; * 7 * 4-9 1-5 0.186;"
00362 "* 8 * 4-9 1-5 0.189; * 9 * 4-9 1-5 0.194; * 10 * 4-9 1-5 0.199; * 11 * 4-9 1-5 0.202;"
00363 "* 12 * 4-9 1-5 0.211; * 13 * 4-9 1-5 0.214; * 14 * 4-9 1-5 0.219; * 15 * 4-9 1-5 0.222;"
00364 "* 16 * 4-9 1-5 0.230; * 17 * 4-9 1-5 0.228; * 18 * 4-9 1-5 0.229; * 19 * 4-9 1-5 0.223;"
00365 "* 20 * 4-9 1-5 0.224; * 21 * 4-9 1-5 0.223; * 22 * 4-9 1-5 0.218; * 23 * 4-9 1-5 0.214"
00366 "}"
00367 "weekend-summer {"
00368 "* 0 * 4-9 6-0 0.203; * 1 * 4-9 6-0 0.202; * 2 * 4-9 6-0 0.202; * 3 * 4-9 6-0 0.193;"
00369 "* 4 * 4-9 6-0 0.198; * 5 * 4-9 6-0 0.195; * 6 * 4-9 6-0 0.191; * 7 * 4-9 6-0 0.183;"
00370 "* 8 * 4-9 6-0 0.184; * 9 * 4-9 6-0 0.192; * 10 * 4-9 6-0 0.197; * 11 * 4-9 6-0 0.202;"
00371 "* 12 * 4-9 6-0 0.208; * 13 * 4-9 6-0 0.219; * 14 * 4-9 6-0 0.219; * 15 * 4-9 6-0 0.225;"
00372 "* 16 * 4-9 6-0 0.225; * 17 * 4-9 6-0 0.225; * 18 * 4-9 6-0 0.223; * 19 * 4-9 6-0 0.219;"
00373 "* 20 * 4-9 6-0 0.221; * 21 * 4-9 6-0 0.220; * 22 * 4-9 6-0 0.215; * 23 * 4-9 6-0 0.209"
00374 "}"
00375 "weekday-winter {"
00376 "* 0 * 10-3 1-5 0.149; * 1 * 10-3 1-5 0.148; * 2 * 10-3 1-5 0.145; * 3 * 10-3 1-5 0.144;"
00377 "* 4 * 10-3 1-5 0.143; * 5 * 10-3 1-5 0.140; * 6 * 10-3 1-5 0.138; * 7 * 10-3 1-5 0.138;"
00378 "* 8 * 10-3 1-5 0.140; * 9 * 10-3 1-5 0.141; * 10 * 10-3 1-5 0.142; * 11 * 10-3 1-5 0.147;"
00379 "* 12 * 10-3 1-5 0.153; * 13 * 10-3 1-5 0.154; * 14 * 10-3 1-5 0.152; * 15 * 10-3 1-5 0.151;"
00380 "* 16 * 10-3 1-5 0.161; * 17 * 10-3 1-5 0.174; * 18 * 10-3 1-5 0.176; * 19 * 10-3 1-5 0.176;"
00381 "* 20 * 10-3 1-5 0.175; * 21 * 10-3 1-5 0.169; * 22 * 10-3 1-5 0.160; * 23 * 10-3 1-5 0.153"
00382 "}"
00383 "weekend-winter {"
00384 "* 0 * 10-3 6-0 0.155; * 1 * 10-3 6-0 0.150; * 2 * 10-3 6-0 0.143; * 3 * 10-3 6-0 0.141;"
00385 "* 4 * 10-3 6-0 0.141; * 5 * 10-3 6-0 0.139; * 6 * 10-3 6-0 0.138; * 7 * 10-3 6-0 0.139;"
00386 "* 8 * 10-3 6-0 0.142; * 9 * 10-3 6-0 0.142; * 10 * 10-3 6-0 0.145; * 11 * 10-3 6-0 0.153;"
00387 "* 12 * 10-3 6-0 0.161; * 13 * 10-3 6-0 0.162; * 14 * 10-3 6-0 0.160; * 15 * 10-3 6-0 0.161;"
00388 "* 16 * 10-3 6-0 0.165; * 17 * 10-3 6-0 0.177; * 18 * 10-3 6-0 0.179; * 19 * 10-3 6-0 0.177;"
00389 "* 20 * 10-3 6-0 0.171; * 21 * 10-3 6-0 0.168; * 22 * 10-3 6-0 0.160; * 23 * 10-3 6-0 0.151"
00390 "}"
00391 },
00392
00393 { "DISHWASHER",
00394 {20, false, {0.8,0,0.2}, 0.98, 1.0},
00395 "type:analog; schedule: residential-dishwasher-default; energy: 1.0 kWh; power: 1.0 kW",
00396 "residential-dishwasher-default",
00397 "positive; nonzero; weekday-summer {"
00398 "* 0 * 4-9 1-5 0.0068; * 1 * 4-9 1-5 0.0029; * 2 * 4-9 1-5 0.0016; * 3 * 4-9 1-5 0.0013;"
00399 "* 4 * 4-9 1-5 0.0012; * 5 * 4-9 1-5 0.0037; * 6 * 4-9 1-5 0.0075; * 7 * 4-9 1-5 0.0129;"
00400 "* 8 * 4-9 1-5 0.0180; * 9 * 4-9 1-5 0.0177; * 10 * 4-9 1-5 0.0144; * 11 * 4-9 1-5 0.0113;"
00401 "* 12 * 4-9 1-5 0.0116; * 13 * 4-9 1-5 0.0128; * 14 * 4-9 1-5 0.0109; * 15 * 4-9 1-5 0.0105;"
00402 "* 16 * 4-9 1-5 0.0124; * 17 * 4-9 1-5 0.0156; * 18 * 4-9 1-5 0.0278; * 19 * 4-9 1-5 0.0343;"
00403 "* 20 * 4-9 1-5 0.0279; * 21 * 4-9 1-5 0.0234; * 22 * 4-9 1-5 0.0194; * 23 * 4-9 1-5 0.0131"
00404 "}"
00405 "weekend-summer {"
00406 "* 0 * 4-9 6-0 0.0093; * 1 * 4-9 6-0 0.0045; * 2 * 4-9 6-0 0.0021; * 3 * 4-9 6-0 0.0015;"
00407 "* 4 * 4-9 6-0 0.0013; * 5 * 4-9 6-0 0.0015; * 6 * 4-9 6-0 0.0026; * 7 * 4-9 6-0 0.0067;"
00408 "* 8 * 4-9 6-0 0.0142; * 9 * 4-9 6-0 0.0221; * 10 * 4-9 6-0 0.0259; * 11 * 4-9 6-0 0.0238;"
00409 "* 12 * 4-9 6-0 0.0214; * 13 * 4-9 6-0 0.0214; * 14 * 4-9 6-0 0.0188; * 15 * 4-9 6-0 0.0169;"
00410 "* 16 * 4-9 6-0 0.0156; * 17 * 4-9 6-0 0.0166; * 18 * 4-9 6-0 0.0249; * 19 * 4-9 6-0 0.0298;"
00411 "* 20 * 4-9 6-0 0.0267; * 21 * 4-9 6-0 0.0221; * 22 * 4-9 6-0 0.0174; * 23 * 4-9 6-0 0.0145"
00412 "}"
00413 "weekday-winter {"
00414 "* 0 * 10-3 1-5 0.0068; * 1 * 10-3 1-5 0.0029; * 2 * 10-3 1-5 0.0016; * 3 * 10-3 1-5 0.0013;"
00415 "* 4 * 10-3 1-5 0.0012; * 5 * 10-3 1-5 0.0037; * 6 * 10-3 1-5 0.0075; * 7 * 10-3 1-5 0.0129;"
00416 "* 8 * 10-3 1-5 0.0180; * 9 * 10-3 1-5 0.0177; * 10 * 10-3 1-5 0.0144; * 11 * 10-3 1-5 0.0113;"
00417 "* 12 * 10-3 1-5 0.0116; * 13 * 10-3 1-5 0.0128; * 14 * 10-3 1-5 0.0109; * 15 * 10-3 1-5 0.0105;"
00418 "* 16 * 10-3 1-5 0.0124; * 17 * 10-3 1-5 0.0156; * 18 * 10-3 1-5 0.0278; * 19 * 10-3 1-5 0.0343;"
00419 "* 20 * 10-3 1-5 0.0279; * 21 * 10-3 1-5 0.0234; * 22 * 10-3 1-5 0.0194; * 23 * 10-3 1-5 0.0131"
00420 "}"
00421 "weekend-winter {"
00422 "* 0 * 10-3 6-0 0.0093; * 1 * 10-3 6-0 0.0045; * 2 * 10-3 6-0 0.0021; * 3 * 10-3 6-0 0.0015;"
00423 "* 4 * 10-3 6-0 0.0013; * 5 * 10-3 6-0 0.0015; * 6 * 10-3 6-0 0.0026; * 7 * 10-3 6-0 0.0067;"
00424 "* 8 * 10-3 6-0 0.0142; * 9 * 10-3 6-0 0.0221; * 10 * 10-3 6-0 0.0259; * 11 * 10-3 6-0 0.0238;"
00425 "* 12 * 10-3 6-0 0.0214; * 13 * 10-3 6-0 0.0214; * 14 * 10-3 6-0 0.0188; * 15 * 10-3 6-0 0.0169;"
00426 "* 16 * 10-3 6-0 0.0156; * 17 * 10-3 6-0 0.0166; * 18 * 10-3 6-0 0.0249; * 19 * 10-3 6-0 0.0298;"
00427 "* 20 * 10-3 6-0 0.0267; * 21 * 10-3 6-0 0.0221; * 22 * 10-3 6-0 0.0174; * 23 * 10-3 6-0 0.0145"
00428 "}"
00429 },
00430 { "RANGE",
00431 {40, true, {1,0,0}, 0.85, 0.8},
00432 "type:analog; schedule: residential-range-default; energy: 1.0 kWh; power: 0.5 kW",
00433 "residential-range-default",
00434 "positive; nonzero; weekday-summer {"
00435 "* 0 * 4-9 1-5 0.009; * 1 * 4-9 1-5 0.008; * 2 * 4-9 1-5 0.007; * 3 * 4-9 1-5 0.007"
00436 "* 4 * 4-9 1-5 0.008; * 5 * 4-9 1-5 0.012; * 6 * 4-9 1-5 0.025; * 7 * 4-9 1-5 0.040"
00437 "* 8 * 4-9 1-5 0.044; * 9 * 4-9 1-5 0.042; * 10 * 4-9 1-5 0.042; * 11 * 4-9 1-5 0.053"
00438 "* 12 * 4-9 1-5 0.057; * 13 * 4-9 1-5 0.046; * 14 * 4-9 1-5 0.044; * 15 * 4-9 1-5 0.053"
00439 "* 16 * 4-9 1-5 0.094; * 17 * 4-9 1-5 0.168; * 18 * 4-9 1-5 0.148; * 19 * 4-9 1-5 0.086"
00440 "* 20 * 4-9 1-5 0.053; * 21 * 4-9 1-5 0.038; * 22 * 4-9 1-5 0.023; * 23 * 4-9 1-5 0.013"
00441 "}"
00442 "weekend-summer {"
00443 "* 0 * 4-9 6-0 0.009; * 1 * 4-9 6-0 0.007; * 2 * 4-9 6-0 0.007; * 3 * 4-9 6-0 0.007"
00444 "* 4 * 4-9 6-0 0.007; * 5 * 4-9 6-0 0.009; * 6 * 4-9 6-0 0.017; * 7 * 4-9 6-0 0.038"
00445 "* 8 * 4-9 6-0 0.060; * 9 * 4-9 6-0 0.068; * 10 * 4-9 6-0 0.065; * 11 * 4-9 6-0 0.067"
00446 "* 12 * 4-9 6-0 0.076; * 13 * 4-9 6-0 0.066; * 14 * 4-9 6-0 0.061; * 15 * 4-9 6-0 0.067"
00447 "* 16 * 4-9 6-0 0.091; * 17 * 4-9 6-0 0.134; * 18 * 4-9 6-0 0.121; * 19 * 4-9 6-0 0.080"
00448 "* 20 * 4-9 6-0 0.052; * 21 * 4-9 6-0 0.035; * 22 * 4-9 6-0 0.022; * 23 * 4-9 6-0 0.011"
00449 "}"
00450 "weekday-winter {"
00451 "* 0 * 10-3 1-5 0.010; * 1 * 10-3 1-5 0.009; * 2 * 10-3 1-5 0.009; * 3 * 10-3 1-5 0.009"
00452 "* 4 * 10-3 1-5 0.009; * 5 * 10-3 1-5 0.016; * 6 * 10-3 1-5 0.032; * 7 * 10-3 1-5 0.050"
00453 "* 8 * 10-3 1-5 0.045; * 9 * 10-3 1-5 0.043; * 10 * 10-3 1-5 0.045; * 11 * 10-3 1-5 0.059"
00454 "* 12 * 10-3 1-5 0.063; * 13 * 10-3 1-5 0.053; * 14 * 10-3 1-5 0.052; * 15 * 10-3 1-5 0.072"
00455 "* 16 * 10-3 1-5 0.138; * 17 * 10-3 1-5 0.242; * 18 * 10-3 1-5 0.182; * 19 * 10-3 1-5 0.088"
00456 "* 20 * 10-3 1-5 0.051; * 21 * 10-3 1-5 0.034; * 22 * 10-3 1-5 0.022; * 23 * 10-3 1-5 0.014"
00457 "}"
00458 "weekend-winter {"
00459 "* 0 * 10-3 6-0 0.013; * 1 * 10-3 6-0 0.010; * 2 * 10-3 6-0 0.010; * 3 * 10-3 6-0 0.010"
00460 "* 4 * 10-3 6-0 0.010; * 5 * 10-3 6-0 0.012; * 6 * 10-3 6-0 0.018; * 7 * 10-3 6-0 0.040"
00461 "* 8 * 10-3 6-0 0.073; * 9 * 10-3 6-0 0.094; * 10 * 10-3 6-0 0.091; * 11 * 10-3 6-0 0.100"
00462 "* 12 * 10-3 6-0 0.117; * 13 * 10-3 6-0 0.109; * 14 * 10-3 6-0 0.100; * 15 * 10-3 6-0 0.108"
00463 "* 16 * 10-3 6-0 0.153; * 17 * 10-3 6-0 0.215; * 18 * 10-3 6-0 0.161; * 19 * 10-3 6-0 0.085"
00464 "* 20 * 10-3 6-0 0.050; * 21 * 10-3 6-0 0.033; * 22 * 10-3 6-0 0.022; * 23 * 10-3 6-0 0.014"
00465 "}"
00466 },
00467 { "MICROWAVE",
00468 {40, false, {0,0,1}, 0.7, 0.8},
00469 "type:analog; schedule: residential-microwave-default; energy: 1.0 kWh; power: 0.2 kW",
00470 "residential-microwave-default",
00471 "positive; nonzero; weekday-summer {"
00472 "* 0 * 4-9 1-5 0.009; * 1 * 4-9 1-5 0.008; * 2 * 4-9 1-5 0.007; * 3 * 4-9 1-5 0.007"
00473 "* 4 * 4-9 1-5 0.008; * 5 * 4-9 1-5 0.012; * 6 * 4-9 1-5 0.025; * 7 * 4-9 1-5 0.040"
00474 "* 8 * 4-9 1-5 0.044; * 9 * 4-9 1-5 0.042; * 10 * 4-9 1-5 0.042; * 11 * 4-9 1-5 0.053"
00475 "* 12 * 4-9 1-5 0.057; * 13 * 4-9 1-5 0.046; * 14 * 4-9 1-5 0.044; * 15 * 4-9 1-5 0.053"
00476 "* 16 * 4-9 1-5 0.094; * 17 * 4-9 1-5 0.168; * 18 * 4-9 1-5 0.148; * 19 * 4-9 1-5 0.086"
00477 "* 20 * 4-9 1-5 0.053; * 21 * 4-9 1-5 0.038; * 22 * 4-9 1-5 0.023; * 23 * 4-9 1-5 0.013"
00478 "}"
00479 "weekend-summer {"
00480 "* 0 * 4-9 6-0 0.009; * 1 * 4-9 6-0 0.007; * 2 * 4-9 6-0 0.007; * 3 * 4-9 6-0 0.007"
00481 "* 4 * 4-9 6-0 0.007; * 5 * 4-9 6-0 0.009; * 6 * 4-9 6-0 0.017; * 7 * 4-9 6-0 0.038"
00482 "* 8 * 4-9 6-0 0.060; * 9 * 4-9 6-0 0.068; * 10 * 4-9 6-0 0.065; * 11 * 4-9 6-0 0.067"
00483 "* 12 * 4-9 6-0 0.076; * 13 * 4-9 6-0 0.066; * 14 * 4-9 6-0 0.061; * 15 * 4-9 6-0 0.067"
00484 "* 16 * 4-9 6-0 0.091; * 17 * 4-9 6-0 0.134; * 18 * 4-9 6-0 0.121; * 19 * 4-9 6-0 0.080"
00485 "* 20 * 4-9 6-0 0.052; * 21 * 4-9 6-0 0.035; * 22 * 4-9 6-0 0.022; * 23 * 4-9 6-0 0.011"
00486 "}"
00487 "weekday-winter {"
00488 "* 0 * 10-3 1-5 0.010; * 1 * 10-3 1-5 0.009; * 2 * 10-3 1-5 0.009; * 3 * 10-3 1-5 0.009"
00489 "* 4 * 10-3 1-5 0.009; * 5 * 10-3 1-5 0.016; * 6 * 10-3 1-5 0.032; * 7 * 10-3 1-5 0.050"
00490 "* 8 * 10-3 1-5 0.045; * 9 * 10-3 1-5 0.043; * 10 * 10-3 1-5 0.045; * 11 * 10-3 1-5 0.059"
00491 "* 12 * 10-3 1-5 0.063; * 13 * 10-3 1-5 0.053; * 14 * 10-3 1-5 0.052; * 15 * 10-3 1-5 0.072"
00492 "* 16 * 10-3 1-5 0.138; * 17 * 10-3 1-5 0.242; * 18 * 10-3 1-5 0.182; * 19 * 10-3 1-5 0.088"
00493 "* 20 * 10-3 1-5 0.051; * 21 * 10-3 1-5 0.034; * 22 * 10-3 1-5 0.022; * 23 * 10-3 1-5 0.014"
00494 "}"
00495 "weekend-winter {"
00496 "* 0 * 10-3 6-0 0.013; * 1 * 10-3 6-0 0.010; * 2 * 10-3 6-0 0.010; * 3 * 10-3 6-0 0.010"
00497 "* 4 * 10-3 6-0 0.010; * 5 * 10-3 6-0 0.012; * 6 * 10-3 6-0 0.018; * 7 * 10-3 6-0 0.040"
00498 "* 8 * 10-3 6-0 0.073; * 9 * 10-3 6-0 0.094; * 10 * 10-3 6-0 0.091; * 11 * 10-3 6-0 0.100"
00499 "* 12 * 10-3 6-0 0.117; * 13 * 10-3 6-0 0.109; * 14 * 10-3 6-0 0.100; * 15 * 10-3 6-0 0.108"
00500 "* 16 * 10-3 6-0 0.153; * 17 * 10-3 6-0 0.215; * 18 * 10-3 6-0 0.161; * 19 * 10-3 6-0 0.085"
00501 "* 20 * 10-3 6-0 0.050; * 21 * 10-3 6-0 0.033; * 22 * 10-3 6-0 0.022; * 23 * 10-3 6-0 0.014"
00502 "}"
00503 },
00504
00506 };
00507
00508 EXPORT CIRCUIT *attach_enduse_house_e(OBJECT *obj, enduse *target, double breaker_amps, int is220)
00509 {
00510 house_e *pHouse = 0;
00511 CIRCUIT *c = 0;
00512
00513 if(obj == NULL){
00514 GL_THROW("attach_house_a: null object reference");
00515 }
00516 if(target == NULL){
00517 GL_THROW("attach_house_a: null enduse target data");
00518 }
00519 if(breaker_amps < 0 || breaker_amps > 1000){
00520 GL_THROW("attach_house_a: breaker amps of %i unrealistic", breaker_amps);
00521 }
00522
00523 pHouse = OBJECTDATA(obj,house_e);
00524 return pHouse->attach(obj,breaker_amps,is220,target);
00525 }
00526
00528
00530 CLASS* house_e::oclass = NULL;
00531 CLASS* house_e::pclass = NULL;
00532
00533 double house_e::warn_low_temp = 55;
00534 double house_e::warn_high_temp = 95;
00535 bool house_e::warn_control = true;
00536 double house_e::system_dwell_time = 1;
00537
00541 house_e::house_e(MODULE *mod) : residential_enduse(mod)
00542 {
00543
00544 if (oclass==NULL)
00545 {
00546
00547 oclass = gl_register_class(mod,"house",sizeof(house_e),PC_PRETOPDOWN|PC_BOTTOMUP|PC_POSTTOPDOWN);
00548
00549 if (oclass==NULL)
00550 GL_THROW("unable to register object class implemented by %s",__FILE__);
00551
00552
00553 if (gl_publish_variable(oclass,
00554 PT_INHERIT, "residential_enduse",
00555 PT_object,"weather",PADDR(weather),PT_DESCRIPTION,"reference to the climate object",
00556 PT_double,"floor_area[sf]",PADDR(floor_area),PT_DESCRIPTION,"home conditioned floor area",
00557 PT_double,"gross_wall_area[sf]",PADDR(gross_wall_area),PT_DESCRIPTION,"gross outdoor wall area",
00558 PT_double,"ceiling_height[ft]",PADDR(ceiling_height),PT_DESCRIPTION,"average ceiling height",
00559 PT_double,"aspect_ratio",PADDR(aspect_ratio), PT_DESCRIPTION,"aspect ratio of the home's footprint",
00560 PT_double,"envelope_UA[Btu/degF.h]",PADDR(envelope_UA),PT_DESCRIPTION,"overall UA of the home's envelope",
00561 PT_double,"window_wall_ratio",PADDR(window_wall_ratio),PT_DESCRIPTION,"ratio of window area to wall area",
00562 PT_double,"number_of_doors",PADDR(number_of_doors),PT_DESCRIPTION,"ratio of door area to wall area",
00563 PT_double,"exterior_wall_fraction",PADDR(exterior_wall_fraction),PT_DESCRIPTION,"ratio of exterior wall ratio to wall area",
00564 PT_double,"interior_exterior_wall_ratio",PADDR(interior_exterior_wall_ratio),PT_DESCRIPTION,"ratio of interior to exterior walls",
00565 PT_double,"exterior_ceiling_fraction",PADDR(exterior_ceiling_fraction),PT_DESCRIPTION,"ratio of external ceiling sf to floor area",
00566 PT_double,"exterior_floor_fraction",PADDR(exterior_floor_fraction),PT_DESCRIPTION,"ratio of floor area used in UA calculation",
00567 PT_double,"window_shading",PADDR(glazing_shgc),PT_DESCRIPTION,"transmission coefficient through window due to glazing",
00568 PT_double,"window_exterior_transmission_coefficient",PADDR(window_exterior_transmission_coefficient),PT_DESCRIPTION,"coefficient for the amount of energy that passes through window",
00569 PT_double,"solar_heatgain_factor",PADDR(solar_heatgain_factor),PT_ACCESS,PA_REFERENCE,PT_DESCRIPTION,"product of the window area, window transmitivity, and the window exterior transmission coefficient",
00570 PT_double,"airchange_per_hour",PADDR(airchange_per_hour),PT_DESCRIPTION,"number of air-changes per hour",
00571 PT_double,"airchange_UA[Btu/degF.h]",PADDR(airchange_UA),PT_DESCRIPTION,"additional UA due to air infiltration",
00572 PT_double,"internal_gain[Btu/h]",PADDR(total.heatgain),PT_DESCRIPTION,"internal heat gains",
00573 PT_double,"solar_gain[Btu/h]",PADDR(solar_load),PT_DESCRIPTION,"solar heat gains",
00574 PT_double,"incident_solar_radiation[Btu/h.sf]",PADDR(incident_solar_radiation),PT_DESCRIPTION,"average incident solar radiation hitting the house",
00575 PT_double,"heat_cool_gain[Btu/h]",PADDR(load.heatgain),PT_DESCRIPTION,"system heat gains(losses)",
00576
00577 PT_double,"thermostat_deadband[degF]",PADDR(thermostat_deadband),PT_DESCRIPTION,"deadband of thermostat control",
00578 PT_int16,"thermostat_cycle_time",PADDR(thermostat_cycle_time),PT_DESCRIPTION,"minimum time in seconds between thermostat updates",
00579 PT_timestamp,"thermostat_last_cycle_time",PADDR(thermostat_last_cycle_time),PT_ACCESS,PA_REFERENCE,PT_DESCRIPTION,"last time the thermostat changed state",
00580 PT_double,"heating_setpoint[degF]",PADDR(heating_setpoint),PT_DESCRIPTION,"thermostat heating setpoint",
00581 PT_double,"cooling_setpoint[degF]",PADDR(cooling_setpoint),PT_DESCRIPTION,"thermostat cooling setpoint",
00582 PT_double,"design_heating_setpoint[degF]",PADDR(design_heating_setpoint),PT_DESCRIPTION,"system design heating setpoint",
00583 PT_double,"design_cooling_setpoint[degF]",PADDR(design_cooling_setpoint),PT_DESCRIPTION,"system design cooling setpoint",
00584
00585 PT_double,"design_heating_capacity[Btu/h]",PADDR(design_heating_capacity),PT_DESCRIPTION,"system heating capacity",
00586 PT_double,"design_cooling_capacity[Btu/h]",PADDR(design_cooling_capacity),PT_DESCRIPTION,"system cooling capacity",
00587 PT_double,"cooling_design_temperature[degF]", PADDR(cooling_design_temperature),PT_DESCRIPTION,"system cooling design temperature",
00588 PT_double,"heating_design_temperature[degF]", PADDR(heating_design_temperature),PT_DESCRIPTION,"system heating design temperature",
00589 PT_double,"design_peak_solar[Btu/h.sf]", PADDR(design_peak_solar),PT_DESCRIPTION,"system design solar load",
00590 PT_double,"design_internal_gains[W/sf]", PADDR(design_internal_gains),PT_DESCRIPTION,"system design internal gains",
00591 PT_double,"air_heat_fraction[pu]", PADDR(air_heat_fraction), PT_DESCRIPTION, "fraction of heat gain/loss that goes to air (as opposed to mass)",
00592 PT_double,"mass_solar_gain_fraction[pu]", PADDR(mass_solar_gain_fraction), PT_DESCRIPTION, "fraction of the heat gain/loss from the solar gains that goes to the mass",
00593 PT_double,"mass_internal_gain_fraction[pu]", PADDR(mass_internal_gain_fraction), PT_DESCRIPTION, "fraction of heat gain/loss from the internal gains that goes to the mass",
00594
00595 PT_double,"auxiliary_heat_capacity[Btu/h]",PADDR(aux_heat_capacity),PT_DESCRIPTION,"installed auxiliary heating capacity",
00596 PT_double,"aux_heat_deadband[degF]",PADDR(aux_heat_deadband),PT_DESCRIPTION,"temperature offset from standard heat activation to auxiliary heat activation",
00597 PT_double,"aux_heat_temperature_lockout[degF]",PADDR(aux_heat_temp_lockout),PT_DESCRIPTION,"temperature at which auxiliary heat will not engage above",
00598 PT_double,"aux_heat_time_delay[s]",PADDR(aux_heat_time_delay),PT_DESCRIPTION,"time required for heater to run until auxiliary heating engages",
00599
00600 PT_double,"cooling_supply_air_temp[degF]",PADDR(cooling_supply_air_temp),PT_DESCRIPTION,"temperature of air blown out of the cooling system",
00601 PT_double,"heating_supply_air_temp[degF]",PADDR(heating_supply_air_temp),PT_DESCRIPTION,"temperature of air blown out of the heating system",
00602 PT_double,"duct_pressure_drop[in]",PADDR(duct_pressure_drop),PT_DESCRIPTION,"end-to-end pressure drop for the ventilation ducts, in inches of water",
00603 PT_double,"fan_design_power[W]",PADDR(fan_design_power),PT_DESCRIPTION,"designed maximum power draw of the ventilation fan",
00604 PT_double,"fan_low_power_fraction[pu]",PADDR(fan_low_power_fraction),PT_DESCRIPTION,"fraction of ventilation fan power draw during low-power mode (two-speed only)",
00605 PT_double,"fan_power[kW]",PADDR(fan_power),PT_ACCESS,PA_REFERENCE,PT_DESCRIPTION,"current ventilation fan power draw",
00606 PT_double,"fan_design_airflow[cfm]",PADDR(fan_design_airflow),PT_DESCRIPTION,"designed airflow for the ventilation system",
00607 PT_double,"fan_impedance_fraction[pu]",PADDR(fan_impedance_fraction),PT_DESCRIPTION,"Impedance component of fan ZIP load",
00608 PT_double,"fan_power_fraction[pu]",PADDR(fan_power_fraction),PT_DESCRIPTION,"Power component of fan ZIP load",
00609 PT_double,"fan_current_fraction[pu]",PADDR(fan_current_fraction),PT_DESCRIPTION,"Current component of fan ZIP load",
00610 PT_double,"fan_power_factor[pu]",PADDR(fan_power_factor),PT_DESCRIPTION,"Power factor of the fan load",
00611
00612 PT_double,"heating_demand",PADDR(heating_demand),PT_ACCESS,PA_REFERENCE,PT_DESCRIPTION,"the current power draw to run the heating system",
00613 PT_double,"cooling_demand",PADDR(cooling_demand),PT_ACCESS,PA_REFERENCE,PT_DESCRIPTION,"the current power draw to run the cooling system",
00614 PT_double,"heating_COP[pu]",PADDR(heating_COP),PT_DESCRIPTION,"system heating performance coefficient",
00615 PT_double,"cooling_COP[Btu/kWh]",PADDR(cooling_COP),PT_DESCRIPTION,"system cooling performance coefficient",
00616
00617 PT_double,"air_temperature[degF]",PADDR(Tair),PT_DESCRIPTION,"indoor air temperature",
00618 PT_double,"outdoor_temperature[degF]",PADDR(outside_temperature),PT_DESCRIPTION,"outdoor air temperature",
00619 PT_double,"outdoor_rh[%]",PADDR(outdoor_rh),PT_DESCRIPTION,"outdoor relative humidity",
00620 PT_double,"mass_heat_capacity[Btu/degF]",PADDR(house_content_thermal_mass),PT_DESCRIPTION,"interior mass heat capacity",
00621 PT_double,"mass_heat_coeff[Btu/degF.h]",PADDR(house_content_heat_transfer_coeff),PT_DESCRIPTION,"interior mass heat exchange coefficient",
00622 PT_double,"mass_temperature[degF]",PADDR(Tmaterials),PT_DESCRIPTION,"interior mass temperature",
00623 PT_double,"air_volume[cf]", PADDR(volume), PT_DESCRIPTION,"air volume",
00624 PT_double,"air_mass[lb]",PADDR(air_mass), PT_DESCRIPTION,"air mass",
00625 PT_double,"air_heat_capacity[Btu/degF]", PADDR(air_thermal_mass), PT_DESCRIPTION,"air thermal mass",
00626 PT_double,"latent_load_fraction[pu]", PADDR(latent_load_fraction), PT_DESCRIPTION,"fractional increase in cooling load due to latent heat",
00627 PT_double,"total_thermal_mass_per_floor_area[Btu/degF.sf]",PADDR(total_thermal_mass_per_floor_area),
00628 PT_double,"interior_surface_heat_transfer_coeff[Btu/h.degF.sf]",PADDR(interior_surface_heat_transfer_coeff),
00629 PT_double,"number_of_stories",PADDR(number_of_stories),PT_DESCRIPTION,"number of stories within the structure",
00630
00631 PT_set,"system_type",PADDR(system_type),PT_DESCRIPTION,"heating/cooling system type/options",
00632 PT_KEYWORD, "GAS", (set)ST_GAS,
00633 PT_KEYWORD, "AIRCONDITIONING", (set)ST_AC,
00634 PT_KEYWORD, "FORCEDAIR", (set)ST_AIR,
00635 PT_KEYWORD, "TWOSTAGE", (set)ST_VAR,
00636 PT_KEYWORD, "RESISTIVE", (set)ST_RST,
00637 PT_set,"auxiliary_strategy",PADDR(auxiliary_strategy),PT_DESCRIPTION,"auxiliary heating activation strategies",
00638 PT_KEYWORD, "NONE", (set)AX_NONE,
00639 PT_KEYWORD, "DEADBAND", (set)AX_DEADBAND,
00640 PT_KEYWORD, "TIMER", (set)AX_TIMER,
00641 PT_KEYWORD, "LOCKOUT", (set)AX_LOCKOUT,
00642 PT_enumeration,"system_mode",PADDR(system_mode),PT_DESCRIPTION,"heating/cooling system operation state",
00643 PT_KEYWORD,"UNKNOWN",SM_UNKNOWN,
00644 PT_KEYWORD,"HEAT",SM_HEAT,
00645 PT_KEYWORD,"OFF",SM_OFF,
00646 PT_KEYWORD,"COOL",SM_COOL,
00647 PT_KEYWORD,"AUX",SM_AUX,
00648 PT_enumeration,"last_system_mode",PADDR(last_system_mode),PT_DESCRIPTION,"heating/cooling system operation state",
00649 PT_KEYWORD,"UNKNOWN",SM_UNKNOWN,
00650 PT_KEYWORD,"HEAT",SM_HEAT,
00651 PT_KEYWORD,"OFF",SM_OFF,
00652 PT_KEYWORD,"COOL",SM_COOL,
00653 PT_KEYWORD,"AUX",SM_AUX,
00654 PT_enumeration,"heating_system_type",PADDR(heating_system_type),
00655 PT_KEYWORD,"NONE",HT_NONE,
00656 PT_KEYWORD,"GAS",HT_GAS,
00657 PT_KEYWORD,"HEAT_PUMP",HT_HEAT_PUMP,
00658 PT_KEYWORD,"RESISTANCE",HT_RESISTANCE,
00659 PT_enumeration,"cooling_system_type",PADDR(cooling_system_type),
00660 PT_KEYWORD,"NONE",CT_NONE,
00661 PT_KEYWORD,"ELECTRIC",CT_ELECTRIC,
00662 PT_KEYWORD,"HEAT_PUMP",CT_ELECTRIC,
00663 PT_enumeration,"auxiliary_system_type",PADDR(auxiliary_system_type),
00664 PT_KEYWORD,"NONE",AT_NONE,
00665 PT_KEYWORD,"ELECTRIC",AT_ELECTRIC,
00666 PT_enumeration,"fan_type",PADDR(fan_type),
00667 PT_KEYWORD,"NONE",FT_NONE,
00668 PT_KEYWORD,"ONE_SPEED",FT_ONE_SPEED,
00669 PT_KEYWORD,"TWO_SPEED",FT_TWO_SPEED,
00670 PT_enumeration,"thermal_integrity_level",PADDR(thermal_integrity_level),PT_DESCRIPTION,"default envelope UA settings",
00671 PT_KEYWORD,"VERY_LITTLE",TI_VERY_LITTLE,
00672 PT_KEYWORD,"LITTLE",TI_LITTLE,
00673 PT_KEYWORD,"BELOW_NORMAL",TI_BELOW_NORMAL,
00674 PT_KEYWORD,"NORMAL",TI_NORMAL,
00675 PT_KEYWORD,"ABOVE_NORMAL",TI_ABOVE_NORMAL,
00676 PT_KEYWORD,"GOOD",TI_GOOD,
00677 PT_KEYWORD,"VERY_GOOD",TI_VERY_GOOD,
00678 PT_KEYWORD,"UNKNOWN",TI_UNKNOWN,
00679 PT_enumeration, "glass_type", PADDR(glass_type), PT_DESCRIPTION, "glass used in the windows",
00680 PT_KEYWORD,"OTHER",GM_OTHER,
00681 PT_KEYWORD,"GLASS",GM_GLASS,
00682 PT_KEYWORD,"LOW_E_GLASS",GM_LOW_E_GLASS,
00683 PT_enumeration, "window_frame", PADDR(window_frame), PT_DESCRIPTION, "type of window frame",
00684 PT_KEYWORD, "NONE", WF_NONE,
00685 PT_KEYWORD, "ALUMINUM", WF_ALUMINUM,
00686 PT_KEYWORD, "ALUMINIUM", WF_ALUMINUM,
00687 PT_KEYWORD, "THERMAL_BREAK", WF_THERMAL_BREAK,
00688 PT_KEYWORD, "WOOD", WF_WOOD,
00689 PT_KEYWORD, "INSULATED", WF_INSULATED,
00690 PT_enumeration, "glazing_treatment", PADDR(glazing_treatment), PT_DESCRIPTION, "the treatment to increase the reflectivity of the exterior windows",
00691 PT_KEYWORD, "OTHER", GT_OTHER,
00692 PT_KEYWORD, "CLEAR", GT_CLEAR,
00693 PT_KEYWORD, "ABS", GT_ABS,
00694 PT_KEYWORD, "REFL", GT_REFL,
00695 PT_KEYWORD, "LOW_S", GT_LOW_S,
00696 PT_KEYWORD, "HIGH_S", GT_HIGH_S,
00697 PT_enumeration, "glazing_layers", PADDR(glazing_layers), PT_DESCRIPTION, "number of layers of glass in each window",
00698 PT_KEYWORD, "ONE", GL_ONE,
00699 PT_KEYWORD, "TWO", GL_TWO,
00700 PT_KEYWORD, "THREE", GL_THREE,
00701 PT_KEYWORD, "OTHER", GL_OTHER,
00702 PT_enumeration, "motor_model", PADDR(motor_model), PT_DESCRIPTION, "indicates the level of detail used in modelling the hvac motor parameters",
00703 PT_KEYWORD, "NONE", MM_NONE,
00704 PT_KEYWORD, "BASIC", MM_BASIC,
00705 PT_KEYWORD, "FULL", MM_FULL,
00706 PT_enumeration, "motor_efficiency", PADDR(motor_efficiency), PT_DESCRIPTION, "when using motor model, describes the efficiency of the motor",
00707 PT_KEYWORD, "VERY_POOR", ME_VERY_POOR,
00708 PT_KEYWORD, "POOR", ME_POOR,
00709 PT_KEYWORD, "AVERAGE", ME_AVERAGE,
00710 PT_KEYWORD, "GOOD", ME_GOOD,
00711 PT_KEYWORD, "VERY_GOOD", ME_VERY_GOOD,
00712 PT_int64, "last_mode_timer", PADDR(last_mode_timer),
00713 PT_double, "hvac_motor_efficiency[unit]", PADDR(hvac_motor_efficiency), PT_DESCRIPTION, "when using motor model, percent efficiency of hvac motor",
00714 PT_double, "hvac_motor_loss_power_factor[unit]", PADDR(hvac_motor_loss_power_factor), PT_DESCRIPTION, "when using motor model, power factor of motor losses",
00715 PT_double, "Rroof[degF.sf.h/Btu]", PADDR(Rroof),PT_DESCRIPTION,"roof R-value",
00716 PT_double, "Rwall[degF.sf.h/Btu]", PADDR(Rwall),PT_DESCRIPTION,"wall R-value",
00717 PT_double, "Rfloor[degF.sf.h/Btu]", PADDR(Rfloor),PT_DESCRIPTION,"floor R-value",
00718 PT_double, "Rwindows[degF.sf.h/Btu]", PADDR(Rwindows),PT_DESCRIPTION,"window R-value",
00719 PT_double, "Rdoors[degF.sf.h/Btu]", PADDR(Rdoors),PT_DESCRIPTION,"door R-value",
00720 PT_double, "hvac_breaker_rating[A]", PADDR(hvac_breaker_rating), PT_DESCRIPTION,"determines the amount of current the HVAC circuit breaker can handle",
00721 PT_double, "hvac_power_factor[unit]", PADDR(hvac_power_factor), PT_DESCRIPTION,"power factor of hvac",
00722
00723 PT_double,"hvac_load",PADDR(hvac_load),PT_DESCRIPTION,"heating/cooling system load",
00724 PT_double,"total_load",PADDR(total_load),
00725 PT_enduse,"panel",PADDR(total),PT_DESCRIPTION,"total panel enduse load",
00726 PT_double,"design_internal_gain_density[W/sf]",PADDR(design_internal_gain_density),PT_DESCRIPTION,"average density of heat generating devices in the house",
00727 #ifdef _DEBUG
00728
00729 PT_double,"a",PADDR(a),
00730 PT_double,"b",PADDR(b),
00731 PT_double,"c",PADDR(c),
00732 PT_double,"d",PADDR(d),
00733 PT_double,"c1",PADDR(c1),
00734 PT_double,"c2",PADDR(c2),
00735 PT_double,"A3",PADDR(A3),
00736 PT_double,"A4",PADDR(A4),
00737 PT_double,"k1",PADDR(k1),
00738 PT_double,"k2",PADDR(k2),
00739 PT_double,"r1",PADDR(r1),
00740 PT_double,"r2",PADDR(r2),
00741 PT_double,"Teq",PADDR(Teq),
00742 PT_double,"Tevent",PADDR(Tevent),
00743 PT_double,"Qi",PADDR(Qi),
00744 PT_double,"Qa",PADDR(Qa),
00745 PT_double,"Qm",PADDR(Qm),
00746 PT_double,"Qh",PADDR(load.heatgain),
00747 PT_double,"dTair",PADDR(dTair),
00748 PT_double,"adj_cooling_cap",PADDR(adj_cooling_cap),
00749 PT_double,"adj_heating_cap",PADDR(adj_heating_cap),
00750 PT_double,"adj_cooling_cop",PADDR(adj_cooling_cop),
00751 PT_double,"adj_heating_cop",PADDR(adj_heating_cop),
00752 #endif
00753 PT_enumeration,"thermostat_control", PADDR(thermostat_control), PT_DESCRIPTION, "determine level of internal thermostatic control",
00754 PT_KEYWORD, "FULL", TC_FULL,
00755 PT_KEYWORD, "BAND", TC_BAND,
00756 PT_KEYWORD, "NONE", TC_NONE,
00757 NULL)<1)
00758 GL_THROW("unable to publish properties in %s",__FILE__);
00759
00760 gl_publish_function(oclass, "attach_enduse", (FUNCTIONADDR)attach_enduse_house_e);
00761 gl_global_create("residential::implicit_enduses",PT_set,&implicit_enduses_active,
00762 PT_KEYWORD, "LIGHTS", (set)IEU_LIGHTS,
00763 PT_KEYWORD, "PLUGS", (set)IEU_PLUGS,
00764 PT_KEYWORD, "OCCUPANCY", (set)IEU_OCCUPANCY,
00765 PT_KEYWORD, "DISHWASHER", (set)IEU_DISHWASHER,
00766 PT_KEYWORD, "MICROWAVE", (set)IEU_MICROWAVE,
00767 PT_KEYWORD, "FREEZER", (set)IEU_FREEZER,
00768 PT_KEYWORD, "REFRIGERATOR", (set)IEU_REFRIGERATOR,
00769 PT_KEYWORD, "RANGE", (set)IEU_RANGE,
00770 PT_KEYWORD, "EVCHARGER", (set)IEU_EVCHARGER,
00771 PT_KEYWORD, "WATERHEATER", (set)IEU_WATERHEATER,
00772 PT_KEYWORD, "CLOTHESWASHER", (set)IEU_CLOTHESWASHER,
00773 PT_KEYWORD, "DRYER", (set)IEU_DRYER,
00774 PT_KEYWORD, "NONE", (set)0,
00775 PT_DESCRIPTION, "list of implicit enduses that are active in houses",
00776 NULL);
00777 gl_global_create("residential::house_low_temperature_warning[degF]",PT_double,&warn_low_temp,
00778 PT_DESCRIPTION, "the low house indoor temperature at which a warning will be generated",
00779 NULL);
00780 gl_global_create("residential::house_high_temperature_warning[degF]",PT_double,&warn_high_temp,
00781 PT_DESCRIPTION, "the high house indoor temperature at which a warning will be generated",
00782 NULL);
00783 gl_global_create("residential::thermostat_control_warning",PT_double,&warn_control,
00784 PT_DESCRIPTION, "boolean to indicate whether a warning is generated when indoor temperature is out of control limits",
00785 NULL);
00786 gl_global_create("residential::system_dwell_time[s]",PT_double,&system_dwell_time,
00787 PT_DESCRIPTION, "the heating/cooling system dwell time interval for changing system state",
00788 NULL);
00789 }
00790 gl_global_create("residential::aux_cutin_temperature[degF]",PT_double,&aux_cutin_temperature,
00791 PT_DESCRIPTION, "the outdoor air temperature below which AUX heating is used",
00792 NULL);
00793 }
00794
00795 int house_e::create()
00796 {
00797 int result=SUCCESS;
00798 char1024 active_enduses;
00799 gl_global_getvar("residential::implicit_enduses",active_enduses,sizeof(active_enduses));
00800 char *token = NULL;
00801
00802
00803
00804 load.power_fraction = 0.8;
00805 load.impedance_fraction = 0.2;
00806 load.current_fraction = 0.0;
00807 design_internal_gain_density = 0.6;
00808 thermal_integrity_level = TI_UNKNOWN;
00809 hvac_breaker_rating = 0;
00810 hvac_power_factor = 0;
00811 Tmaterials = 0.0;
00812
00813 cooling_supply_air_temp = 50.0;
00814 heating_supply_air_temp = 150.0;
00815
00816 heating_system_type = HT_HEAT_PUMP;
00817 cooling_system_type = CT_UNKNOWN;
00818 auxiliary_system_type = AT_UNKNOWN;
00819 fan_type = FT_UNKNOWN;
00820 fan_power_factor = 0.96;
00821 fan_current_fraction = 0.7332;
00822 fan_impedance_fraction = 0.2534;
00823 fan_power_fraction = 0.0135;
00824
00825 glazing_layers = GL_TWO;
00826 glass_type = GM_LOW_E_GLASS;
00827 glazing_treatment = GT_CLEAR;
00828 window_frame = WF_THERMAL_BREAK;
00829 motor_model = MM_NONE;
00830 motor_efficiency = ME_AVERAGE;
00831 hvac_motor_efficiency = 1;
00832 hvac_motor_loss_power_factor = 0.125;
00833 hvac_motor_real_loss = 0;
00834 hvac_motor_reactive_loss = 0;
00835
00836
00837 implicit_enduse_list = NULL;
00838 if (strcmp(active_enduses,"NONE")!=0)
00839 {
00840 char *eulist[64];
00841 char n_eu=0;
00842
00843
00844 while ((token=strtok(token?NULL:active_enduses,"|"))!=NULL)
00845 eulist[n_eu++] = token;
00846
00847 while (n_eu-->0)
00848 {
00849 char *euname = eulist[n_eu];
00850 _strlwr(euname);
00851
00852
00853 struct s_implicit_enduse_list *eu = NULL;
00854 int found=0;
00855 for (eu=implicit_enduse_data; eu<implicit_enduse_data+sizeof(implicit_enduse_data)/sizeof(implicit_enduse_data[0]); eu++)
00856 {
00857 char name[64];
00858 sprintf(name,"residential-%s-default",euname);
00859
00860 if (strcmp(eu->schedule_name,name)==0)
00861 {
00862 SCHEDULE *sched = gl_schedule_find(name);
00863 if (sched==NULL)
00864 sched = gl_schedule_create(eu->schedule_name,eu->schedule_definition);
00865 IMPLICITENDUSE *item = (IMPLICITENDUSE*)gl_malloc(sizeof(IMPLICITENDUSE));
00866 memset(item,0,sizeof(IMPLICITENDUSE));
00867 gl_enduse_create(&(item->load));
00868 item->load.shape = gl_loadshape_create(sched);
00869 if (gl_set_value_by_type(PT_loadshape,item->load.shape,eu->shape)==0)
00870 {
00871 gl_error("loadshape '%s' could not be created", name);
00872 result = FAILED;
00873 }
00874 item->load.name = eu->implicit_name;
00875 item->next = implicit_enduse_list;
00876 item->amps = eu->load.breaker_amps;
00877 item->is220 = eu->load.circuit_is220;
00878 item->load.impedance_fraction = eu->load.fractions.z;
00879 item->load.current_fraction = eu->load.fractions.i;
00880 item->load.power_fraction = eu->load.fractions.p;
00881 item->load.power_factor = eu->load.power_factor;
00882 item->load.heatgain_fraction = eu->load.heat_fraction;
00883 implicit_enduse_list = item;
00884 found=1;
00885 break;
00886 }
00887 }
00888 if (found==0)
00889 {
00890 gl_error("house_e data for '%s' implicit enduse not found", euname);
00891 result = FAILED;
00892 }
00893 }
00894 }
00895 total.name = "panel";
00896 load.name = "system";
00897
00898 return result;
00899 }
00900
00905 int house_e::init_climate()
00906 {
00907 OBJECT *hdr = OBJECTHDR(this);
00908
00909
00910 static FINDLIST *climates = NULL;
00911 int not_found = 0;
00912 if (climates==NULL && not_found==0)
00913 {
00914 climates = gl_find_objects(FL_NEW,FT_CLASS,SAME,"climate",FT_END);
00915 if (climates==NULL)
00916 {
00917 not_found = 1;
00918 gl_warning("house_e: no climate data found, using static data");
00919
00920
00921 extern double default_outdoor_temperature, default_humidity, default_solar[9];
00922 pTout = &default_outdoor_temperature;
00923 pRhout = &default_humidity;
00924 pSolar = &default_solar[0];
00925 }
00926 else if (climates->hit_count>1)
00927 {
00928 gl_warning("house_e: %d climates found, using first one defined", climates->hit_count);
00929 }
00930 }
00931 if (climates!=NULL)
00932 {
00933 if (climates->hit_count==0)
00934 {
00935
00936 extern double default_outdoor_temperature, default_humidity, default_solar[9];
00937 pTout = &default_outdoor_temperature;
00938 pRhout = &default_humidity;
00939 pSolar = &default_solar[0];
00940 }
00941 else
00942 {
00943
00944 OBJECT *obj = gl_find_next(climates,NULL);
00945 if(weather == NULL){
00946 weather = obj;
00947 }
00948 if (obj->rank<=hdr->rank)
00949 gl_set_dependent(obj,hdr);
00950 pTout = (double*)GETADDR(obj,gl_get_property(obj,"temperature"));
00951 pRhout = (double*)GETADDR(obj,gl_get_property(obj,"humidity"));
00952 pSolar = (double*)GETADDR(obj,gl_get_property(obj,"solar_flux"));
00953 struct {
00954 char *name;
00955 double *dst;
00956 } map[] = {
00957 {"record.high",&cooling_design_temperature},
00958 {"record.low",&heating_design_temperature},
00959 };
00960 int i;
00961 for (i=0; i<sizeof(map)/sizeof(map[0]); i++)
00962 {
00963 double *src = (double*)GETADDR(obj,gl_get_property(obj,map[i].name));
00964 if (src) *map[i].dst = *src;
00965 }
00966 }
00967 }
00968 return 1;
00969 }
00970
00971 int house_e::isa(char *classname)
00972 {
00973 return (strcmp(classname,"clotheswasher")==0 || residential_enduse::isa(classname));
00974 }
00975
00976 void house_e::set_thermal_integrity(){
00977 switch (thermal_integrity_level) {
00978 case TI_VERY_LITTLE:
00979 if(Rroof <= 0.0) Rroof = 11;
00980 if(Rwall <= 0.0) Rwall = 4;
00981 if(Rfloor <= 0.0) Rfloor = 4;
00982 if(Rdoors <= 0.0) Rdoors = 3;
00983 if(Rwindows <= 0.0) Rwindows = 1/1.27;
00984 if(airchange_per_hour <= 0.0) airchange_per_hour = 1.5;
00985 break;
00986 case TI_LITTLE:
00987 if(Rroof <= 0.0) Rroof = 19;
00988 if(Rwall <= 0.0) Rwall = 11;
00989 if(Rfloor <= 0.0) Rfloor = 4;
00990 if(Rdoors <= 0.0) Rdoors = 3;
00991 if(Rwindows <= 0.0) Rwindows = 1/0.81;
00992 if(airchange_per_hour <= 0.0) airchange_per_hour = 1.5;
00993 break;
00994 case TI_BELOW_NORMAL:
00995 if(Rroof <= 0.0) Rroof = 19;
00996 if(Rwall <= 0.0) Rwall = 11;
00997 if(Rfloor <= 0.0) Rfloor = 11;
00998 if(Rdoors <= 0.0) Rdoors = 3;
00999 if(Rwindows <= 0.0) Rwindows = 1/0.81;
01000 if(airchange_per_hour <= 0.0) airchange_per_hour = 1.0;
01001 break;
01002 case TI_NORMAL:
01003 if(Rroof <= 0.0) Rroof = 30;
01004 if(Rwall <= 0.0) Rwall = 11;
01005 if(Rfloor <= 0.0) Rfloor = 19;
01006 if(Rdoors <= 0.0) Rdoors = 3;
01007 if(Rwindows <= 0.0) Rwindows = 1/0.6;
01008 if(airchange_per_hour <= 0.0) airchange_per_hour = 1.0;
01009 break;
01010 case TI_ABOVE_NORMAL:
01011 if(Rroof <= 0.0) Rroof = 30;
01012 if(Rwall <= 0.0) Rwall = 19;
01013 if(Rfloor <= 0.0) Rfloor = 11;
01014 if(Rdoors <= 0.0) Rdoors = 3;
01015 if(Rwindows <= 0.0) Rwindows = 1/0.6;
01016 if(airchange_per_hour <= 0.0) airchange_per_hour = 1.0;
01017 break;
01018 case TI_GOOD:
01019 if(Rroof <= 0.0) Rroof = 30;
01020 if(Rwall <= 0.0) Rwall = 19;
01021 if(Rfloor <= 0.0) Rfloor = 22;
01022 if(Rdoors <= 0.0) Rdoors = 5;
01023 if(Rwindows <= 0.0) Rwindows = 1/0.47;
01024 if(airchange_per_hour <= 0.0) airchange_per_hour = 0.5;
01025 break;
01026 case TI_VERY_GOOD:
01027 if(Rroof <= 0.0) Rroof = 48;
01028 if(Rwall <= 0.0) Rwall = 22;
01029 if(Rfloor <= 0.0) Rfloor = 30;
01030 if(Rdoors <= 0.0) Rdoors = 11;
01031 if(Rwindows <= 0.0) Rwindows = 1/0.31;
01032 if(airchange_per_hour <= 0.0) airchange_per_hour = 0.5;
01033 break;
01034 case TI_UNKNOWN:
01035
01036 break;
01037 default:
01038
01039 break;
01040 }
01041 }
01042
01043
01044 void house_e::set_window_shgc(){
01045 switch(glazing_layers){
01046 case GL_ONE:
01047 switch(glazing_treatment){
01048 case GT_CLEAR:
01049 switch(window_frame){
01050 case WF_NONE:
01051 glazing_shgc = 0.86;
01052 break;
01053 case WF_ALUMINUM:
01054 case WF_THERMAL_BREAK:
01055 glazing_shgc = 0.75;
01056 break;
01057 case WF_WOOD:
01058 case WF_INSULATED:
01059 glazing_shgc = 0.64;
01060 break;
01061 }
01062 break;
01063 case GT_ABS:
01064 switch(window_frame){
01065 case WF_NONE:
01066 glazing_shgc = 0.73;
01067 break;
01068 case WF_ALUMINUM:
01069 case WF_THERMAL_BREAK:
01070 glazing_shgc = 0.64;
01071 break;
01072 case WF_WOOD:
01073 case WF_INSULATED:
01074 glazing_shgc = 0.54;
01075 break;
01076 }
01077 break;
01078 case GT_REFL:
01079 switch(window_frame){
01080 case WF_NONE:
01081 glazing_shgc = 0.31;
01082 break;
01083 case WF_ALUMINUM:
01084 case WF_THERMAL_BREAK:
01085 glazing_shgc = 0.28;
01086 break;
01087 case WF_WOOD:
01088 case WF_INSULATED:
01089 glazing_shgc = 0.24;
01090 break;
01091 }
01092 break;
01093 }
01094 break;
01095 case GL_TWO:
01096 switch(glazing_treatment){
01097 case GT_CLEAR:
01098 switch(window_frame){
01099 case WF_NONE:
01100 glazing_shgc = 0.76;
01101 break;
01102 case WF_ALUMINUM:
01103 case WF_THERMAL_BREAK:
01104 glazing_shgc = 0.67;
01105 break;
01106 case WF_WOOD:
01107 case WF_INSULATED:
01108 glazing_shgc = 0.57;
01109 break;
01110 }
01111 break;
01112 case GT_ABS:
01113 switch(window_frame){
01114 case WF_NONE:
01115 glazing_shgc = 0.62;
01116 break;
01117 case WF_ALUMINUM:
01118 case WF_THERMAL_BREAK:
01119 glazing_shgc = 0.55;
01120 break;
01121 case WF_WOOD:
01122 case WF_INSULATED:
01123 glazing_shgc = 0.46;
01124 break;
01125 }
01126 break;
01127 case GT_REFL:
01128 switch(window_frame){
01129 case WF_NONE:
01130 glazing_shgc = 0.29;
01131 break;
01132 case WF_ALUMINUM:
01133 case WF_THERMAL_BREAK:
01134 glazing_shgc = 0.27;
01135 break;
01136 case WF_WOOD:
01137 case WF_INSULATED:
01138 glazing_shgc = 0.22;
01139 break;
01140 }
01141 break;
01142 case GT_LOW_S:
01143 switch(window_frame){
01144 case WF_NONE:
01145 glazing_shgc = 0.41;
01146 break;
01147 case WF_ALUMINUM:
01148 case WF_THERMAL_BREAK:
01149 glazing_shgc = 0.37;
01150 break;
01151 case WF_WOOD:
01152 case WF_INSULATED:
01153 glazing_shgc = 0.31;
01154 break;
01155 }
01156 break;
01157 case GT_HIGH_S:
01158 switch(window_frame){
01159 case WF_NONE:
01160 glazing_shgc = 0.70;
01161 break;
01162 case WF_ALUMINUM:
01163 case WF_THERMAL_BREAK:
01164 glazing_shgc = 0.62;
01165 break;
01166 case WF_WOOD:
01167 case WF_INSULATED:
01168 glazing_shgc = 0.52;
01169 break;
01170 }
01171 break;
01172 }
01173 break;
01174 case GL_THREE:
01175 switch(glazing_treatment){
01176 case GT_CLEAR:
01177 switch(window_frame){
01178 case WF_NONE:
01179 glazing_shgc = 0.68;
01180 break;
01181 case WF_ALUMINUM:
01182 case WF_THERMAL_BREAK:
01183 glazing_shgc = 0.60;
01184 break;
01185 case WF_WOOD:
01186 case WF_INSULATED:
01187 glazing_shgc = 0.51;
01188 break;
01189 }
01190 break;
01191 case GT_ABS:
01192 switch(window_frame){
01193 case WF_NONE:
01194 glazing_shgc = 0.34;
01195 break;
01196 case WF_ALUMINUM:
01197 case WF_THERMAL_BREAK:
01198 glazing_shgc = 0.31;
01199 break;
01200 case WF_WOOD:
01201 case WF_INSULATED:
01202 glazing_shgc = 0.26;
01203 break;
01204 }
01205 break;
01206 case GT_REFL:
01207 switch(window_frame){
01208 case WF_NONE:
01209 glazing_shgc = 0.34;
01210 break;
01211 case WF_ALUMINUM:
01212 case WF_THERMAL_BREAK:
01213 glazing_shgc = 0.31;
01214 break;
01215 case WF_WOOD:
01216 case WF_INSULATED:
01217 glazing_shgc = 0.26;
01218 break;
01219 }
01220 break;
01221 case GT_LOW_S:
01222 switch(window_frame){
01223 case WF_NONE:
01224 glazing_shgc = 0.27;
01225 break;
01226 case WF_ALUMINUM:
01227 case WF_THERMAL_BREAK:
01228 glazing_shgc = 0.25;
01229 break;
01230 case WF_WOOD:
01231 case WF_INSULATED:
01232 glazing_shgc = 0.21;
01233 break;
01234 }
01235 break;
01236 case GT_HIGH_S:
01237 switch(window_frame){
01238 case WF_NONE:
01239 glazing_shgc = 0.62;
01240 break;
01241 case WF_ALUMINUM:
01242 case WF_THERMAL_BREAK:
01243 glazing_shgc = 0.55;
01244 break;
01245 case WF_WOOD:
01246 case WF_INSULATED:
01247 glazing_shgc = 0.46;
01248 break;
01249 }
01250 break;
01251 }
01252 break;
01253 }
01254 }
01255
01256 void house_e::set_window_Rvalue(){
01257 if(glass_type == GM_LOW_E_GLASS){
01258 switch(glazing_layers){
01259 case GL_ONE:
01260 gl_error("no value for one pane of low-e glass");
01261 break;
01262 case GL_TWO:
01263 switch(window_frame){
01264 case WF_NONE:
01265 Rwindows = 1.0/0.30;
01266 break;
01267 case WF_ALUMINUM:
01268 Rwindows = 1.0/0.67;
01269 break;
01270 case WF_THERMAL_BREAK:
01271 Rwindows = 1.0/0.47;
01272 break;
01273 case WF_WOOD:
01274 Rwindows = 1.0/0.41;
01275 break;
01276 case WF_INSULATED:
01277 Rwindows = 1.0/0.33;
01278 break;
01279 }
01280 break;
01281 case GL_THREE:
01282 switch(window_frame){
01283 case WF_NONE:
01284 Rwindows = 1/0.27;
01285 break;
01286 case WF_ALUMINUM:
01287 Rwindows = 1/0.64;
01288 break;
01289 case WF_THERMAL_BREAK:
01290 Rwindows = 1/0.43;
01291 break;
01292 case WF_WOOD:
01293 Rwindows = 1/0.37;
01294 break;
01295 case WF_INSULATED:
01296 Rwindows = 1/0.31;
01297 break;
01298 }
01299 break;
01300 }
01301 } else if(glass_type == GM_GLASS){
01302 switch(glazing_layers){
01303 case GL_ONE:
01304 switch(window_frame){
01305 case WF_NONE:
01306 Rwindows = 1/1.04;
01307 break;
01308 case WF_ALUMINUM:
01309 Rwindows = 1/1.27;
01310 break;
01311 case WF_THERMAL_BREAK:
01312 Rwindows = 1/1.08;
01313 break;
01314 case WF_WOOD:
01315 Rwindows = 1/0.90;
01316 break;
01317 case WF_INSULATED:
01318 Rwindows = 1/0.81;
01319 break;
01320 }
01321 break;
01322 case GL_TWO:
01323 switch(window_frame){
01324 case WF_NONE:
01325 Rwindows = 1/0.48;
01326 break;
01327 case WF_ALUMINUM:
01328 Rwindows = 1/0.81;
01329 break;
01330 case WF_THERMAL_BREAK:
01331 Rwindows = 1/0.60;
01332 break;
01333 case WF_WOOD:
01334 Rwindows = 1/0.53;
01335 break;
01336 case WF_INSULATED:
01337 Rwindows = 1/0.44;
01338 break;
01339 }
01340 break;
01341 case GL_THREE:
01342 switch(window_frame){
01343 case WF_NONE:
01344 Rwindows = 1/0.31;
01345 break;
01346 case WF_ALUMINUM:
01347 Rwindows = 1/0.67;
01348 break;
01349 case WF_THERMAL_BREAK:
01350 Rwindows = 1/0.46;
01351 break;
01352 case WF_WOOD:
01353 Rwindows = 1/0.40;
01354 break;
01355 case WF_INSULATED:
01356 Rwindows = 1/0.34;
01357 break;
01358 }
01359 break;
01360 }
01361 } else {
01362 Rwindows = 2.0;
01363 }
01364 }
01369 int house_e::init(OBJECT *parent)
01370 {
01371 OBJECT *hdr = OBJECTHDR(this);
01372 hdr->flags |= OF_SKIPSAFE;
01373
01374 Off_Return = TS_NEVER;
01375
01376 heat_start = false;
01377
01378
01379 struct {
01380 complex **var;
01381 char *varname;
01382 } map[] = { {&pCircuit_V, "voltage_12"},
01383 {&pLine_I, "residential_nominal_current_1"},
01384 {&pShunt, "shunt_1"},
01385 {&pPower, "power_1"},
01387 };
01388
01389 extern complex default_line_voltage[3], default_line_current[3], default_line_power[3], default_line_shunt[3];
01390 extern bool default_NR_mode;
01391 int i;
01392
01393
01394 OBJECT *obj = OBJECTHDR(this);
01395 if (parent!=NULL && (gl_object_isa(parent,"triplex_meter","powerflow") || gl_object_isa(obj->parent,"triplex_node","powerflow")))
01396 {
01397
01398 for (i=0; i<sizeof(map)/sizeof(map[0]); i++)
01399 {
01400 if ((*(map[i].var) = get_complex(parent,map[i].varname))==NULL)
01401 GL_THROW("%s (%s:%d) does not implement triplex_meter variable %s for %s (house_e:%d)",
01402 parent->name?parent->name:"unnamed object", parent->oclass->name, parent->id, map[i].varname, obj->name?obj->name:"unnamed", obj->id);
01403 }
01404
01405
01406 pHouseConn = get_bool(parent,"house_present");
01407
01408
01409 NR_mode = get_bool(parent,"NR_mode");
01410
01411
01412 *pHouseConn = true;
01413 }
01414 else
01415 {
01416 gl_warning("house_e:%d %s; using static voltages", obj->id, parent==NULL?"has no parent triplex_meter defined":"parent is not a triplex_meter");
01417
01418
01419 *(map[0].var) = &default_line_voltage[0];
01420 *(map[1].var) = &default_line_current[0];
01421 *(map[2].var) = &default_line_shunt[0];
01422 *(map[3].var) = &default_line_power[0];
01423
01424
01425 NR_mode = &default_NR_mode;
01426 }
01427
01428
01429 if (panel.max_amps==0) panel.max_amps = 200;
01430 load.power = complex(0,0,J);
01431
01432
01433
01434 if(system_type & ST_GAS) heating_system_type = HT_GAS;
01435 else if (system_type & ST_RST) heating_system_type = HT_RESISTANCE;
01436 if(system_type & ST_AC) cooling_system_type = CT_ELECTRIC;
01437 if(system_type & ST_AIR) fan_type = FT_ONE_SPEED;
01438 if(system_type & ST_VAR) fan_type = FT_TWO_SPEED;
01439
01440 if(heating_system_type == HT_HEAT_PUMP && fan_type == FT_NONE){
01441 fan_type = FT_ONE_SPEED;
01442 }
01443
01444 if(system_type != 0){
01445 if(heating_system_type == HT_UNKNOWN) heating_system_type = HT_NONE;
01446 if(cooling_system_type == CT_UNKNOWN) cooling_system_type = CT_NONE;
01447 if(fan_type == FT_UNKNOWN) fan_type = FT_NONE;
01448 if(auxiliary_system_type == AT_UNKNOWN){
01449 auxiliary_system_type = AT_NONE;
01450 auxiliary_strategy = 0;
01451 }
01452 }
01453 if(system_type == 0){
01454 if(heating_system_type == HT_UNKNOWN) heating_system_type = HT_HEAT_PUMP;
01455 if(cooling_system_type == CT_UNKNOWN) cooling_system_type = CT_ELECTRIC;
01456 if(fan_type == FT_UNKNOWN) fan_type = FT_ONE_SPEED;
01457 if(auxiliary_system_type == AT_UNKNOWN){
01458 auxiliary_system_type = AT_ELECTRIC;
01459 auxiliary_strategy = AX_DEADBAND;
01460 }
01461 } else if(!(system_type & ST_GAS) && !(system_type & ST_RST)){
01462
01463 auxiliary_system_type = AT_ELECTRIC;
01464 auxiliary_strategy = AX_DEADBAND;
01465 }
01466
01467 if(heating_system_type == HT_HEAT_PUMP) {
01468 if(cooling_system_type == CT_NONE)
01469 gl_warning("A HEAT_PUMP heating_system_type with no air conditioning does not make a lot of sense. You may encounter odd behavior with house %s",obj->name);
01470 else if(cooling_system_type == CT_UNKNOWN) {
01471 gl_warning("A HEAT_PUMP heating_system_type with no air conditioning does not make a lot of sense. Setting cooling_system_type to ELECTRIC.");
01472 cooling_system_type = CT_ELECTRIC;
01473 }
01474 }
01475
01476
01477 set_thermal_integrity();
01478
01479
01480 if (heating_COP==0.0) heating_COP = 2.5;
01481 if (heating_COP < 0.0) heating_COP = -heating_COP;
01482 if (cooling_COP==0.0) cooling_COP = 3.5;
01483 if (cooling_COP < 0.0) cooling_COP = -cooling_COP;
01484
01485 if (number_of_stories < 1.0)
01486 number_of_stories = 1.0;
01487 if (fmod(number_of_stories, 1.0) != 0.0){
01488 number_of_stories = floor(number_of_stories);
01489
01490 }
01491 if (aspect_ratio==0.0) aspect_ratio = 1.5;
01492 if (floor_area==0) floor_area = 2500.0;
01493 if (ceiling_height==0) ceiling_height = 8.0;
01494 if (gross_wall_area==0) gross_wall_area = 2.0 * number_of_stories * (aspect_ratio + 1.0) * ceiling_height * sqrt(floor_area/aspect_ratio/number_of_stories);
01495 if (window_wall_ratio==0) window_wall_ratio = 0.15;
01496 if (window_roof_ratio==0) window_roof_ratio = 0.0;
01497 if (number_of_doors==0) number_of_doors = 4.0;
01498 else number_of_doors = floor(number_of_doors);
01499 if (interior_exterior_wall_ratio == 0) interior_exterior_wall_ratio = 1.5;
01500 if (exterior_wall_fraction==0) exterior_wall_fraction = 1.0;
01501 if (exterior_ceiling_fraction==0) exterior_ceiling_fraction = 1.0;
01502 if (exterior_floor_fraction==0) exterior_floor_fraction = 1.0;
01503 if (window_exterior_transmission_coefficient<=0) window_exterior_transmission_coefficient = 0.60;
01504
01505 if (glazing_shgc <= 0.0) set_window_shgc();
01506 if (Rroof<=0) Rroof = 30.0;
01507 if (Rwall<=0) Rwall = 19.0;
01508 if (Rfloor<=0) Rfloor = 22.0;
01509 if (Rwindows<=0) set_window_Rvalue();
01510 if (Rdoors<=0) Rdoors = 5.0;
01511
01512 air_density = 0.0735;
01513 air_heat_capacity = 0.2402;
01514
01515
01516 if (volume==0) volume = ceiling_height*floor_area;
01517 if (air_mass==0) air_mass = air_density*volume;
01518 if (air_thermal_mass==0) air_thermal_mass = 3*air_heat_capacity*air_mass;
01519
01520 if (air_heat_fraction!=0) {
01521 gl_warning("The air_heat_fraction is no longer used to determine heat gain/loss to the air. Setting mass_solar_gain_fraction and mass_internal_gain_fraction to 1-air_heat_fraction specified for house %s.", obj->name);
01522 mass_solar_gain_fraction=1-air_heat_fraction;
01523 mass_internal_gain_fraction=1-air_heat_fraction;
01524 }
01525 if (mass_solar_gain_fraction==0) mass_solar_gain_fraction=0.5;
01526 if (mass_internal_gain_fraction==0) mass_internal_gain_fraction=0.5;
01527 if (air_heat_fraction<0.0 || air_heat_fraction>1.0) throw "air heat fraction is not between 0 and 1";
01528 if (mass_solar_gain_fraction<0.0 || mass_solar_gain_fraction>1.0) throw "the solar gain fraction to mass is not between 0 and 1";
01529 if (mass_internal_gain_fraction<0.0 || mass_internal_gain_fraction>1.0) throw "the internal gain fraction to mass is not between 0 and 1";
01530 if (total_thermal_mass_per_floor_area <= 0.0) total_thermal_mass_per_floor_area = 2.0;
01531 if (interior_surface_heat_transfer_coeff <= 0.0) interior_surface_heat_transfer_coeff = 1.46;
01532
01533 if (airchange_per_hour<=0) airchange_per_hour = 0.5;
01534 if (airchange_UA <= 0) airchange_UA = airchange_per_hour * volume * air_density * air_heat_capacity;
01535
01536 double door_area = number_of_doors * 3.0 * 78.0 / 12.0;
01537 double window_area = gross_wall_area * window_wall_ratio * exterior_wall_fraction;
01538 double net_exterior_wall_area = exterior_wall_fraction * (gross_wall_area - window_area - door_area);
01539 double exterior_ceiling_area = floor_area * exterior_ceiling_fraction / number_of_stories;
01540 double exterior_floor_area = floor_area * exterior_floor_fraction / number_of_stories;
01541
01542 if (envelope_UA==0) envelope_UA = exterior_ceiling_area/Rroof + exterior_floor_area/Rfloor + net_exterior_wall_area/Rwall + window_area/Rwindows + door_area/Rdoors;
01543
01544 solar_heatgain_factor = window_area * glazing_shgc * window_exterior_transmission_coefficient;
01545
01546
01547 if (heating_setpoint==0.0) heating_setpoint = 70.0;
01548 if (cooling_setpoint==0.0) cooling_setpoint = 75.0;
01549 if (design_cooling_setpoint==0.0) design_cooling_setpoint = 75.0;
01550 if (design_heating_setpoint==0.0) design_heating_setpoint = 70.0;
01551 if (design_peak_solar<=0.0) design_peak_solar = 195.0;
01552
01553 if (thermostat_deadband<=0.0) thermostat_deadband = 2.0;
01554 if (thermostat_cycle_time<=0.0) thermostat_cycle_time = 120;
01555 if (Tair==0.0){
01556
01557 double Thigh = cooling_setpoint+thermostat_deadband/2.0;
01558 double Tlow = heating_setpoint-thermostat_deadband/2.0;
01559 Thigh = clip(Thigh, 60.0, 140.0);
01560 Tlow = clip(Tlow, 60.0, 140.0);
01561 Tair = gl_random_uniform(Tlow, Thigh);
01562 }
01563 if (over_sizing_factor<=0.0) over_sizing_factor = 0.0;
01564 if (cooling_design_temperature == 0.0) cooling_design_temperature = 95.0;
01565 if (design_internal_gains<=0.0) design_internal_gains = 167.09 * pow(floor_area,0.442);
01566 if (latent_load_fraction<=0.0) latent_load_fraction = 0.30;
01567
01568 double round_value = 0.0;
01569 if (design_cooling_capacity<=0.0 && cooling_system_type != CT_NONE)
01570 {
01571 round_value = 0.0;
01572 design_cooling_capacity = (1.0 + over_sizing_factor) * (1.0 + latent_load_fraction) * ((envelope_UA + airchange_UA) * (cooling_design_temperature - design_cooling_setpoint) + design_internal_gains + (design_peak_solar * solar_heatgain_factor));
01573 round_value = (design_cooling_capacity) / 6000.0;
01574 design_cooling_capacity = ceil(round_value) * 6000.0;
01575 }
01576
01577 if(auxiliary_system_type != AT_NONE && heating_system_type == HT_NONE)
01578 {
01579 static int aux_for_rst = 0;
01580 if(aux_for_rst == 0){
01581 gl_warning("house_e heating strategies with auxiliary heat but without normal heating modes are converted"
01582 "to resistively heated houses, see house %s",obj->name);
01583 aux_for_rst = 1;
01584 }
01585 heating_system_type = HT_RESISTANCE;
01586 }
01587
01588 if (design_heating_capacity<=0 && heating_system_type != HT_NONE)
01589 {
01590 double round_value = 0.0;
01591 if(heating_system_type == HT_HEAT_PUMP){
01592 design_heating_capacity = design_cooling_capacity;
01593 } else {
01594 design_heating_capacity = (1.0 + over_sizing_factor) * (envelope_UA + airchange_UA) * (design_heating_setpoint - heating_design_temperature);
01595 round_value = (design_heating_capacity) / 10000.0;
01596 design_heating_capacity = ceil(round_value) * 10000.0;
01597 }
01598 }
01599
01600 if (system_mode==SM_UNKNOWN) system_mode = SM_OFF;
01601 if (last_system_mode == SM_UNKNOWN) last_system_mode = SM_OFF;
01602 if (last_mode_timer == 0) last_mode_timer = 3600*6;
01603
01604 if (aux_heat_capacity<=0.0 && auxiliary_system_type != AT_NONE)
01605 {
01606 double round_value = 0.0;
01607 aux_heat_capacity = (1.0 + over_sizing_factor) * (envelope_UA + airchange_UA) * (design_heating_setpoint - heating_design_temperature);
01608 round_value = (aux_heat_capacity) / 10000.0;
01609 aux_heat_capacity = ceil(round_value) * 10000.0;
01610 }
01611
01612 if (aux_heat_deadband<=0.0) aux_heat_deadband = thermostat_deadband;
01613 if (aux_heat_temp_lockout<=0.0) aux_heat_temp_lockout = 10;
01614 if (aux_heat_time_delay<=0.0) aux_heat_time_delay = 300.0;
01615
01616 if (duct_pressure_drop<=0.0) duct_pressure_drop = 0.5;
01617 if (fan_design_airflow<=0.0){
01618 double design_heating_cfm;
01619 double design_cooling_cfm;
01620 double gtr_cfm;
01621
01622 design_heating_cfm = (design_heating_capacity > aux_heat_capacity ? design_heating_capacity : aux_heat_capacity) / (air_density * air_heat_capacity * (heating_supply_air_temp - design_heating_setpoint)) / 60.0;
01623 design_cooling_cfm = design_cooling_capacity / (1.0 + latent_load_fraction) / (air_density * air_heat_capacity * (design_cooling_setpoint - cooling_supply_air_temp)) / 60.0;
01624 gtr_cfm = (design_heating_cfm > design_cooling_cfm ? design_heating_cfm : design_cooling_cfm);
01625 fan_design_airflow = gtr_cfm;
01626 }
01627
01628 if (fan_design_power<=0.0){
01629 double roundval;
01630
01631 roundval = ceil((0.117 * duct_pressure_drop * fan_design_airflow / 0.42 / 745.7)*8);
01632 fan_design_power = roundval / 8.0 * 745.7 / 0.88;
01633 }
01634
01635 if (fan_low_power_fraction<=0.0 && fan_type == FT_TWO_SPEED)
01636 fan_low_power_fraction = 0.5;
01637 if (fan_power <= 0.0) fan_power = 0.0;
01638
01639 if (house_content_thermal_mass==0) house_content_thermal_mass = total_thermal_mass_per_floor_area*floor_area - 2 * air_heat_capacity*air_mass;
01640 if (house_content_heat_transfer_coeff==0) house_content_heat_transfer_coeff = interior_surface_heat_transfer_coeff*( net_exterior_wall_area / exterior_wall_fraction + gross_wall_area * interior_exterior_wall_ratio + number_of_stories * exterior_ceiling_area / exterior_ceiling_fraction);
01641
01642 if(Tair == 0){
01643 if (system_mode==SM_OFF)
01644 Tair = gl_random_uniform(heating_setpoint,cooling_setpoint);
01645 else if (system_mode==SM_HEAT || system_mode==SM_AUX)
01646 Tair = gl_random_uniform(heating_setpoint-thermostat_deadband/2,heating_setpoint+thermostat_deadband/2);
01647 else if (system_mode==SM_COOL)
01648 Tair = gl_random_uniform(cooling_setpoint-thermostat_deadband/2,cooling_setpoint+thermostat_deadband/2);
01649 }
01650
01651 if (Tmaterials == 0.0)
01652 Tmaterials = Tair;
01653
01654
01655 if (motor_model != MM_NONE)
01656 {
01657 if ( hvac_motor_loss_power_factor > 1 || hvac_motor_loss_power_factor < -1 )
01658 GL_THROW("hvac_motor_power_factor must have a value between -1 and 1");
01659 if ( hvac_motor_efficiency > 1 || hvac_motor_efficiency < 0 )
01660 GL_THROW("hvac_motor_efficiency must have a value between 0 and 1");
01661 switch(motor_efficiency){
01662 case ME_VERY_POOR:
01663 hvac_motor_efficiency = 0.8236;
01664 break;
01665 case ME_POOR:
01666 hvac_motor_efficiency = 0.8488;
01667 break;
01668 case ME_AVERAGE:
01669 hvac_motor_efficiency = 0.8740;
01670 break;
01671 case ME_GOOD:
01672 hvac_motor_efficiency = 0.9020;
01673 break;
01674 case ME_VERY_GOOD:
01675 hvac_motor_efficiency = 0.9244;
01676 break;
01677 default:
01678 gl_warning("Unknown motor_efficiency setting. Setting to AVERAGE.");
01679 hvac_motor_efficiency = 0.8740;
01680 motor_efficiency = ME_AVERAGE;
01681 break;
01682 }
01683 }
01684
01685
01686
01687 #define Ca (air_thermal_mass)
01688 #define Tout (outside_temperature)
01689 #define Ua (envelope_UA)
01690 #define Cm (house_content_thermal_mass)
01691 #define Hm (house_content_heat_transfer_coeff)
01692 #define Qs (solar_load)
01693 #define Qh (load.heatgain)
01694 #define Ta (Tair)
01695 #define dTa (dTair)
01696 #define Tm (Tmaterials)
01697
01698 if (Ca<=0)
01699 throw "Ca must be positive";
01700 if (Cm<=0)
01701 throw "Cm must be positive";
01702
01703 a = Cm*Ca/Hm;
01704 b = Cm*(Ua+airchange_UA+Hm)/Hm+Ca;
01705 c = Ua + airchange_UA;
01706 c1 = -(Ua+airchange_UA + Hm)/Ca;
01707 c2 = Hm/Ca;
01708 double rr = sqrt(b*b-4*a*c)/(2*a);
01709 double r = -b/(2*a);
01710 r1 = r+rr;
01711 r2 = r-rr;
01712 A3 = Ca/Hm * r1 + (Ua+airchange_UA+Hm)/Hm;
01713 A4 = Ca/Hm * r2 + (Ua+airchange_UA+Hm)/Hm;
01714
01715
01716 extern double default_outdoor_temperature;
01717 outside_temperature = default_outdoor_temperature;
01718
01719 if (hvac_power_factor == 0)
01720 load.power_factor = 0.97;
01721 else
01722 load.power_factor = hvac_power_factor;
01723
01724
01725 attach_implicit_enduses();
01726 update_system();
01727 update_model();
01728
01729
01730 if (hvac_breaker_rating == 0)
01731 {
01732 load.breaker_amps = 200;
01733 hvac_breaker_rating = 200;
01734 }
01735 else
01736 load.breaker_amps = hvac_breaker_rating;
01737 load.config = EUC_IS220;
01738 attach(OBJECTHDR(this),hvac_breaker_rating, true, &load);
01739
01740 return 1;
01741 }
01742
01743 void house_e::attach_implicit_enduses()
01744 {
01745 IMPLICITENDUSE *item;
01746 for (item=implicit_enduse_list; item!=NULL; item=item->next){
01747 attach(NULL,item->amps,item->is220,&(item->load));
01748 }
01749
01750 return;
01751 }
01752
01757 CIRCUIT *house_e::attach(OBJECT *obj,
01758 double breaker_amps,
01759 int is220,
01760 enduse *pLoad)
01761 {
01762
01763 CIRCUIT *c = new CIRCUIT;
01764 if (c==NULL)
01765 {
01766 gl_error("memory allocation failure");
01767 return 0;
01768
01769
01770 }
01771 c->next = panel.circuits;
01772 c->id = panel.circuits ? panel.circuits->id+1 : 1;
01773
01774
01775 c->max_amps = breaker_amps;
01776
01777
01778 if (pLoad)
01779 c->pLoad = pLoad;
01780 else if (obj)
01781 {
01782 c->pLoad = (enduse*)gl_get_addr(obj,"enduse_load");
01783 if (c->pLoad==NULL)
01784 GL_THROW("end-use load %s couldn't be connected because it does not publish 'enduse_load' property", c->pLoad->name);
01785 }
01786 else
01787 GL_THROW("end-use load couldn't be connected neither an object nor a enduse property was given");
01788
01789
01790 if (is220 == 1)
01791 {
01792 c->type = X12;
01793 c->id++;
01794 }
01795 else if (c->id&0x01)
01796 c->type = X13;
01797 else
01798 c->type = X23;
01799
01800
01801 panel.circuits = c;
01802
01803
01804 c->pV = &(pCircuit_V[(int)c->type]);
01805
01806
01807 c->status = BRK_CLOSED;
01808
01809
01810
01811 c->tripsleft = 100;
01812
01813 return c;
01814 }
01815
01816 void house_e::update_model(double dt)
01817 {
01818 #ifndef _DEBUG
01819 double d;
01820 #endif
01821
01822
01823
01824 incident_solar_radiation = 0;
01825 int i;
01826
01827 for (i=1; i<9; i++)
01828 incident_solar_radiation += pSolar[i];
01829
01830 incident_solar_radiation *= 3.412/8;
01831 Qs = incident_solar_radiation*solar_heatgain_factor;
01832
01833
01834
01835
01836 if (Qs<0)
01837 throw "solar gain is negative";
01838
01839
01840 Qi = total.heatgain - load.heatgain;
01841 Qa = Qh + (1-mass_internal_gain_fraction)*Qi + (1-mass_solar_gain_fraction)*Qs;
01842 Qm = mass_internal_gain_fraction*Qi + mass_solar_gain_fraction*Qs;
01843
01844 d = Qa + Qm + (Ua+airchange_UA)*Tout;
01845 Teq = d/c;
01846
01847
01848 dTa = c2*Tm + c1*Ta - (c1+c2)*Tout + Qa/Ca;
01849 k1 = (r2*Tair - r2*Teq - dTa)/(r2-r1);
01850 k2 = Tair - Teq - k1;
01851 }
01852
01860 void house_e::update_system(double dt)
01861 {
01862
01864
01865
01866
01867
01868
01869 double heating_cop_adj;
01870 double cooling_cop_adj;
01871
01872 if (*pTout < 40)
01873 {
01874 heating_cop_adj = heating_COP / (2.03914613 - 0.03906753*(*pTout) + 0.00045617*(*pTout)*(*pTout) - 0.00000203*(*pTout)*(*pTout)*(*pTout));
01875 double temp_temperature = 40;
01876 cooling_cop_adj = cooling_COP / (-0.01363961 + 0.01066989*temp_temperature);
01877 }
01878 else if (*pTout > 80)
01879 {
01880 cooling_cop_adj = cooling_COP / (-0.01363961 + 0.01066989*(*pTout));
01881 double temp_temperature = 80;
01882 heating_cop_adj = heating_COP / (2.03914613 - 0.03906753*temp_temperature + 0.00045617*temp_temperature*temp_temperature - 0.00000203*temp_temperature*temp_temperature*temp_temperature);
01883 }
01884 else
01885 {
01886 cooling_cop_adj = cooling_COP / (-0.01363961 + 0.01066989*(*pTout));
01887 heating_cop_adj = heating_COP / (2.03914613 - 0.03906753*(*pTout) + 0.00045617*(*pTout)*(*pTout) - 0.00000203*(*pTout)*(*pTout)*(*pTout));
01888 }
01889 adj_cooling_cop = cooling_cop_adj;
01890 adj_heating_cop = heating_cop_adj;
01891 double heating_capacity_adj = design_heating_capacity*(0.34148808 + 0.00894102*(*pTout) + 0.00010787*(*pTout)*(*pTout));
01892 double cooling_capacity_adj = design_cooling_capacity*(1.48924533 - 0.00514995*(*pTout));
01893 adj_cooling_cap = cooling_capacity_adj;
01894 adj_heating_cap = heating_capacity_adj;
01895 #pragma message("house_e: add update_system voltage adjustment for heating")
01896 double voltage_adj = (((pCircuit_V[0]).Mag() * (pCircuit_V[0]).Mag()) / (240.0 * 240.0) * load.impedance_fraction + ((pCircuit_V[0]).Mag() / 240.0) * load.current_fraction + load.power_fraction);
01897 double voltage_adj_resistive = ((pCircuit_V[0]).Mag() * (pCircuit_V[0]).Mag()) / (240.0 * 240.0);
01898
01899 switch (system_mode) {
01900 case SM_HEAT:
01901
01902 if(fan_type != FT_NONE)
01903 fan_power = fan_design_power/1000.0;
01904 else
01905 fan_power = 0.0;
01906
01907
01908
01909 switch(heating_system_type){
01910 case HT_NONE:
01911 heating_demand = 0.0;
01912 system_rated_capacity = 0.0;
01913 system_rated_power = 0.0;
01914 fan_power = 0.0;
01915 break;
01916 case HT_RESISTANCE:
01917 heating_demand = design_heating_capacity*KWPBTUPH;
01918 system_rated_capacity = design_heating_capacity*voltage_adj_resistive + fan_power*BTUPHPKW;
01919 system_rated_power = heating_demand;
01920 break;
01921 case HT_HEAT_PUMP:
01922 heating_demand = heating_capacity_adj / heating_cop_adj * KWPBTUPH;
01923 system_rated_capacity = heating_capacity_adj*voltage_adj + fan_power*BTUPHPKW;
01924 system_rated_power = heating_demand;
01925 break;
01926 case HT_GAS:
01927 heating_demand = 0.0;
01928 system_rated_capacity = design_heating_capacity + fan_power*BTUPHPKW;
01929 system_rated_power = heating_demand;
01930 break;
01931 }
01932 break;
01933 case SM_AUX:
01934
01935 if(fan_type != FT_NONE)
01936 fan_power = fan_design_power/1000.0;
01937 else
01938 fan_power = 0.0;
01939
01940 switch(auxiliary_system_type){
01941 case AT_NONE:
01942 heating_demand = 0.0;
01943 system_rated_capacity = 0.0;
01944 system_rated_power = 0.0;
01945 break;
01946 case AT_ELECTRIC:
01947 heating_demand = aux_heat_capacity*KWPBTUPH;
01948 system_rated_capacity = aux_heat_capacity*voltage_adj_resistive + fan_power*BTUPHPKW;
01949 system_rated_power = heating_demand;
01950 break;
01951 }
01952 break;
01953 case SM_COOL:
01954
01955 if(fan_type != FT_NONE)
01956 fan_power = fan_design_power/1000.0;
01957 else
01958 fan_power = 0.0;
01959
01960
01961
01962 switch(cooling_system_type){
01963 case CT_NONE:
01964 cooling_demand = 0.0;
01965 system_rated_capacity = 0.0;
01966 system_rated_power = 0.0;
01967 fan_power = 0.0;
01968 break;
01969 case CT_ELECTRIC:
01970 cooling_demand = cooling_capacity_adj / cooling_cop_adj * KWPBTUPH;
01971
01972 system_rated_capacity = -cooling_capacity_adj / (1 + 0.1 + latent_load_fraction/(1 + exp(4-10*(*pRhout)))) + fan_power*BTUPHPKW;
01973 system_rated_power = cooling_demand;
01974 break;
01975 }
01976 break;
01977 default:
01978
01979 if(fan_type == FT_TWO_SPEED){
01980 fan_power = fan_design_power * fan_low_power_fraction / 1000.0;
01981 } else {
01982 fan_power = 0.0;
01983 }
01984 system_rated_capacity = fan_power*BTUPHPKW;
01985 system_rated_power = 0.0;
01986
01987 }
01988
01989 if(this->override == OV_OFF){
01990 system_mode = SM_OFF;
01991 fan_power = 0;
01992 system_rated_capacity = 0.0;
01993 system_rated_power = 0.0;
01994 cooling_demand = 0.0;
01995 heating_demand = 0.0;
01996 load.power.SetRect(0.0, 0.0);
01997 load.admittance.SetRect(0.0, 0.0);
01998 load.current.SetRect(0.0, 0.0);
01999 load.total.SetRect(0.0, 0.0);
02000 }
02001
02002
02003 load.total = system_rated_power + fan_power;
02004 load.heatgain = system_rated_capacity;
02005
02006 if( (cooling_system_type == CT_ELECTRIC && system_mode == SM_COOL) ||
02007 (heating_system_type == HT_HEAT_PUMP && system_mode == SM_HEAT)) {
02008 load.power.SetRect(load.power_fraction * load.total.Re() , load.power_fraction * load.total.Re() * sqrt( 1 / (load.power_factor*load.power_factor) - 1) );
02009 load.admittance.SetRect(load.impedance_fraction * load.total.Re() , load.impedance_fraction * load.total.Re() * sqrt( 1 / (load.power_factor*load.power_factor) - 1) );
02010 load.current.SetRect(load.current_fraction * load.total.Re(), load.current_fraction * load.total.Re() * sqrt( 1 / (load.power_factor*load.power_factor) - 1) );
02011
02012
02013
02014 if (motor_model == MM_BASIC)
02015 {
02016 if (system_mode == SM_HEAT)
02017 {
02018 hvac_motor_real_loss = hvac_motor_loss_power_factor*(1 - hvac_motor_efficiency) * sqrt( design_heating_capacity*KWPBTUPH*design_heating_capacity*KWPBTUPH / (load.power_factor*load.power_factor*heating_COP*heating_COP) );
02019 hvac_motor_reactive_loss = sqrt( 1 / (hvac_motor_loss_power_factor*hvac_motor_loss_power_factor) - 1) * hvac_motor_real_loss;
02020 }
02021 else if (system_mode == SM_COOL)
02022 {
02023 hvac_motor_real_loss = hvac_motor_loss_power_factor*(1 - hvac_motor_efficiency) * sqrt( design_cooling_capacity*KWPBTUPH*design_cooling_capacity*KWPBTUPH / (load.power_factor*load.power_factor*cooling_COP*cooling_COP) );
02024 hvac_motor_reactive_loss = sqrt( 1 / (hvac_motor_loss_power_factor*hvac_motor_loss_power_factor) - 1) * hvac_motor_real_loss;
02025 }
02026
02027 load.admittance += complex(hvac_motor_real_loss,hvac_motor_reactive_loss);
02028 }
02029 else if (motor_model == MM_FULL)
02030 gl_warning("FULL motor model is not yet supported. No losses are assumed.");
02031
02032 } else {
02033
02034
02035 load.power.SetRect(fan_power * fan_power_fraction, fan_power * fan_power_fraction * sqrt( 1 / (fan_power_factor * fan_power_factor) - 1));
02036 load.admittance.SetRect(system_rated_power + fan_power * fan_impedance_fraction, fan_power * fan_impedance_fraction * sqrt( 1 / (fan_power_factor * fan_power_factor) - 1));
02037 load.current.SetRect(fan_power * fan_current_fraction, fan_power * fan_current_fraction * sqrt( 1 / (fan_power_factor * fan_power_factor) - 1));
02038 }
02039
02040
02041 hvac_load = load.total.Re() * (load.power_fraction + load.voltage_factor * (load.impedance_fraction + load.current_fraction * load.voltage_factor));
02042 }
02043
02046 TIMESTAMP house_e::presync(TIMESTAMP t0, TIMESTAMP t1)
02047 {
02048 OBJECT *obj = OBJECTHDR(this);
02049 const double dt = (double)((t1-t0)*TS_SECOND)/3600;
02050 CIRCUIT *c;
02051
02052 if (*NR_mode == false)
02053 {
02054
02055 load_values[0][0] = load_values[0][1] = load_values[0][2] = 0.0;
02056 load_values[1][0] = load_values[1][1] = load_values[1][2] = 0.0;
02057 load_values[2][0] = load_values[2][1] = load_values[2][2] = 0.0;
02058 }
02059
02060
02061 if (t0>0 && dt>0)
02062 {
02063
02064 if (c2!=0)
02065 {
02066
02067 const double e1 = k1*exp(r1*dt);
02068 const double e2 = k2*exp(r2*dt);
02069 Tair = e1 + e2 + Teq;
02070 Tmaterials = A3*e1 + A4*e2 + Qm/Hm + (Qm+Qa)/(Ua+airchange_UA) + Tout;
02071 }
02072 }
02073
02074
02075 for (c=panel.circuits; c!=NULL; c=c->next)
02076 {
02077
02078 int n = (int)c->type;
02079 if (n<0 || n>2)
02080 GL_THROW("%s:%d circuit %d has an invalid circuit type (%d)", obj->oclass->name, obj->id, c->id, (int)c->type);
02081 c->pLoad->voltage_factor = c->pV->Mag() / ((c->pLoad->config&EUC_IS220) ? 240 : 120);
02082 }
02083 return TS_NEVER;
02084 }
02085
02089 TIMESTAMP house_e::sync(TIMESTAMP t0, TIMESTAMP t1)
02090 {
02091 OBJECT *obj = OBJECTHDR(this);
02092 TIMESTAMP t2 = TS_NEVER, t;
02093 const double dt1 = (double)(t1-t0)*TS_SECOND;
02094
02095 if (*NR_mode == false)
02096 {
02097 if(!heat_start){
02098
02099 outside_temperature = *pTout;
02100 outdoor_rh = *pRhout*100;
02101 }
02102
02103 if (t0==0 || t1>t0){
02104 outside_temperature = *pTout;
02105 outdoor_rh = *pRhout*100;
02106
02107
02108 update_system(dt1);
02109 }
02110
02111 t2 = sync_enduses(t0, t1);
02112 #ifdef _DEBUG
02113 gl_debug("house %s (%d) sync_enduses event at '%s'", obj->name, obj->id, gl_strftime(t2));
02114 #endif
02115
02116
02117
02118
02119
02120 t = sync_panel(t0,t1);
02121 if (t < t2) {
02122 t2 = t;
02123 #ifdef _DEBUG
02124 gl_debug("house %s (%d) sync_panel event '%s'", obj->name, obj->id, gl_strftime(t2));
02125 #endif
02126 }
02127
02128 if ((t0==0 || t1>t0) || (!heat_start)){
02129
02130
02131 update_model(dt1);
02132 heat_start = true;
02133
02134 }
02135
02136
02137 update_Tevent();
02138
02139
02140 double dt2;
02141
02142
02143
02144
02145
02146 if(t < thermostat_last_cycle_time + thermostat_cycle_time){
02147 dt2 = (double)(thermostat_last_cycle_time + thermostat_cycle_time);
02148 } else {
02149 dt2 = e2solve(k1,r1,k2,r2,Teq-Tevent)*3600;
02150 }
02151
02152
02153 if (isnan(dt2) || !isfinite(dt2) || dt2<0)
02154 {
02155 #ifdef _DEBUG
02156 gl_debug("house %s (%d) time to next event is indeterminate", obj->name, obj->id);
02157 #endif
02158
02159
02160
02161 }
02162
02163
02164 else if (dt2<TS_SECOND)
02165 {
02166
02167 t = t1+1; if (t<t2) t2 = t;
02168 #ifdef _DEBUG
02169 gl_debug("house %s (%d) time to next event is less than time resolution", obj->name, obj->id);
02170 #endif
02171 }
02172 else
02173 {
02174
02175 t = t1+(TIMESTAMP)(ceil(dt2)*TS_SECOND); if (t<t2) t2 = t;
02176 #ifdef _DEBUG
02177 gl_debug("house %s (%d) time to next event is %.2f hrs", obj->name, obj->id, dt2/3600);
02178 #endif
02179 }
02180
02181 #ifdef _DEBUG
02182 char tbuf[64];
02183 gl_printtime(t2, tbuf, 64);
02184 gl_debug("house %s (%d) next event at '%s'", obj->name, obj->id, tbuf);
02185 #endif
02186
02187
02188 if (t2!=TS_NEVER)
02189 {
02190 TIMESTAMP t = (TIMESTAMP)(ceil((t2<0 ? -t2 : t2)/system_dwell_time)*system_dwell_time);
02191 t2 = (t2<0 ? -t : t);
02192 }
02193
02194
02195 Off_Return = t2;
02196 return t2;
02197 }
02198 else
02199 {
02200
02201 if (obj->parent != NULL)
02202 LOCK_OBJECT(obj->parent);
02203
02204
02205
02206 pPower[0] += load_values[0][0];
02207 pPower[1] += load_values[0][1];
02208 pPower[2] += load_values[0][2];
02209
02210
02211 pLine_I[0] += load_values[1][0];
02212 pLine_I[1] += load_values[1][1];
02213 pLine_I[2] += load_values[1][2];
02214
02215
02216
02217 pShunt[0] += load_values[2][0];
02218 pShunt[1] += load_values[2][1];
02219 pShunt[2] += load_values[2][2];
02220
02221 if (obj->parent != NULL)
02222 UNLOCK_OBJECT(obj->parent);
02223
02224 return Off_Return;
02225 }
02226 }
02227
02229 TIMESTAMP house_e::postsync(TIMESTAMP t0, TIMESTAMP t1)
02230 {
02231 OBJECT *obj = OBJECTHDR(this);
02232
02233
02234 if (obj->parent != NULL)
02235 LOCK_OBJECT(obj->parent);
02236
02237
02238
02239 pPower[0] -= load_values[0][0];
02240 pPower[1] -= load_values[0][1];
02241 pPower[2] -= load_values[0][2];
02242
02243
02244 pLine_I[0] -= load_values[1][0];
02245 pLine_I[1] -= load_values[1][1];
02246 pLine_I[2] -= load_values[1][2];
02247
02248
02249
02250 pShunt[0] -= load_values[2][0];
02251 pShunt[1] -= load_values[2][1];
02252 pShunt[2] -= load_values[2][2];
02253
02254 if (obj->parent != NULL)
02255 UNLOCK_OBJECT(obj->parent);
02256
02257 return TS_NEVER;
02258 }
02259
02260
02261 void house_e::update_Tevent()
02262 {
02263 OBJECT *obj = OBJECTHDR(this);
02264
02265
02266 switch(system_mode) {
02267
02268 case SM_HEAT: case SM_AUX:
02269 Tevent = TheatOff;
02270 break;
02271
02272 case SM_COOL:
02273 Tevent = TcoolOff;
02274 break;
02275
02276 default:
02277 if (dTair<0)
02278 Tevent = TheatOn;
02279 else if (dTair>0)
02280
02281 Tevent = ( cooling_system_type != CT_NONE ? TcoolOn : warn_high_temp );
02282 else
02283 Tevent = Tair;
02284 break;
02285 }
02286 }
02287
02292 TIMESTAMP house_e::sync_thermostat(TIMESTAMP t0, TIMESTAMP t1)
02293 {
02294 double terr = dTair/3600;
02295
02296
02297 if (thermostat_control==TC_FULL)
02298 {
02299 double tdead = thermostat_deadband/2;
02300 TcoolOn = cooling_setpoint+tdead;
02301 TcoolOff = cooling_setpoint-tdead;
02302 TheatOn = heating_setpoint-tdead;
02303 TheatOff = heating_setpoint+tdead;
02304 TauxOn = TheatOn-aux_heat_deadband;
02305 }
02306
02307
02308 if(t1 < thermostat_last_cycle_time + thermostat_cycle_time){
02309 return TS_NEVER;
02310 }
02311
02312 if(t0 < thermostat_last_cycle_time + last_mode_timer){
02313 last_system_mode = SM_OFF;
02314 }
02315
02316 switch(last_system_mode){
02317 case SM_HEAT:
02318 case SM_AUX:
02319 if (TcoolOff<TheatOff)
02320 TcoolOff = TheatOff;
02321 if (TcoolOn<TcoolOff+thermostat_deadband)
02322 TcoolOn = TcoolOff+thermostat_deadband;
02323 break;
02324 case SM_OFF:
02325 case SM_COOL:
02326 if (TcoolOff<TheatOff)
02327 TheatOff = TcoolOff;
02328 if (TheatOff<TheatOn-thermostat_deadband)
02329 TheatOff = TheatOn-thermostat_deadband;
02330 if (TauxOn<TheatOn-aux_heat_deadband)
02331 TauxOn = TheatOn-aux_heat_deadband;
02332 break;
02333 }
02334
02335
02336 if (TcoolOff<TheatOff && cooling_system_type!=CT_NONE)
02337 {
02338 char buffer[64];
02339 gl_error("%s: thermostat setpoints deadbands overlap (TcoolOff=%.1f < TheatOff=%.1f)", gl_name(OBJECTHDR(this),buffer,sizeof(buffer)), TcoolOff, TheatOff);
02340 return TS_INVALID;
02341 }
02342
02343
02344 if(system_mode == SM_UNKNOWN)
02345 {
02346 char buffer[64];
02347 gl_warning("%s: system_mode was unknown, changed to off", gl_name(OBJECTHDR(this),buffer,sizeof(buffer)));
02348 system_mode = SM_OFF;
02349 }
02350
02351
02352
02353
02354
02355
02356
02357 if (thermostat_control!=TC_NONE)
02358 {
02359 switch(system_mode) {
02360 case SM_HEAT:
02361
02362 if ( auxiliary_system_type != AT_NONE &&
02363 ((auxiliary_strategy & AX_DEADBAND && Tair < TauxOn)
02364 || (auxiliary_strategy & AX_TIMER && t0 >= thermostat_last_cycle_time + aux_heat_time_delay))
02365 || (auxiliary_strategy & AX_LOCKOUT && *pTout <= aux_heat_temp_lockout)
02366 ){
02367 last_system_mode = system_mode = SM_AUX;
02368 power_state = PS_ON;
02369 thermostat_last_cycle_time = t1;
02370 } else if(Tair > TheatOff - terr/2){
02371 system_mode = SM_OFF;
02372 power_state = PS_OFF;
02373 thermostat_last_cycle_time = t1;
02374 }
02375 break;
02376 case SM_AUX:
02377 if(Tair > TheatOff - terr/2){
02378 system_mode = SM_OFF;
02379 power_state = PS_OFF;
02380 thermostat_last_cycle_time = t1;
02381 }
02382 break;
02383 case SM_COOL:
02384 if(Tair < TcoolOff - terr/2){
02385 system_mode = SM_OFF;
02386 power_state = PS_OFF;
02387 thermostat_last_cycle_time = t1;
02388 }
02389 break;
02390 case SM_OFF:
02391 if((Tair > TcoolOn - terr/2) &&
02392
02393 (cooling_system_type != CT_NONE ))
02394 {
02395 last_system_mode = system_mode = SM_COOL;
02396 power_state = PS_ON;
02397 thermostat_last_cycle_time = t1;
02398 }
02399 else if(Tair < TheatOn - terr/2)
02400 {
02401
02402 if (Tair < TauxOn &&
02403 (auxiliary_system_type != AT_NONE) &&
02404 (auxiliary_strategy & AX_DEADBAND) &&
02405 (!(auxiliary_strategy & AX_LOCKOUT) || (*pTout <= aux_heat_temp_lockout)))
02406 {
02407 last_system_mode = system_mode = SM_AUX;
02408 power_state = PS_ON;
02409 thermostat_last_cycle_time = t1;
02410 }
02411 else
02412 {
02413 last_system_mode = system_mode = SM_HEAT;
02414 power_state = PS_ON;
02415 thermostat_last_cycle_time = t1;
02416 }
02417 }
02418 break;
02419 }
02420 }
02421
02422 return TS_NEVER;
02423 }
02424
02425 TIMESTAMP house_e::sync_panel(TIMESTAMP t0, TIMESTAMP t1)
02426 {
02427 TIMESTAMP t2 = TS_NEVER;
02428 OBJECT *obj = OBJECTHDR(this);
02429
02430
02431 if((t0 != 0 && t1 > t0) || (!heat_start)){
02432 total.heatgain = 0;
02433 }
02434 total.total = total.power = total.current = total.admittance = complex(0,0);
02435
02436
02437 CIRCUIT *c;
02438 for (c=panel.circuits; c!=NULL; c=c->next)
02439 {
02440
02441 int n = (int)c->type;
02442 if (n<0 || n>2)
02443 GL_THROW("%s:%d circuit %d has an invalid circuit type (%d)", obj->oclass->name, obj->id, c->id, (int)c->type);
02444
02445
02446 if (c->status==BRK_OPEN && t1>=c->reclose)
02447 {
02448 c->status = BRK_CLOSED;
02449 c->reclose = TS_NEVER;
02450 t2 = t1;
02451 gl_debug("house_e:%d panel breaker %d closed", obj->id, c->id);
02452 }
02453
02454
02455 if (c->status==BRK_CLOSED)
02456 {
02457
02458 if ((c->pV)->Mag() == 0)
02459 {
02460 gl_debug("house_e:%d circuit %d (enduse %s) voltage is zero", obj->id, c->id, c->pLoad->name);
02461 continue;
02462 }
02463
02464 complex current = ~(c->pLoad->total*1000 / *(c->pV));
02465
02466
02467 if (current.Mag()>c->max_amps)
02468 {
02469
02470 if (c->tripsleft>0 && gl_random_bernoulli(1/(c->tripsleft--))==0)
02471 {
02472
02473 c->status = BRK_OPEN;
02474
02475
02476 c->reclose = t1 + (TIMESTAMP)(gl_random_exponential(1/300.0)*TS_SECOND);
02477 gl_debug("house_e:%d circuit breaker %d tripped - enduse %s overload at %.0f A", obj->id, c->id,
02478 c->pLoad->name, current.Mag());
02479 }
02480
02481
02482 else
02483 {
02484 c->status = BRK_FAULT;
02485 c->reclose = TS_NEVER;
02486 gl_warning("house_e:%d circuit breaker %d failed - enduse %s is no longer running", obj->id, c->id, c->pLoad->name);
02487 }
02488
02489
02490 t2 = t1;
02491 }
02492
02493
02494 else
02495 {
02496
02497
02498
02499 if (n==0)
02500 {
02501 load_values[0][2] += c->pLoad->power * 1000.0;
02502 load_values[1][2] += ~(c->pLoad->current * 1000.0 / 240.0);
02503 load_values[2][2] += ~(c->pLoad->admittance * 1000.0 / (240.0 * 240.0));
02504 }
02505 else if (n==1)
02506 {
02507 load_values[0][1] += c->pLoad->power * 1000.0;
02508 load_values[1][1] += ~(c->pLoad->current * 1000.0 / 120.0);
02509 load_values[2][1] += ~(c->pLoad->admittance * 1000.0 / (120.0 * 120.0));
02510 }
02511 else
02512 {
02513 load_values[0][0] += c->pLoad->power * 1000.0;
02514 load_values[1][0] += ~(c->pLoad->current * 1000.0 / 120.0);
02515 load_values[2][0] += ~(c->pLoad->admittance * 1000.0 / (120.0 * 120.0));
02516 }
02517
02518
02519
02520
02521
02522 total.total += c->pLoad->total;
02523 total.power += c->pLoad->power;
02524 total.current += c->pLoad->current;
02525 total.admittance += c->pLoad->admittance;
02526 if((t0 != 0 && t1 > t0) || (!heat_start)){
02527 total.heatgain += c->pLoad->heatgain;
02528 }
02529 c->reclose = TS_NEVER;
02530 }
02531 }
02532
02533
02534 if (t2 > c->reclose)
02535 t2 = c->reclose;
02536 }
02537
02538
02539
02540
02541 total_load = total.total.Mag();
02542
02543
02544 if (obj->parent != NULL)
02545 LOCK_OBJECT(obj->parent);
02546
02547
02548
02549 pPower[0] += load_values[0][0];
02550 pPower[1] += load_values[0][1];
02551 pPower[2] += load_values[0][2];
02552
02553
02554 pLine_I[0] += load_values[1][0];
02555 pLine_I[1] += load_values[1][1];
02556 pLine_I[2] += load_values[1][2];
02557
02558
02559
02560 pShunt[0] += load_values[2][0];
02561 pShunt[1] += load_values[2][1];
02562 pShunt[2] += load_values[2][2];
02563
02564 if (obj->parent != NULL)
02565 UNLOCK_OBJECT(obj->parent);
02566
02567 return t2;
02568 }
02569
02570 TIMESTAMP house_e::sync_enduses(TIMESTAMP t0, TIMESTAMP t1)
02571 {
02572 TIMESTAMP t2 = TS_NEVER;
02573 IMPLICITENDUSE *eu;
02574
02575
02576 for (eu=implicit_enduse_list; eu!=NULL; eu=eu->next)
02577 {
02578 TIMESTAMP t = 0;
02579 t = gl_enduse_sync(&(eu->load),t1);
02580 if (t<t2) t2 = t;
02581 }
02582
02583
02584
02585
02586
02587
02588
02589
02590
02591 return t2;
02592 }
02593
02594 void house_e::check_controls(void)
02595 {
02596 if (warn_control)
02597 {
02598 OBJECT *obj = OBJECTHDR(this);
02599
02600 if (Tair<warn_low_temp || Tair>warn_high_temp)
02601 {
02602 gl_warning("house_e:%d (%s) air temperature excursion (%.1f degF) at %s",
02603 obj->id, obj->name?obj->name:"anonymous", Tair, gl_strftime(obj->clock));
02604 }
02605
02606
02607 if (Tmaterials<warn_low_temp || Tmaterials>warn_high_temp)
02608 {
02609 gl_warning("house_e:%d (%s) mass temperature excursion (%.1f degF) at %s",
02610 obj->id, obj->name?obj->name:"anonymous", Tmaterials, gl_strftime(obj->clock));
02611 }
02612
02613
02614 if ((system_mode==SM_HEAT || system_mode==SM_AUX) && Teq<heating_setpoint)
02615 {
02616 gl_warning("house_e:%d (%s) heating equipement undersized at %s",
02617 obj->id, obj->name?obj->name:"anonymous", gl_strftime(obj->clock));
02618 }
02619
02620
02621 else if (system_mode==SM_COOL &&
02622
02623 (cooling_system_type != CT_NONE) &&
02624 Teq>cooling_setpoint)
02625 {
02626 gl_warning("house_e:%d (%s) cooling equipement undersized at %s",
02627 obj->id, obj->name?obj->name:"anonymous", gl_strftime(obj->clock));
02628 }
02629
02630
02631 if ((dTair>0 && Tevent<Tair) || (dTair<0 && Tevent>Tair))
02632 {
02633 gl_warning("house_e:%d (%s) possible control problem (system_mode %s) -- Tevent-Tair mismatch with dTair (Tevent=%.1f, Tair=%.1f, dTair=%.1f) at %s",
02634 obj->id, obj->name?obj->name:"anonymous", gl_getvalue(obj,"system_mode"), Tevent, Tair, dTair, gl_strftime(obj->clock));
02635 }
02636 }
02637 }
02638
02639 complex *house_e::get_complex(OBJECT *obj, char *name)
02640 {
02641 PROPERTY *p = gl_get_property(obj,name);
02642 if (p==NULL || p->ptype!=PT_complex)
02643 return NULL;
02644 return (complex*)GETADDR(obj,p);
02645 }
02646
02647 bool *house_e::get_bool(OBJECT *obj, char *name)
02648 {
02649 PROPERTY *p = gl_get_property(obj,name);
02650 if (p==NULL || p->ptype!=PT_bool)
02651 return NULL;
02652 return (bool*)GETADDR(obj,p);
02653 }
02655
02657
02658 EXPORT int create_house(OBJECT **obj, OBJECT *parent)
02659 {
02660 *obj = gl_create_object(house_e::oclass);
02661 if (*obj!=NULL)
02662 {
02663 house_e *my = OBJECTDATA(*obj,house_e);;
02664 gl_set_parent(*obj,parent);
02665 my->create();
02666 return 1;
02667 }
02668 return 0;
02669 }
02670
02671 EXPORT int init_house(OBJECT *obj)
02672 {
02673 try {
02674 house_e *my = OBJECTDATA(obj,house_e);
02675 my->init_climate();
02676 return my->init(obj->parent);
02677 }
02678 catch (char *msg)
02679 {
02680 gl_error("house_e:%d (%s) %s", obj->id, obj->name?obj->name:"anonymous", msg);
02681 return 0;
02682 }
02683 }
02684
02685 EXPORT int isa_house(OBJECT *obj, char *classname)
02686 {
02687 if(obj != 0 && classname != 0){
02688 return OBJECTDATA(obj,house_e)->isa(classname);
02689 } else {
02690 return 0;
02691 }
02692 }
02693
02694 EXPORT TIMESTAMP sync_house(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass)
02695 {
02696 house_e *my = OBJECTDATA(obj,house_e);
02697 TIMESTAMP t1 = TS_NEVER;
02698 if (obj->clock <= ROUNDOFF)
02699 obj->clock = t0;
02700
02701 try {
02702 switch (pass)
02703 {
02704 case PC_PRETOPDOWN:
02705 t1 = my->presync(obj->clock, t0);
02706 break;
02707
02708 case PC_BOTTOMUP:
02709 t1 = my->sync(obj->clock, t0);
02710 obj->clock = t0;
02711 break;
02712 case PC_POSTTOPDOWN:
02713 t1 = my->postsync(obj->clock, t0);
02714 obj->clock = t0;
02715 break;
02716 default:
02717 gl_error("house_e::sync- invalid pass configuration");
02718 t1 = TS_INVALID;
02719 }
02720 }
02721 catch (char *msg)
02722 {
02723 gl_error("house_e::sync exception caught: %s", msg);
02724 t1 = TS_INVALID;
02725 }
02726 catch (...)
02727 {
02728 gl_error("house_e::sync exception caught: no info");
02729 t1 = TS_INVALID;
02730 }
02731 return t1;
02732 }
02733
02734 EXPORT TIMESTAMP plc_house(OBJECT *obj, TIMESTAMP t0)
02735 {
02736
02737 if (obj->clock <= ROUNDOFF)
02738 obj->clock = t0;
02739
02740 house_e *my = OBJECTDATA(obj,house_e);
02741 return my->sync_thermostat(obj->clock, t0);
02742 }
02743