Modelling a stratified thermal water storage tank
Show older comments
I'm currently learning to use Matlab and I'm trying to write a code to simulate a stratified hot water storage tank. The tan is divided into N nodes and the equations below represent the energy balance at each node. I would like to carry out the simulation over 24 hours, with time varying for t=1 to t=24.
1.F_i^c={█(1 if i=1 and T_co>T_(s,i)@1 if T_(s,i-1)>T_co>T_(s,i)@0 if i=0 or i=N+1 @0 if otherwise)┤
2.F_i^L={█(1 if i=N and T_Lr<T_(s,N)@1 if T_(s,i)≥T_Lr>T_(s,i)@0 if i=0 or i=N+1@0 if otherwise)┤ 3.m ̇_(m,1)=0 4.m ̇_(m,i)=(m_c ) ̇∑_(j=1)^(i-1)▒F_j^c -(m_L ) ̇∑_(j=i+1)^N▒F_j^L 5.m ̇_(m,N+1)=0
6.m ̇_i (dT_(s,i))/dt=(UA/C_p )_i (〖T^'〗_a-T_(s,i) )+F_i^c (m_c ) ̇(T_co-T_(s,i) )+F_i^L m ̇_L (T_(L,r)-T_(s,i) ) +{█(m ̇_(m,i) (T_(s,i-1)-T_(s,i) ) if m ̇_(m,i)>0@m ̇_(m,i+1) (T_(s,i)-T_(s,i+1) ) if m ̇_(m,i+1)<0)┤
Answers (0)
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!