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 mkraska  
#1 Posted : 09 August 2023 14:45:57(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
The 2D plot exhibits a problem in build 8348, which didn't appear in previous versions. In 7561 it works, however, the attached file can't be opened, you have to copy/paste the content)

In more recent versions I experienced crashes related to the extension manager (online gallery). This is perhaps due to ongoing re-structuring of the website.

The problem:

The built-in 2D plot can't plot f(x), D and the integral of f(x) at the same time. f(x) and D work, f(x) and integral work but not all three at once.

The X-Y plot plugin can handle all three at once, yet you have to make sure that the dummy variable in the integral isn't taken as undefined.

Perhaps wrapping eval() around random subexpressions or modifying all or some of the involved definitions by line operator could provide a work-around, yet I consider the problem being a bug or at least a change to the worse.


plot interp.sm (12kb) downloaded 9 time(s).
plot interp.png
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx

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

Offline Jean Giraud  
#2 Posted : 09 August 2023 20:02:49(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: mkraska Go to Quoted Post
The built-in 2D plot can't plot f(x), D and the integral of f(x) at the same time.
f(x) and D work, f(x) and integral work but not all three at once.

Commonly encountered from NON-NATIVE functions.
Isolate 'D' ... add as argument plot QuickPlot
Same Studio versions and Solver 30405.
Offline overlord  
#3 Posted : 09 August 2023 22:29:21(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,128
Turkey

Was thanked: 509 time(s) in 339 post(s)
Maybe the problem is with string plotting.
It can't get dots plot if used in a variable.
When copy pasted, it can however.

Regards

2023-08-09_22-29.png
thanks 1 user thanked overlord for this useful post.
on 10/08/2023(UTC)
Offline Jean Giraud  
#4 Posted : 09 August 2023 23:33:23(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Alternately, plot f(x) & the XY augmented data points,
XY as plotting argument instead of the expansion.
Next, discretize f(x) and add the FD cumulative on the plot.
At this point you have the 3 on same 2D Quick Plot.
FD [Finite Differences] is exceptionally accurate,
often used as a yardstick sanity check.
In your example, FD & Simpson agree to 6 decimals.
Cheers ... Jean.
Offline mkraska  
#5 Posted : 09 August 2023 23:44:50(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: overlord Go to Quoted Post
Maybe the problem is with string plotting.
It can't get dots plot if used in a variable.
When copy pasted, it can however.

Regards


This is perhaps another similar problem but not the same one. In my example, the right plot shows that string plotting from a variable isn't an issue in general.
The problem comes if combined with the integral.

BTW the behaviour doesn't change when I replace D everywhere by the expression.
Another BTW: I don't think you need to vectorize the augment operation.


Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Razonar  
#6 Posted : 10 August 2023 00:59:22(UTC)
Razonar


Rank: Advanced Member

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

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: mkraska Go to Quoted Post
... The problem comes if combined with the integral.


Hi Martin. You can add if() to the list. Usually, if something is wrong with int, it is also wrong with if and vice versa.

Clipboard01.png

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 10/08/2023(UTC)
Offline mkraska  
#7 Posted : 10 August 2023 01:46:14(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: Razonar Go to Quoted Post


Hi Martin. You can add if() to the list. Usually, if something is wrong with int, it is also wrong with if and vice versa.

Best regards.
Alvaro.


Yes, the behaviour is indeed similar. if() and f(x) work but not if(), f(x) and a matrix.
Again the X-Y plot proves to be more robust.

I was going to file a bug report, yet I found that there is already a related bug, filed 9 years ago: SS-41.
The original report was with the Gamma function. Either it is because Gamma uses if() or it is another instance of the bug.

plot interp.sm (18kb) downloaded 3 time(s).
2023-08-10 00_32_55-SMath Solver - [plot interp.sm_].png

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Jean Giraud  
#8 Posted : 10 August 2023 02:16:03(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
... alternately.
discretize Simpson ... Bingo 3 plots on same Quick Plot
Offline overlord  
#9 Posted : 10 August 2023 03:41:58(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,128
Turkey

Was thanked: 509 time(s) in 339 post(s)
Originally Posted by: mkraska Go to Quoted Post
Another BTW: I don't think you need to vectorize the augment operation.

I didn't need, but I did to show even individual strings doesn't plot.
Here you can see another fail even with a single string variable.

Regards

2023-08-10_03-41.png
Offline Razonar  
#10 Posted : 10 August 2023 04:13:53(UTC)
Razonar


Rank: Advanced Member

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

Was thanked: 815 time(s) in 516 post(s)
Hi. The workaround. It also solve the roots issue with int() and if()!.

plot interp.sm (21kb) downloaded 9 time(s).

Clipboard01.png

Best regards.
Alvaro.

Edited by user 10 August 2023 04:42:11(UTC)  | Reason: Not specified

Offline mkraska  
#11 Posted : 10 August 2023 11:24:14(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: Razonar Go to Quoted Post
Hi. The workaround. It also solve the roots issue with int() and if()!.


Best regards.
Alvaro.


May this be a hint for eventual improvement of the plot region.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
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.