Temperature variation against time
Ältere Kommentare anzeigen
Hi,
I'm trying to model how the temperature changes with time of the day however I'm having difficulties since the result is not what I expect. Below is the code. Basically I want the mass of the product to decrease by 6.5 kg after every hour and I expect the temperature to increase, peak and then decrease. What am I doing wrong ? I'm pretty bad at Matlab
m = 150; % Mass of product to dry (Kg)
me = 78; % Mass of water to dry from the product(Kg)
mw = 6.5; % Mass of water loss in hr(Kg)
lw = 2260000; % Latent heat of vaporisation of water (J/Kg)
A = 1; % Surface Area of Collector (m^2)
cp= 3746; %Specific heat capacity of product (J/Kg/C)
t = 1; % Time step
T(1) = 24; % Initial Temperature (°C)
Time2=(1:t:12); hours
QQ2=960*(sin(2*pi*Time2/24)).^2; % Solar irradiation in tropical regions at specific time (W/m2)
for j = (1:t:11)
T(j+1)= ((((QQ2(j)*A*3600))-(mw*lw))/(m*cp))+T(j);
m = m-mw ;
end
figure(2)
plot(T)
title('Temperature')
xlabel('time (hours)')
ylabel('Temperature (°C)')
Antworten (1)
Bruno Luong
am 4 Nov. 2018
Bearbeitet: Bruno Luong
am 4 Nov. 2018
Your expectation is wrong
(((QQ2(j)*A*3600))-(mw*lw))
are negative (from -1.4458e+07 to -1.1234e+7)
Therefore as long as the mass m is positive
((((QQ2(j)*A*3600))-(mw*lw))/(m*cp))
is negative. Since every iteration you perform
T(j+1) = T(j) + something negative
T must decrease regardless how you change the mass m.
When you expect something try to explain clearly step by step. By doing so you might find by yourself the mistake.
Kategorien
Mehr zu General Applications finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!