Special Plots On 2D Plot Bug

Special Plots On 2D Plot Bug - Special Plots do not appear when using "if...else" domain argument - Сообщения

#1 Опубликовано: 21.03.2022 12:00:29
Mr. Whiskers

Mr. Whiskers

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

Группа: User

I have found a low priority issue where special plots (e.g. text shown on the 2D plot) do not appear on the 2D plot when using an "if...else" domain definition. The Special Plots do show up if I use boolean domain definitions, however.

I have attached a sample file here that should make it clear.

I also tried submitting this to the bug tracker, but it appears I do not have the privileges to log into the bug tracker system.

Thank you!

SpecialPlotsBug.sm (8 КиБ) скачан 134 раз(а).
#2 Опубликовано: 21.03.2022 14:23:30
Jean Giraud

Jean Giraud

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

Группа: User

If you declare the system is exact Bolean,
set it exact from the onset plot 1

Bolean.PNG
#3 Опубликовано: 21.03.2022 14:53:55
overlord

overlord

558 сообщений из 1 335 понравились пользователям.

Группа: Moderator

Wrote

I have found a low priority issue where special plots (e.g. text shown on the 2D plot) do not appear on the 2D plot when using an "if...else" domain definition. The Special Plots do show up if I use boolean domain definitions, however.

I have attached a sample file here that should make it clear.

I also tried submitting this to the bug tracker, but it appears I do not have the privileges to log into the bug tracker system.

Thank you!


You can use cases() in Custom Functions Plugin for that purpose.
Plotting, solve(), roots(), FindRoot() and various commands may don't like if/else.
Sometimes an error can be fixed by using a line(), not in your example though.
Recursive functions doesn't solve when line() and cases() used both, etc etc.

These are bitter tricks/bugs, I tend to forgot them everytime.
After struggling a while however I remember the "correct usage".

Regards
#4 Опубликовано: 21.03.2022 18:30:37
Martin Kraska

Martin Kraska

1 230 сообщений из 2 156 понравились пользователям.

Группа: Moderator

Would be interesting, why if() is not defined by default as boolean expression just like cases().

Is there any use case, where the original if() is better than the one defined with cases()? If not, then I propose to include re-definition of if() in the custom functions plugin.

2022-03-21 22_18_08-SMath Solver - [SpecialPlotsBug.sm_].png
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
sergio 22.03.2022 05:48:00
#5 Опубликовано: 21.03.2022 20:20:41
Jean Giraud

Jean Giraud

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

Группа: User

Bolean bug(s) are user bug.
Many projects will accommodate either style if/else ... if/otherwise
A long suite of conditions is horror if/else.
Doctor your plot 1 as proposed, press F9

Bolean NOT =.PNG

Integrate Discontinuous_1.sm (24 КиБ) скачан 123 раз(а).
Integrate Discontinuous.sm (36 КиБ) скачан 123 раз(а).
Integrate Discontinuous_2.sm (132 КиБ) скачан 129 раз(а).
#6 Опубликовано: 21.03.2022 21:57:44
Jean Giraud

Jean Giraud

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

Группа: User

Examine more Bolean applications.

Dolphin.sm (37 КиБ) скачан 120 раз(а).
#7 Опубликовано: 21.03.2022 22:21:45
Alvaro Diaz Falconi

Alvaro Diaz Falconi

1 005 сообщений из 1 677 понравились пользователям.

Группа: User

Wrote

...
Is there any use case, where the original if() is better than the one defined with cases()?
...



Hi Martin. Yes. Here one: https://en.smath.com/forum/yaf_postsm34552_Custom-Functions-plugin.aspx#post34552

and here the Davide answer about that: https://en.smath.com/forum/yaf_postsm34559_Custom-Functions-plugin.aspx#post34559

I also remember some other about what complex could be the expressions in cases(), but can't found that.

Best regards.
Alvaro.
1 пользователям понравился этот пост
sergio 22.03.2022 06:05:00
#8 Опубликовано: 22.03.2022 09:26:54
Jean Giraud

Jean Giraud

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

Группа: User

... doctored for convenience.
Observe collected plot, easy to manage.
Cheers ... Jean.

SpecialPlotsBug DOCTORED.sm (10 КиБ) скачан 120 раз(а).
#9 Опубликовано: 22.03.2022 11:42:00
Jean Giraud

Jean Giraud

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

Группа: User

... you make Bolean algo style
for convenient command line.

Bolean algo Style.PNG
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений