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
Posted 22 mai 2015, 05:23 UTC−4 Heat Transfer & Phase Change, Materials, Results & Visualization Version 5.0 8 Replies
Please login with a confirmed email address before reporting spam
I have made a piecewise function
start end function
0 0.125 1
0.125 1 0
1 1.125 1
1.125 2 0
.........and so on.
It means, every second, only 1/8s there is a high temperature and 7/8s there is only room temperature.
but after the study I have seen that the high temperature exists only at the first 0-0.125s, and after that it has only room temperature. So maybe someone can tell me how may I optimize it. Thank you.
Please login with a confirmed email address before reporting spam
Lasse
Please login with a confirmed email address before reporting spam
Probably your time stepping does not coincide with the stepwise function.
Lasse
Hi Lasse,
Thanks for you answer. But I still have a question. How to understand that the time not coincide with the stepwise function? Because at first period, the result at 0 to 0.125s is correctly 1, but after that, the result of function is always 0. I'm sure that the stepwise function is correct, because I have also seen the waveform, every second it has a high value.
Please login with a confirmed email address before reporting spam
Lasse
Please login with a confirmed email address before reporting spam
I mean that when the solver takes time steps, it may jump over your pulse. I had this problem a few years ago, when I had a very short pulse every hour. I had to define solver time stepping explicitly so that the solver was able to "see" the pulses.
Lasse
Thanks Lasse. I have upload some pictures about the waveform, the temperature, temperature distribution at 0.1s, at 1.1s. So the problem is the temperature at 1.1s.
Attachments:
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
Your step is 0.1 s but the step 0.125 s. I wonder if that is enough. Have you tried "range(0,0.0625,30)?"
I do not remember any more how I did my model, it was Comsol version 3.5 and the year was 2009.
Please login with a confirmed email address before reporting spam
You have yellow color in the temperature definition. Check the units in the function definition: argument in seconds, function in K.
Your step is 0.1 s but the step 0.125 s. I wonder if that is enough. Have you tried "range(0,0.0625,30)?"
I do not remember any more how I did my model, it was Comsol version 3.5 and the year was 2009.
I have input the argument in seconds and function in K, and change the step rage(0,0.0625,30). But the definition of temperature is still in yellow and the results are nearly the same. there is no high temperature after 1sec.
Please login with a confirmed email address before reporting spam
Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.
Suggested Content
- FORUM Piecewise function
- BLOG Efficiently Assign Materials in Your COMSOL Multiphysics® Model
- FORUM Piecewise function
- FORUM defining a piecewise function
- KNOWLEDGE BASE Undefined Function Call
