Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Mr. Whiskers  
#1 Posted : 21 March 2022 18:00:29(UTC)
Mr. Whiskers

Rank: Newbie

Groups: Registered
Joined: 09/09/2021(UTC)
Posts: 3
Man
United States
Location: Michigan

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 (9kb) downloaded 15 time(s).
Offline Jean Giraud  
#2 Posted : 21 March 2022 20:23:30(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 910 time(s) in 738 post(s)
If you declare the system is exact Bolean,
set it exact from the onset plot 1

Bolean.PNG
Offline overlord  
#3 Posted : 21 March 2022 20:53:55(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 829
Turkey

Was thanked: 290 time(s) in 204 post(s)
Originally Posted by: Mr. Whiskers Go to Quoted Post
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
Offline mkraska  
#4 Posted : 22 March 2022 00:30:37(UTC)
mkraska


Rank: Advanced Member

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

Was thanked: 955 time(s) in 606 post(s)
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/wi...th%20with%20Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 22/03/2022(UTC)
Offline Jean Giraud  
#5 Posted : 22 March 2022 02:20:41(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 910 time(s) in 738 post(s)
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 (25kb) downloaded 6 time(s).
Integrate Discontinuous.sm (37kb) downloaded 4 time(s).
Integrate Discontinuous_2.sm (133kb) downloaded 6 time(s).
Offline Jean Giraud  
#6 Posted : 22 March 2022 03:57:44(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 910 time(s) in 738 post(s)
Examine more Bolean applications.

Dolphin.sm (38kb) downloaded 5 time(s).
Offline Razonar  
#7 Posted : 22 March 2022 04:21:45(UTC)
Razonar


Rank: Advanced Member

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

Was thanked: 560 time(s) in 364 post(s)
Originally Posted by: mkraska Go to Quoted Post
...
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/for...ns-plugin.aspx#post34552

and here the Davide answer about that: https://en.smath.com/for...ns-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.
thanks 1 user thanked Razonar for this useful post.
on 22/03/2022(UTC)
Offline Jean Giraud  
#8 Posted : 22 March 2022 15:26:54(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 910 time(s) in 738 post(s)
... doctored for convenience.
Observe collected plot, easy to manage.
Cheers ... Jean.

SpecialPlotsBug DOCTORED.sm (11kb) downloaded 6 time(s).
Offline Jean Giraud  
#9 Posted : 22 March 2022 17:42:00(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 910 time(s) in 738 post(s)
... you make Bolean algo style
for convenient command line.

Bolean algo Style.PNG
Users browsing this topic
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.