2D-Plot problem (regression)

2D-Plot problem (regression) - Сообщения

#1 Опубликовано: 09.08.2023 08:45:57
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

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 (11 КиБ) скачан 34 раз(а).
plot interp.png
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#2 Опубликовано: 09.08.2023 14:02:49
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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.
#3 Опубликовано: 09.08.2023 16:29:21
overlord

overlord

551 сообщений из 1332 понравились пользователям.

Группа: Moderator

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
1 пользователям понравился этот пост
Martin Kraska 09.08.2023 19:34:00
#4 Опубликовано: 09.08.2023 17:33:23
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

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.
#5 Опубликовано: 09.08.2023 17:44:50
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote

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://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#6 Опубликовано: 09.08.2023 18:59:22
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Wrote

... 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.
1 пользователям понравился этот пост
Martin Kraska 09.08.2023 19:34:00
#7 Опубликовано: 09.08.2023 19:46:14
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote



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 (17 КиБ) скачан 25 раз(а).
2023-08-10 00_32_55-SMath Solver - [plot interp.sm_].png

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#8 Опубликовано: 09.08.2023 20:16:03
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

... alternately.
discretize Simpson ... Bingo 3 plots on same Quick Plot
#9 Опубликовано: 09.08.2023 21:41:58
overlord

overlord

551 сообщений из 1332 понравились пользователям.

Группа: Moderator

Wrote

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
#10 Опубликовано: 09.08.2023 22:13:53
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Hi. The workaround. It also solve the roots issue with int() and if()!.

plot interp.sm (20 КиБ) скачан 32 раз(а).

Clipboard01.png

Best regards.
Alvaro.
#11 Опубликовано: 10.08.2023 05:24:14
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote

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://en.smath.info/wiki/SMath%20with%20Plugins.ashx
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений