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 set the Gauss charge distribution in the "space charge density" item?

Please login with a confirmed email address before reporting spam

Dear all,

I am a freshman here. I want to simulate the potential map of a simple capacitor with a Gauss charge distribution. The model is simple but I do not know how to define the charge distribution such as -10e6*exp(-x^2/25)C/cm3. I can only set a fixed value in the "space charge density". When I try to write a Gauss expression with the variable "x", it always says "unexpected unit".

What can I do?

4 Replies Last Post Jun 19, 2012, 2:53 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 18, 2012, 5:35 a.m. EDT
Seeing as how Comsol does not complain about your use of the variable "x" (in other words, it works as expected), you should do what Comsol tells you to: fix the unit. It's probably a simple syntax issue.
Seeing as how Comsol does not complain about your use of the variable "x" (in other words, it works as expected), you should do what Comsol tells you to: fix the unit. It's probably a simple syntax issue.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 18, 2012, 9:38 p.m. EDT

Seeing as how Comsol does not complain about your use of the variable "x" (in other words, it works as expected), you should do what Comsol tells you to: fix the unit. It's probably a simple syntax issue.


Thank you very much for your quick reply.
But I can not set the unit since the default unit of charge is C/cm3 and fixed by COMSOL.

Pls see the attached image. I highlight the problem shown.

PS. It is a 2D modle and left and right parts are electrodes. The dielectric is in the middle.
[QUOTE] Seeing as how Comsol does not complain about your use of the variable "x" (in other words, it works as expected), you should do what Comsol tells you to: fix the unit. It's probably a simple syntax issue. [/QUOTE] Thank you very much for your quick reply. But I can not set the unit since the default unit of charge is C/cm3 and fixed by COMSOL. Pls see the attached image. I highlight the problem shown. PS. It is a 2D modle and left and right parts are electrodes. The dielectric is in the middle.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 19, 2012, 2:22 a.m. EDT
You can override the unit. Just insert "[C/cm^3]" behind the "10^6" factor or at the end of the expression. Only if you don't specify a unit, the default unit displayed in the right margin is used.

However, as you can tell from this explanation, the unit of the pre-exponential factor is not the issue here. Rather, you're dividing x^2 (which has unit m²) by something unitless in the exponential, so your overall unit is exp(m²), which is what throws Comsol. Instead of dividing by 25, you should divide by something like "(5[m])^2" to get the units right.

Other than that, it's usually safe to ignore the unit warnings, if you know what you're doing. After all, the solver just deals with numbers.
You can override the unit. Just insert "[C/cm^3]" behind the "10^6" factor or at the end of the expression. Only if you don't specify a unit, the default unit displayed in the right margin is used. However, as you can tell from this explanation, the unit of the pre-exponential factor is not the issue here. Rather, you're dividing x^2 (which has unit m²) by something unitless in the exponential, so your overall unit is exp(m²), which is what throws Comsol. Instead of dividing by 25, you should divide by something like "(5[m])^2" to get the units right. Other than that, it's usually safe to ignore the unit warnings, if you know what you're doing. After all, the solver just deals with numbers.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 19, 2012, 2:53 a.m. EDT
Yeah!

I get it. Thank you very very much.
Yeah! I get it. Thank you very very much.

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.