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.

Cyclic Input Temperature BC

Please login with a confirmed email address before reporting spam

Hi

Would anyone help in defining an expression for a cyclic BC-as attached in the figure. Also, in another figure I tried to step up/down but cannot get vertical lines shown, instead only one dot is appeared.

Any help will be appreciated.
Thanks
Naveed


6 Replies Last Post Apr 14, 2010, 2:36 a.m. EDT
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 13, 2010, 7:17 a.m. EDT
Hi

for me I see two ways, either define a function and add the series as a file (see the COMSOl doc) or write it straight out:

T = 20[degC] + (800-20) * ( t/3*(t<=3) + (t>3)*(t<=7) - (t-7)/(10-7)*(t>7)*(t<=10) + ... )

The units on the first value are important to fix the absolute Celcius scale.

if your sequence goes on, you should replace all the "t" by "mod(t,per)" with the periode define as per=14[s] I asume

Hope this helps
Good luck
Ivar

Corrections
I was too quick there, I lost a "1-"

Better to try:

T = 20[degC] + (800-20) * ( t/3*(t<=3) + (t>3)*(t<=7) + (1 - (t-7)/(10-7))*(t>7)*(t<=10))

or for a periodic one:

T = 20[degC] + (800-20) * (mod(t,14)/3*(mod(t,14)<=3) + (mod(t,14)>3)*(mod(t,14)<=7) + (1 - (mod(t,14)-7)/(10-7))*(mod(t,14)>7)*(mod(t,14)<=10))

By the way if you make a function of this one, the units [degC] are not accepted in V3.5a, so you need to add it by hand, assuming Kelvins for T. Simply by replaceing 20[degC] by (20+293.15)

Hi for me I see two ways, either define a function and add the series as a file (see the COMSOl doc) or write it straight out: T = 20[degC] + (800-20) * ( t/3*(t3)*(t7)*(t

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 13, 2010, 7:42 a.m. EDT
Hi Ivar

Thanks for your help. Actually it works fine until 7 sec and then the curve disconnects and restrated from zero going down, as shown in attachment.

Also (as in my previous 2nd attachment), is there any way to show the vertical lines (instead of one central dot) when using a step. The use of smooth function does not give vertical lines.


Thanks for your support.
Regards
Hi Ivar Thanks for your help. Actually it works fine until 7 sec and then the curve disconnects and restrated from zero going down, as shown in attachment. Also (as in my previous 2nd attachment), is there any way to show the vertical lines (instead of one central dot) when using a step. The use of smooth function does not give vertical lines. Thanks for your support. Regards


Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 13, 2010, 9:48 a.m. EDT
Hi

you are right I didnt check my equation ! One should always, and I'm saying that ;)
should have seen that one, but you should easily fix that no ?

Are you plotting in COMSOl or matlab ?, because in Comsol you can put the units to [degC] and I beleive in the settings of your plots you can choose lines or markers, or both, it should be somewhere in the options on the plot parametr window

Goo luck
Ivar


Hi you are right I didnt check my equation ! One should always, and I'm saying that ;) should have seen that one, but you should easily fix that no ? Are you plotting in COMSOl or matlab ?, because in Comsol you can put the units to [degC] and I beleive in the settings of your plots you can choose lines or markers, or both, it should be somewhere in the options on the plot parametr window Goo luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 13, 2010, 4:45 p.m. EDT
Hi Ivar

Thanks for your help. I am plotting the curve in COMSOL, however I cannot get through the last segment of the first cycle, i.e. from t=7-10, T should be T=800-20, which I can't get.

Could you please again have a little look of the expression, what needs to be altered?

thanks
Naveed
Hi Ivar Thanks for your help. I am plotting the curve in COMSOL, however I cannot get through the last segment of the first cycle, i.e. from t=7-10, T should be T=800-20, which I can't get. Could you please again have a little look of the expression, what needs to be altered? thanks Naveed

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 14, 2010, 1:45 a.m. EDT
Hi

I have corrected my formula above (and tested it in COMSOL this time;)

Have fun Comsoling
Ivar
Hi I have corrected my formula above (and tested it in COMSOL this time;) Have fun Comsoling Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 14, 2010, 2:36 a.m. EDT
Hi Ivar

Many thanks! Indeed very helpful and functional this time!

Regards
Naveed
Hi Ivar Many thanks! Indeed very helpful and functional this time! Regards Naveed

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.