Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline RegRetired  
#1 Posted : 10 July 2023 12:20:26(UTC)
RegRetired


Rank: Advanced Member

Groups: Registered
Joined: 03/06/2023(UTC)
Posts: 57
Man
United States

Was thanked: 1 time(s) in 1 post(s)
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. Shok

Thanks for any enlightenment.

FUNCTION INTEGRATION PROBLEMS.sm (24kb) downloaded 16 time(s).

Edited by moderator 10 July 2023 14:58:18(UTC)  | Reason: title case (please, don't yell)

Reg Curry
Loveland, CO

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline uni  
#2 Posted : 10 July 2023 12:43:32(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,495
Man
Russian Federation

Was thanked: 1275 time(s) in 746 post(s)
Simplified version of the document.

FUNCTION INTEGRATION PROBLEMS (uni).sm (19kb) downloaded 10 time(s).

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

xyplot-ode-rkfixed.png

Edited by user 10 July 2023 13:21:03(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
Offline Razonar  
#3 Posted : 10 July 2023 17:12:12(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,368
Uruguay

Was thanked: 829 time(s) in 525 post(s)
Originally Posted by: JReg Go to Quoted Post
...
Is this a know problem in SMATH, or am I just missing something? Maybe it's a feature. Shok ...


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 (21kb) downloaded 11 time(s).

Best regards.
Alvaro.
Offline RegRetired  
#4 Posted : 10 July 2023 20:33:12(UTC)
RegRetired


Rank: Advanced Member

Groups: Registered
Joined: 03/06/2023(UTC)
Posts: 57
Man
United States

Was thanked: 1 time(s) in 1 post(s)
Thank guys. I keep getting caught with my ingrained MATHCAD experience.

Moderator,
Sorry for the all caps. Mea Culpa. It was unintentional.
Reg Curry
Loveland, CO
Offline alyles  
#5 Posted : 10 July 2023 20:55:05(UTC)
alyles


Rank: Advanced Member

Groups: Registered
Joined: 23/03/2016(UTC)
Posts: 278
United States

Was thanked: 91 time(s) in 57 post(s)
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/for...and-error.aspx#post81767

Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.