Problem integrating some function forms

Problem integrating some function forms - Integration does not work for if...else functions - 消息

#1 已发布: 2023/7/10 06:20:26
RegRetired

RegRetired

8个赞,共144个帖子。

组: User

This post is an outgrowth of a previous post on XY-PLOTS. I should have started a new question, so here it is.

In the attached sm file, there are three definitions of the same function:
1. Using Boolean math
2. Using an if...else form
3. Using a slightly different if...else form.

They all plot the same; however, when integrating these functions, only the Boolean version works.
You can enable and disable the three forms to see that only the Boolean form works in the integral.

Runtime = 3-4 seconds for the working Boolean form. The non-working versions are instantaneous.

Is this a know problem in SMATH, or am I just missing something? Maybe it's a feature.

Thanks for any enlightenment.

FUNCTION INTEGRATION PROBLEMS.sm (23.25 KiB)已下载 1424 次。
Reg CurryLoveland, CO
#2 已发布: 2023/7/10 06:43:32
Вячеслав Мезенцев

Вячеслав Мезенцев

1,558个赞,共1,868个帖子。

组: Moderator

Simplified version of the document.

FUNCTION INTEGRATION PROBLEMS (uni).sm (18.18 KiB)已下载 1433 次。

This method is also possible, but does not solve the problems with integration.

xyplot-ode-rkfixed.png
Russia ☭ forever, Viacheslav N. Mezentsev
#3 已发布: 2023/7/10 11:12:12
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Wrote

...
Is this a know problem in SMATH, or am I just missing something? Maybe it's a feature. ...



Yes, it's a known issue, but not just in SMath, except that in other languages there are tools to handle 'piecewise continuous' functions. In maple, for example, you have the piecewise function, similar to SMath's cases, but also the much more powerful Heaviside, which is actually not a function, but a distribution (and not in the sense of probabilities, but as limit of sequences of functions)

Clipboard01.png

To help understand more or less why some functions can be integrated and others can't, or be used for solve or roots, they are only candidates if the Unknowns function does not return an error and can detect its variables.

Clipboard02.png
FUNCTION INTEGRATION PROBLEMS (uni) with Unknowns.sm (20.18 KiB)已下载 1474 次。

Best regards.
Alvaro.
#4 已发布: 2023/7/10 14:33:12
RegRetired

RegRetired

8个赞,共144个帖子。

组: User

Thank guys. I keep getting caught with my ingrained MATHCAD experience.

Moderator,
Sorry for the all caps. Mea Culpa. It was unintentional.
Reg CurryLoveland, CO
#5 已发布: 2023/7/10 14:55:05
Arie

Arie

94个赞,共285个帖子。

组: User

I suspect using 'if' function within Q(z) will not work for similar reason it did not work in these examples: https://en.smath.com/forum/yaf_postsm81767_Issues-with-cases-if-and-error.aspx#post81767

Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
  • 有新帖
  • 无新帖