1页(9条)
Special Plots On 2D Plot Bug - Special Plots do not appear when using "if...else" domain argument - 消息
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.83 KiB)已下载 1666 次。
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.83 KiB)已下载 1666 次。
WroteI 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
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](/zh-Hans-CN/files/Download/ZRkZwF/2022-03-21-22_18_08-SMath-Solver---[SpecialPlotsBug.sm_].png)
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](/zh-Hans-CN/files/Download/ZRkZwF/2022-03-21-22_18_08-SMath-Solver---[SpecialPlotsBug.sm_].png)
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1位用户喜欢此帖子
sergio 2022/3/22 05:48:00
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

Integrate Discontinuous_1.sm (24.57 KiB)已下载 1636 次。
Integrate Discontinuous.sm (36.51 KiB)已下载 1681 次。
Integrate Discontinuous_2.sm (132.47 KiB)已下载 1676 次。
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
Integrate Discontinuous_1.sm (24.57 KiB)已下载 1636 次。
Integrate Discontinuous.sm (36.51 KiB)已下载 1681 次。
Integrate Discontinuous_2.sm (132.47 KiB)已下载 1676 次。
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 2022/3/22 06:05:00
... doctored for convenience.
Observe collected plot, easy to manage.
Cheers ... Jean.
SpecialPlotsBug DOCTORED.sm (10.86 KiB)已下载 1659 次。
Observe collected plot, easy to manage.
Cheers ... Jean.
SpecialPlotsBug DOCTORED.sm (10.86 KiB)已下载 1659 次。
1页(9条)
- 有新帖
- 无新帖