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 14 avr. 2010, 02:36 UTC−4
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 13 avr. 2010, 07:17 UTC−4
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 13 avr. 2010, 07:42 UTC−4
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 13 avr. 2010, 09:48 UTC−4
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 13 avr. 2010, 16:45 UTC−4
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 14 avr. 2010, 01:45 UTC−4
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 14 avr. 2010, 02:36 UTC−4
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.