Message Boards Message Boards

0
|
4847 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

How to improve integration of a piecewise smooth function in Mathematica?

I define a piecewise smooth function f(x), using a command such as Piecewise, Which, If, etc. Than I define a new function g(x)=f(r(x)), where r(x) is a smooth function. Then I get a function G(x) by integrating g(x) over x, using either NIntegrate or Integrate. However this integration takes too much time. In particular, next integration of a function, which is defined using G(x), takes very much time. How to make the integration of a piecewise smooth function faster in Mathematica?

POSTED BY: Dmitry Zhuridov

This would be easier to respond to if we had some example code. While I would definitely suggest using Piecewise over Which or If, it is unclear whether this is the primary issue you are running into.

POSTED BY: Jason Grigsby
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract