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.

why there is no definite integral operator in comsol?

Please login with a confirmed email address before reporting spam

Hi,

when I want to calculate a definite integral in comsol, there is no definite integral operator like the int() in the MATLAB. I must use the MATLAB to calculate the numrical solution, and import to comsol.

5 Replies Last Post 9 juin 2017, 16:00 UTC−4
Walter Frei COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 13 juin 2016, 11:06 UTC−4
Hello,

Yes, COMSOL can numerically evaluate integrals. You will find these articles helpful:
www.comsol.com/blogs/overview-integration-methods-space-time/
www.comsol.com/blogs/integrate-functions-without-knowing-limits-integral/

Best Regards,
Hello, Yes, COMSOL can numerically evaluate integrals. You will find these articles helpful: https://www.comsol.com/blogs/overview-integration-methods-space-time/ https://www.comsol.com/blogs/integrate-functions-without-knowing-limits-integral/ Best Regards,

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 13 juin 2016, 22:18 UTC−4
Thank you for your reply.

I'm afraid that the examples are not the problem I mentioned.
Now I want define a userdefined function like the attachmennt. The variable s is just for the integral. The variable h is the vaiable used in the model.
Thank you for your reply. I'm afraid that the examples are not the problem I mentioned. Now I want define a userdefined function like the attachmennt. The variable s is just for the integral. The variable h is the vaiable used in the model.


Please login with a confirmed email address before reporting spam

Posted: 8 years ago 19 août 2016, 10:53 UTC−4
Hi everybody,

well, if this is just about a space integral or sth. similar, for example for an integration in the results section, one can use a logical step function instead. To bound for example the x value between xmin and xmax one would write in the expressions field something like:
expr*(x<xmax)*(x>xmin)
where expr is the expression you would want to integrate.

Best,
Hi everybody, well, if this is just about a space integral or sth. similar, for example for an integration in the results section, one can use a logical step function instead. To bound for example the x value between xmin and xmax one would write in the expressions field something like: expr*(xxmin) where expr is the expression you would want to integrate. Best,

Walter Frei COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 19 août 2016, 13:48 UTC−4
Hello 跃强 胡,
In response to the message on July 13: The integral that you're describing should be doable by the methods in the previously reference blogs. You may want to contact your COMSOL Support Team if there's a particular example that you're working on here.
Best Regards,
Hello 跃强 胡, In response to the message on July 13: The integral that you're describing should be doable by the methods in the previously reference blogs. You may want to contact your COMSOL Support Team if there's a particular example that you're working on here. Best Regards,

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 9 juin 2017, 16:00 UTC−4
I am wondering about the same topic. Certainly this blog in particular sheds some light on it:

www.comsol.com/blogs/overview-integration-methods-space-time/

But, it would be nice to see more diverse examples, such as how to define functions and intop expressions to integrate in 1D, 2D and 3D, for both definite and indefinite integrals, both over variables that already exist in COMSOL (e.g., x,y), and over user-defined variables or functions (which may themselves be functions of variables like x and y).

In general, the PDF documentation is very short on examples and practical application notes. For example, the explanation of integrate() is limited to explaining in generic terms that the function can take one of two forms:

integrate(expr,var,lower,upper)
integrate(expr,var,lower,upper,to1)

As far as the main user manual goes, that's essentially it. There are some brief comments about the use of coordinate names (which seem to amount to "it doesn't work," without explaining how to make it work) and "spatial at" operators, but not a single worked example.

IMHO, every function should have enough actual examples to show the various ways in which it can be used, and the various syntax that can be used (since there sometimes seem to be extensions that are not evident from the generic descriptions).
I am wondering about the same topic. Certainly this blog in particular sheds some light on it: https://www.comsol.com/blogs/overview-integration-methods-space-time/ But, it would be nice to see more diverse examples, such as how to define functions and intop expressions to integrate in 1D, 2D and 3D, for both definite and indefinite integrals, both over variables that already exist in COMSOL (e.g., x,y), and over user-defined variables or functions (which may themselves be functions of variables like x and y). In general, the PDF documentation is very short on examples and practical application notes. For example, the explanation of integrate() is limited to explaining in generic terms that the function can take one of two forms: integrate(expr,var,lower,upper) integrate(expr,var,lower,upper,to1) As far as the main user manual goes, that's essentially it. There are some brief comments about the use of coordinate names (which seem to amount to "it doesn't work," without explaining how to make it work) and "spatial at" operators, but not a single worked example. IMHO, every function should have enough actual examples to show the various ways in which it can be used, and the various syntax that can be used (since there sometimes seem to be extensions that are not evident from the generic descriptions).

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.