Hello!
In the loop while I would like to store the values of each loop, and plot it with the corresponding iteration t.
m_cafe=0.2; %kg
m_cream=0.05; %kgCp_water=4179,6;T_cafe=5+273.15; %K
T_cream=90+273.15;m_mix=m_cafe+m_cream;Tm=(m_cafe*Cp_water*T_cafe+m_cream*Cp_water*T_cream)/(m_mix);U=20; %W/m2.K
Tamb=20+273.15; %Kd=0.05; %m
r=d/2; %mVol_cafe=m_cafe*0.001 % 1 kg=1 liter= 0.001m3
Vol_mix=m_mix*0.001 %
h_cafe=Vol_cafe/(3.14*r^2)h_mix=Vol_mix/(3.14*r^2)Air_cafe=3.14*d*h_cafeAir_mix=3.14*d*h_mixstep=0.5;e=1t=0while e>=0.01y=(Tm-Tamb)*exp(((-Air_mix*U)/(m_mix*Cp_water))*t)+Tamb;Temp(t)=y;e=abs(Temp-Tamb);t=t+stependplot (t,Temp,'r')
Best Answer