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.

Complex Conditionals?

Please login with a confirmed email address before reporting spam

I'd like to change some material properties mid-simulation, and I feel the best way to do this is through conditional statements that depend on time.


Is there a way to add a complex conditional statement, for example:

(if t>some number AND temp at some time was > some number)

Basically can I use the temperature of an element at certain times during the simulation in conditional statements?

2 Replies Last Post Feb 1, 2016, 1:10 p.m. EST
Walter Frei COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 years ago Jan 26, 2016, 1:10 p.m. EST
Dear Richard,

You may find this article helpful:
www.comsol.com/blogs/tracking-material-damage-with-the-previous-solution-operator/

Best Regards,
Dear Richard, You may find this article helpful: http://www.comsol.com/blogs/tracking-material-damage-with-the-previous-solution-operator/ Best Regards,

Please login with a confirmed email address before reporting spam

Posted: 9 years ago Feb 1, 2016, 1:10 p.m. EST
Thanks Walter, I reviewed your link and I think this is what I need. I have some further questions.

I am wondering two things.

1. The previous solution and ODE&DAE features can be used to change parameters based on values from previous time step. In the example given, the emissivity was changed from E_undamaged to E_damaged if the temperature exceeded 60 degC. My question is can a material property, such as thermal conductivity, be changed from a function of temperature, to a different function of temperature? (These functions are interpreted from data but could be changed to analytical if necessary)

2. To change the emmisivity, logical statements were used:

the source term read...

emissivity-nojac(if(T>60[degC],E_damaged,emissivit​y))

which means if the temperature of an element exceeds 60C then emissivity should become E_damaged. I am wondering if I could include the elapsed time and the position of the elements in this logical statement. It would be something like if an element who's X-position is less than or equal to some function of time, AND the element's Y position is greater than equal to some constant, AND the temperature of that element is over 60C, then change some properties of the element.

Thanks a lot!
Thanks Walter, I reviewed your link and I think this is what I need. I have some further questions. I am wondering two things. 1. The previous solution and ODE&DAE features can be used to change parameters based on values from previous time step. In the example given, the emissivity was changed from E_undamaged to E_damaged if the temperature exceeded 60 degC. My question is can a material property, such as thermal conductivity, be changed from a function of temperature, to a different function of temperature? (These functions are interpreted from data but could be changed to analytical if necessary) 2. To change the emmisivity, logical statements were used: the source term read... emissivity-nojac(if(T>60[degC],E_damaged,emissivit​y)) which means if the temperature of an element exceeds 60C then emissivity should become E_damaged. I am wondering if I could include the elapsed time and the position of the elements in this logical statement. It would be something like if an element who's X-position is less than or equal to some function of time, AND the element's Y position is greater than equal to some constant, AND the temperature of that element is over 60C, then change some properties of the element. Thanks a lot!

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.