Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
piecewise function using mod( ) failed.
Posted 9 sept. 2016, 05:10 UTC−4 1 Reply
Please login with a confirmed email address before reporting spam
Hi,
I am getting trouble with the piecewise function.
I am using Comsol to simulate heat storage in soil. The soil is heated by 70degC for 4 hours everyday and the rest 20 hours no heating. I want to simulate 10 days.
So I define the function T_in as :
if(mod(t,24)<=4,70,T)
in which, t is time in [h], T and Tjin is temperature in [degC]. And T is the temperature of the surrounding soil.
And I define the study time period as:
range(0,1,240)
which is in [h].
However, the result shows that only during 0-4[h] the soil is heated. During 24-28[h], which is the second day, the soil is not heated any more.
So the function failed. Why? I am confused and hoping for your help.
Thanks!
Ren
I am getting trouble with the piecewise function.
I am using Comsol to simulate heat storage in soil. The soil is heated by 70degC for 4 hours everyday and the rest 20 hours no heating. I want to simulate 10 days.
So I define the function T_in as :
if(mod(t,24)<=4,70,T)
in which, t is time in [h], T and Tjin is temperature in [degC]. And T is the temperature of the surrounding soil.
And I define the study time period as:
range(0,1,240)
which is in [h].
However, the result shows that only during 0-4[h] the soil is heated. During 24-28[h], which is the second day, the soil is not heated any more.
So the function failed. Why? I am confused and hoping for your help.
Thanks!
Ren
1 Reply Last Post 9 sept. 2016, 08:00 UTC−4