Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

restrict codomain of dependent variables, i,e. make them positive always?

Please login with a confirmed email address before reporting spam

Hey everybody,

I have a model with ion concentrations as dependent variables amongst others. When solving my problem, COMSOL makes one of the concentrations negative! But it can only be posititve of course. So, how can I restrict the codomain of my dependent variable, i.e. tell COMSL that making the it negative is not allowed?

All best and thank you very much for your answers,
Sabine

2 Replies Last Post 4 ott 2012, 10:10 GMT-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 3 ott 2012, 12:46 GMT-4
Hi

You can stat by checking the KB (knowledge base) and te Forum, there are many discussions around how to cope with negative concentration, and often why they occure, and how to get around ;)

--
Good luck
Ivar
Hi You can stat by checking the KB (knowledge base) and te Forum, there are many discussions around how to cope with negative concentration, and often why they occure, and how to get around ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 4 ott 2012, 10:10 GMT-4
Dear Ivar,
thank you very much for the answer!
I was indeed not aware of that problem being a rather common problem, and searching specifically for negative *concentrations* did not come into my mind, so I am happy the appearance of them does apparently not necessarily mean that anything is fundamentally wrong with my problem :)
Do you know if the hint Tero gave in the thread you linked (defining a new variable that is set to a little bit over zero every step it is found to be negative if I understand it right), works in the newest version of COMSOL only, or in the old 3.5a one as well? (I do not know what kind of variable I should it define as, and how to tell COMSOL to solve for this instead of for my original dependent variable.. If you say it could work, I will try to figure out how to do it..)
All best,
Sabine
Dear Ivar, thank you very much for the answer! I was indeed not aware of that problem being a rather common problem, and searching specifically for negative *concentrations* did not come into my mind, so I am happy the appearance of them does apparently not necessarily mean that anything is fundamentally wrong with my problem :) Do you know if the hint Tero gave in the thread you linked (defining a new variable that is set to a little bit over zero every step it is found to be negative if I understand it right), works in the newest version of COMSOL only, or in the old 3.5a one as well? (I do not know what kind of variable I should it define as, and how to tell COMSOL to solve for this instead of for my original dependent variable.. If you say it could work, I will try to figure out how to do it..) All best, Sabine

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.