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.

General integration operator?

Please login with a confirmed email address before reporting spam

I am looking to take an input variable, n, and do an integration function, but NOT an integration over volume/area/boundary. Specifically I am looking to solve the Fermi-Dirac integral and use the output as another variable. The mathematica equivalent would look something like:

Integrate( f(n), n, {0, Infinity})

and it would really be easier to have this calculated within comsol so that I don't have to do it in another program any time I input a new value somewhere.

5 Replies Last Post 30 mars 2016, 16:35 UTC−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 9 mai 2012, 15:01 UTC−4
Hi

interesting question, even if I'm not sure I have fully catched your demand, there ;)
From my understanding COMSOL is only set up to integrate overa discretized coordinate(s) via a mesh structure, or to integrate "time".
So either you have a way to map (Definition Model Coupling or Mapping) your variable onto another single dimension that you discretize and integrate, but still "INF" is a bit far fetched, I suppose you will have to remain within a finite domain though, or you can perhaps map it over time ?

--
Good luck
Ivar
Hi interesting question, even if I'm not sure I have fully catched your demand, there ;) From my understanding COMSOL is only set up to integrate overa discretized coordinate(s) via a mesh structure, or to integrate "time". So either you have a way to map (Definition Model Coupling or Mapping) your variable onto another single dimension that you discretize and integrate, but still "INF" is a bit far fetched, I suppose you will have to remain within a finite domain though, or you can perhaps map it over time ? -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 9 mai 2012, 17:58 UTC−4
The issue with this is that timeint is only available in the results portion, not the variables section of the model (where I need it to be to define my new variable). I would think the capability should be there if comsol can perform a time integral and timeint could be hacked to do this non-spatial integral.

For now I will use a less-than-desirable workaround for integrating variables, but will update this if I can find any better solutions.
The issue with this is that timeint is only available in the results portion, not the variables section of the model (where I need it to be to define my new variable). I would think the capability should be there if comsol can perform a time integral and timeint could be hacked to do this non-spatial integral. For now I will use a less-than-desirable workaround for integrating variables, but will update this if I can find any better solutions.

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 9 mai 2012, 18:18 UTC−4
Hi

but a time integration you can obtain by defining a new dependent variable and get that integrated directly, see the knowledge base (try a search), but I'm not sure that is enough for your case

--
Good luck
Ivar
Hi but a time integration you can obtain by defining a new dependent variable and get that integrated directly, see the knowledge base (try a search), but I'm not sure that is enough for your case -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 29 mars 2016, 10:21 UTC−4
Hi Nathan,

I know it is an old post but did you manage to find a better solution? I also need to do something similar.

Best,
Hitesh
Hi Nathan, I know it is an old post but did you manage to find a better solution? I also need to do something similar. Best, Hitesh

Walter Frei COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 30 mars 2016, 16:35 UTC−4
Hello,
You can use the integrate function. You would used the syntax:
integrate( f(n), n, n_min, n_max)
Note that this is a numerical integration, so you can't integrate to infinity, but often get close enough, so:
integrate(exp(-n),n,0,10) is a good approximation to the true value of an integral to infinity, for that function.
See also: www.comsol.com/blogs/integrate-functions-without-knowing-limits-integral/
Hello, You can use the integrate function. You would used the syntax: integrate( f(n), n, n_min, n_max) Note that this is a numerical integration, so you can't integrate to infinity, but often get close enough, so: integrate(exp(-n),n,0,10) is a good approximation to the true value of an integral to infinity, for that function. See also: www.comsol.com/blogs/integrate-functions-without-knowing-limits-integral/

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.