| 316 | } |
| 317 | } |
| 318 | void SimModel::solarRadiationBreakdown(const Vector& weekdayOccupiedMegaseconds, const Vector& weekdayUnoccupiedMegaseconds, |
| 319 | const Vector& weekendOccupiedMegaseconds, const Vector& weekendUnoccupiedMegaseconds, |
| 320 | const Vector& clockHourOccupied, const Vector& clockHourUnoccupied, Vector& v_hrs_sun_down_mo, |
| 321 | Vector& frac_Pgh_wk_nt, Vector& frac_Pgh_wke_day, Vector& frac_Pgh_wke_nt, Vector& v_Tdbt_nt) const { |
| 322 | |
| 323 | Matrix m_mhEgh = location->weather()->mhEgh(); |
| 324 | Matrix m_mhdbt = location->weather()->mhdbt(); |
| 325 | |
| 326 | // TODO: unreadVariable |
| 327 | // Vector v_Tdbt_Day = prod(m_mhdbt, clockHourOccupied); |
| 328 | // v_Tdbt_Day /= sum(clockHourOccupied); |
| 329 | |
| 330 | v_Tdbt_nt = prod(m_mhdbt, clockHourUnoccupied); |
| 331 | v_Tdbt_nt /= sum(clockHourUnoccupied); |
| 332 | |
| 333 | Vector v_Egh_day = prod(m_mhEgh, clockHourOccupied); |
| 334 | v_Egh_day /= sum(clockHourOccupied); |
| 335 | |
| 336 | Vector v_Egh_nt = prod(m_mhEgh, clockHourUnoccupied); |
| 337 | v_Egh_nt /= sum(clockHourUnoccupied); |
| 338 | /** |
| 339 | v_mdbt=W.mdbt; % copy to a new variable so vector nature is clear |
| 340 | M_mhdbt=W.mhdbt; % copy to a new variable so matrix nature is clear |
| 341 | M_mhEgh=W.mhEgh; % copy to a new variable so matrix nature is clear |
| 342 | |
| 343 | % Note, these are matrix multiplies (matrix*vector) resulting in a vector |
| 344 | v_Tdbt_day=(M_mhdbt*v_day_hrs_yesno)./sum(v_day_hrs_yesno); %monthly average dry bulb temp (dbt) during the occupied hours of days |
| 345 | v_Tdbt_nt=(M_mhdbt*v_nt_hrs_yesno)./sum(v_nt_hrs_yesno); %monthly avg dbt during the unoccupied hours of days |
| 346 | |
| 347 | v_Egh_day=(M_mhEgh*v_day_hrs_yesno)./sum(v_day_hrs_yesno); %monthly avg global horiz rad power (Egh) during the "day" hours |
| 348 | v_Egh_nt=(M_mhEgh*v_nt_hrs_yesno)./sum(v_nt_hrs_yesno); %monthly avg Egh during the "night" hours |
| 349 | */ |
| 350 | |
| 351 | Vector v_Wgh_wk_day = mult(v_Egh_day, weekdayOccupiedMegaseconds); |
| 352 | Vector v_Wgh_wk_nt = mult(v_Egh_nt, weekdayUnoccupiedMegaseconds); |
| 353 | Vector v_Wgh_wke_day = mult(v_Egh_day, weekendOccupiedMegaseconds); |
| 354 | Vector v_Wgh_wke_nt = mult(v_Egh_nt, weekendUnoccupiedMegaseconds); |
| 355 | Vector v_Wgh_tot = sum(sum(v_Wgh_wk_day, v_Wgh_wk_nt), sum(v_Wgh_wke_day, v_Wgh_wke_nt)); |
| 356 | /** |
| 357 | v_Wgh_wk_day=v_Egh_day.*v_Msec_wk_day; % monthly avg Egh energy (Wgh) during the week days |
| 358 | v_Wgh_wk_nt=v_Egh_nt.*v_Msec_wk_nt; %monthly avg Wgh during week nights |
| 359 | v_Wgh_wke_day=v_Egh_day.*v_Msec_wke_day; %monthly avg Wgh during weekend days |
| 360 | v_Wgh_wke_nt=v_Egh_nt.*v_Msec_wke_nt; %monthly avg Wgh during weekend nights |
| 361 | v_Wgh_tot=v_Wgh_wk_day+v_Wgh_wk_nt+v_Wgh_wke_day+v_Wgh_wke_nt; %Egh_avg_total MJ/m2 |
| 362 | */ |
| 363 | frac_Pgh_wk_nt = div(v_Wgh_wk_nt, v_Wgh_tot); |
| 364 | frac_Pgh_wke_day = div(v_Wgh_wke_day, v_Wgh_tot); |
| 365 | frac_Pgh_wke_nt = div(v_Wgh_wke_nt, v_Wgh_tot); |
| 366 | /** |
| 367 | |
| 368 | %FRAC_PGH_DAYTIME=v_Wgh_wk_day./v_Wgh_tot; %frac_Egh_occ |
| 369 | frac_Pgh_wk_nt=v_Wgh_wk_nt./v_Wgh_tot; %frac_Egh_unocc_weekday_night |
| 370 | frac_Pgh_wke_day=v_Wgh_wke_day./v_Wgh_tot; %frac_Egh_unocc_weekend_day |
| 371 | frac_Pgh_wke_nt=v_Wgh_wke_nt./v_Wgh_tot; %frac_Egh_unocc_weekend_night |
| 372 | */ |
| 373 | Vector v_frac_hrs_sun_down = Vector(12); |
| 374 | Vector v_frac_hrs_sun_up = Vector(12); |
| 375 | // TODO: unreadVariable |