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.

How to limit the variable to be positive when solving

Please login with a confirmed email address before reporting spam

Nowadays I use COMSOL to solve Poisson equation (electrostatics) coupled with two drift-diffusion equations (Transport of diluted species) for some semiconductor device problem. During the solving process, I found that the concentrations of chds can be negative, which is not physical. Although finally it will converge to a right answer, I need to evaluate the log function of concentration during the solution so I want the concentration always be positive.

Therefore I would like to know whether there is a way to limit the range of the variables (to be positive) during solution.

Thanks

4 Replies Last Post 2012年3月7日 GMT-5 04:47

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年3月6日 GMT-5 14:07
Does negative concentration in your case means that you have more charges of the opposite sign? Then it wouldn't be very physical to limit it to only positive values.

In general, if you are sure that you are getting some unphysical values, then you equations are probably wrong somewhere.
Does negative concentration in your case means that you have more charges of the opposite sign? Then it wouldn't be very physical to limit it to only positive values. In general, if you are sure that you are getting some unphysical values, then you equations are probably wrong somewhere.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年3月6日 GMT-5 16:36
Thanks for your answer.

I agree that I might come up with some physical meaning of the negative concentration during solution. However, since I use two chds module for both electrons and holes, at least I didn't expect the negative concentration in the final result.

I just curious that is there way to put constraints on variables?
Thanks for your answer. I agree that I might come up with some physical meaning of the negative concentration during solution. However, since I use two chds module for both electrons and holes, at least I didn't expect the negative concentration in the final result. I just curious that is there way to put constraints on variables?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年3月6日 GMT-5 21:06
to constrain a variable to positive-only, just use abs() operator. But if the negative number comes out of the solution of your equations, then it's negative because your equations say so. You can't change the result until you change equations.
to constrain a variable to positive-only, just use abs() operator. But if the negative number comes out of the solution of your equations, then it's negative because your equations say so. You can't change the result until you change equations.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年3月7日 GMT-5 04:47
Hi,

For complex problems, the uniqueness of solution is difficult to guarantee. In my opinion, the solution from COMSOL is partially determined by how the discrete equation system is assembled. Thus it's also reasonable to have non-physical solution from CMOSOL. When you impose some additional constraint, it starts to give some different solution.
Hi, For complex problems, the uniqueness of solution is difficult to guarantee. In my opinion, the solution from COMSOL is partially determined by how the discrete equation system is assembled. Thus it's also reasonable to have non-physical solution from CMOSOL. When you impose some additional constraint, it starts to give some different solution.

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.