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?
Posted 13 giu 2016, 03:58 GMT-4 Parameters, Variables, & Functions 5 Replies
Please login with a confirmed email address before reporting spam
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.
Please login with a confirmed email address before reporting spam
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,
Please login with a confirmed email address before reporting spam
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.
Attachments:
Please login with a confirmed email address before reporting spam
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,
Please login with a confirmed email address before reporting spam
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
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.
Suggested Content
- KNOWLEDGE BASE Out of Memory During Assembly
- KNOWLEDGE BASE Duplicate parameter/variable name
- FORUM Definite integral calculation
- BLOG Introduction to Modeling Soap Films and Other Variational Problems
- KNOWLEDGE BASE Computing Time and Space Integrals
