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.
Time Step Function
Posted 9 mar 2016, 09:32 GMT-5 Heat Transfer & Phase Change, Parameters, Variables, & Functions Version 5.2 7 Replies
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
Best,
Jeff
Edit: I am not sure if that feature already existed in version 4.3. If not, you can get something similar by taking the product of two smoothed Heaviside step functions, etc.
Please login with a confirmed email address before reporting spam
But how do I make it start when the temperature reaches the desired value? I can definitely define a rectangular step function as a function of time. But I need the temperature condition.
Paul
Please login with a confirmed email address before reporting spam
Instead you can use the concept of Events. See this link: www.comsol.com/blogs/implementing-a-thermostat-with-the-events-interface/
Best,
Jeff
Please login with a confirmed email address before reporting spam
Thanks for the help. I was thinking about events. But an event would give me a temperature dependence and that's all. I can have for example an event that has 0 until the temperature is reached. Then 1 when the temperature is reached. How do I make it back to 0 after a certain time?
Is it me, or I didn't see this information in the thread you have just provided (I know it from before)? And can I also implement time conditions in the events?
Paul
Please login with a confirmed email address before reporting spam
You can indeed expand upon the approach outlined here:
www.comsol.com/blogs/implementing-a-thermostat-with-the-events-interface/
and modify as demonstrated in the attached file.
Note these features:
- An additional ODE for a variable "HeaterOnTime" that simply integrates "1" over time, thereby keeping track of time since any event at which HeaterOnTime is set to zero.
- An indicator state variable called "On_Time" that goes from negative to positive after a specified time.
- Implicit Event 1, that triggers when the temperature gets too low, and sets HeaterOnTime = 0
- Implicit event 2, that triggers based in the On_Time > 0 which turns off the heater.
Hopefully this is all fairly self-explanatory from here on. Please note that this file is created in version 5.2.
Best Regards,
Attachments:
Please login with a confirmed email address before reporting spam
Thank you very much! I don't have 5.2, but I will install it for this and I will write back if I encounter any problems.
Best Regards,
Paul
Please login with a confirmed email address before reporting spam
Thank you very much. It works as it should.
Paul
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.
