I am calculation Cooling Loads.
I need to find Total Cooling Load (Qtotal)
Total Cooling Load is technically the sum of my first floor (QF1), second floor (QF2), sensible heat gain by infiltration (Qis) and latent heat gain by infiltration (Qil).
So,
Qtotal = QF1+QF2+Qis+Qil;
But due to hours of occupation,
QF1 is a 1:12 matrix
QF2 is a 1:8 matrix
Qis and Qil are both 1:24 matrix
ANy help on how i can go about calculating this. Thanks.

1 Commento

Adam Danz
Adam Danz il 2 Ott 2019
Modificato: Adam Danz il 2 Ott 2019
The 'hours of occupation' comment leads me to believe that each vector contains samples of a measurment across time but those time stamps aren't aligned. If that's the case, hopefully you have the timestamps for each vector in which case you can interpolate using interp1(). If the sampling rates are fixed but unequal between vectors, you could also look into resample(). Ultimately, it might be beneficial to organize the data into a timetable with 1 column of timstamps and the other columns would contain your measurements.

Accedi per commentare.

 Risposta accettata

Star Strider
Star Strider il 2 Ott 2019

0 voti

I would creat all the vectors initially as zeros(1,24), then fill in the elements corresponding to the hours of occupation in QF1 and QF2. Then, all the matrices align and the addition proceeds.

6 Commenti

this is what i think is the best course of action. i am just unsure about how to proceed.
Anthony Hudaverdi
Anthony Hudaverdi il 2 Ott 2019
Modificato: Anthony Hudaverdi il 2 Ott 2019
% ZONE COOLING LOAD (Actual)
QZ1 = zeros(1,24);
QZ2 = zeros(1,24);
QZ3 = zeros(1,24);
QZ4 = zeros(1,24);
QZ5 = zeros(1,24);
QZ6 = zeros(1,24);
QZ7 = zeros(1,24);
QR = zeros(1,24);
QZ1 = Qz1(1,8:20);
QZ2 = Qz2(1,8:20);
QZ3 = Qz3(1,8:18);
QZ4 = Qz4(1,8:18);
QZ5 = Qz5(1,8:18);
QZ6 = Qz6(1,8:18);
QZ7 = Qz7(1,8:18);
QR = Q_R(1,8:18);
% FLOOR COOLING LOAD
QF1 = QZ1+QZ2;
QF2 = QZ3+QZ4+QZ5+QZ6+QZ7+QR;
% TOTAL COOLING LOAD
Qtotal = QF1+QF2+Qis+Qil;
but i stil get matrix dimensions must agree.
Correct idea, slightly in error as to the addressing.
Try this:
QZ1 = zeros(1,24); % Preallocate
. . .
Qz1 = rand(1,13); % Create Test Data
. . .
QZ1(8:20) = Qz1 % Assign
The preallocation is the correct approach. You then need to index the destination vector (‘QZ1’ in this example) with the values of ‘Qz1’ (and the others as appropriate). I am not quite certain what ‘Qz1’ and the others look like, however if they are similar in structure to my test vectors, this should work.
It did exactly what i needed. Thank you very much!
As always, my pleasure!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Particle & Nuclear Physics in Centro assistenza e File Exchange

Prodotti

Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by