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

Please login with a confirmed email address before reporting spam

Hello,

I'm trying to define Youngs Modulus of a Material as a Piecewise function of Temperature.

Here is what I want to have:

for 273<T<473 E = E0

for 473 < T < inf E = kx + b

I'm trying to define Variables first, E for example, but the programs keeps making this variable orange.

How do I define a piecewise function, how does it work?

Thx in advance.

4 Replies Last Post May 26, 2012, 6:26 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 May 25, 2012, 2:27 p.m. EDT
Hi

orange means unit (errors or misunderstandings) but are only warnings, you can still calculate and get good results if your values make sens, it's only that COMSOL cannot check the unit coherence, hence cannot adapt anything if not compliant with the COMSOL default units

A RED cell is a typo and this will not solve/calculate

probybly you should write something like:

273<T[1/K]<473

E = k[Pa/m]*x + b[Pa]


--
Good luck
Ivar
Hi orange means unit (errors or misunderstandings) but are only warnings, you can still calculate and get good results if your values make sens, it's only that COMSOL cannot check the unit coherence, hence cannot adapt anything if not compliant with the COMSOL default units A RED cell is a typo and this will not solve/calculate probybly you should write something like: 273

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago May 25, 2012, 8:02 p.m. EDT
I've tryed it, but there are some errors still. I've attached a jpg file to show, how I've done it. the syntax is definitly wrong, but I dont rly know how to do it right. I would be grateful for a little hint!

Thx in Advance!
I've tryed it, but there are some errors still. I've attached a jpg file to show, how I've done it. the syntax is definitly wrong, but I dont rly know how to do it right. I would be grateful for a little hint! Thx in Advance!


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 May 26, 2012, 4:39 a.m. EDT
Hi

I believe its the T= and E= that are not accepted

check the doc and the model library for a model having one of these functions

normally its the min value (number or parameter equation to calculate it, then the same for the max value and finally the equation, including the T, if T is the argument, but no = the response comes in the function name so you call it from any GUI field entry

pw1(T[1/K])

--
Good luck
Ivar
Hi I believe its the T= and E= that are not accepted check the doc and the model library for a model having one of these functions normally its the min value (number or parameter equation to calculate it, then the same for the max value and finally the equation, including the T, if T is the argument, but no = the response comes in the function name so you call it from any GUI field entry pw1(T[1/K]) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago May 26, 2012, 6:26 a.m. EDT
Thank you Ivar, that really helped!
Thank you Ivar, that really helped!

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.