Using ODE45 to solve 2 dependent variable : dQ (solar radiation at specific time of the day(hour)) and dT/dt (temperature change of a particle ) of a particle during solar drying
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I am trying to use differential equation to solve how temperature changes with respect to time however the temperature is dependent on the solar radiation per unit area Q
so the formula for Q is given as:
Time2=(1:t:12); %hours
Q=960*(sin(2*pi*Time2/24)).^2; %W/m2
The equation for the temperature change is :
dT/dt = ((Q*A)-(mw*lw))/(m*cp));
where
T0 = 373.15; %Initial temperature in Kelvin
mw = 0.706;
m = 15; % Mass of product to dry (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/K)
so at every time step (which is in hours ), I want the equation dT/dt to use the value of Q at that time to solve dT/dt
I tried this
deltaT =@(t,T)((Q*A)-(mw*lw))/(m*cp);
[t,T] = ode45('deltaT',tspan,T0);
where
tspan = [1 12] %hours
however I am getting so many errors
Any help will be appreciated, I am fairly new to MATLAB
0 comentarios
Respuestas (1)
Torsten
el 5 de Nov. de 2018
function main
T0 = 373.15; %Initial temperature in Kelvin
tspan = [1 12]; %hours
dt = 0.1;
Time2 = (1:dt:12); %hours
Q = 960*(sin(2*pi*Time2/24)).^2; %W/m2
[t,T] = ode45(@(t,T)deltaT(t,T,Time2,Q),tspan,T0);
plot(t,T)
end
function dT = deltaT(t,T,Time2,Q)
Q_actual = interp1(Time2,Q,t);
mw = 0.706;
m = 15; % Mass of product to dry (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/K)
dT = ((Q_actual*A)-(mw*lw))/(m*cp);
end
4 comentarios
Torsten
el 8 de Nov. de 2018
Your equation reads (with the values you gave inserted):
(15*3746 + m_Water(t)*cp_Water)*dT/dt = -0.706/3600*2260000 + 960*sin^2(2*pi*t/(24*3600))*A(t)
with t in seconds.
Solving this will give you more realistic temperature profiles.
So the error was primary related to the unit conversion.
Nevertheless, you should take into account the time-dependent mass of water you have to heat up in the m_Water(t)*cp_Water - term and the decreasing surface area over time in the A(t)-term.
Best wishes
Torsten.
Ver también
Categorías
Más información sobre Power Converters en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!