Custom Functions plugin

Custom Functions plugin - functions: extended Max and Min, Unit of Measurement, Order of Magnitude - Messages

#61 Posted: 4/13/2016 2:13:36 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

PLUGIN UPDATED SMath Studio 0.97.5346 and later

- SS-2315: cases() doesn't allow creating third row;
- cases(3) used by default instead of cases(1);
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#62 Posted: 4/18/2016 8:50:27 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

PLUGIN UPDATED SMath Studio 0.98.5952 Nightly Build only

Please note: if you have it, update of Custom Glyphs plugin is mandatory to make everything working fine (hidden functions removed, no more interactions between these plugins since this SS version)

- now it is possible to delete placeholders;
- adding placeholders now is "one-by-one" -> will be displayed a non-working cases() when you add or delete a placeholder;
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Mike Kaganski 4/18/2016 9:21:00 PM
#63 Posted: 5/16/2016 5:17:54 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

Davide, could you plese update the cases() function to work with units on the RHS? Hugely usefull when integrating piecewise physical properties.

Thank you!

File not found.File not found.
#64 Posted: 5/16/2016 7:24:51 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Alex, the 1st condition in your cases() is wrong in both the functions.

You are using 1*'m≤x≤5*'m that bracketed it is (1*'m≤x)≤5*'m; this obviously fails because when you insert 2'm, the result is (1)≤5*'m, hence the "units don't match" error; note that in the 2nd case the error is silent (you will have always 0≤5 or 1≤5).
If you want to have the ternary operator for readability, use lele(...) from the same plugin, that does the job in the right way for you (lele(B,A,C)=(A≤&(B≤C)).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#65 Posted: 5/16/2016 7:50:12 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

PLUGIN UPDATED SMath Studio 0.98.5973 Nightly Build only

- added image2rgb() / image2rgba();
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#66 Posted: 5/28/2016 12:38:55 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

The function at() seems to have a problem similar to those observed in the maxima plugin.
File not found.File not found.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
Davide Carpi 5/28/2016 1:16:00 PM
#67 Posted: 5/28/2016 1:22:02 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

I prefer the compactum style.

Forum Symbolic Compactum.gif
#68 Posted: 5/29/2016 9:31:12 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Hi. I guess that args for cases must to be unevaluated, like those if statements above. That's not only for errors, also for improve the speed of cases, which seems to eval all options before give the answer.

Best regards.

Alvaro.

cases poblem.gif
#69 Posted: 5/29/2016 10:25:49 PM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

Wrote

Hi. I guess that args for cases must to be unevaluated, like those if statements above. That's not only for errors, also for improve the speed of cases, which seems to eval all options before give the answer.



I suppose you may want to vote for SS-2316.
С уважением, Михаил Каганский
#70 Posted: 5/30/2016 12:12:47 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Hi. I guess that args for cases must to be unevaluated



I can't comment wrt your actual version. "cases" does not come with OFFicial 5346,
but is available with the UNofficial 5346. The gorgeous application [made work by
Davide] is the convolution. I tried "cases" in other work sheets and failed.
I toke the plunge to install 5935 ... that killed most of 5346 work sheets.
More nightly build, more incompatibility and less projects working.

Not enough collabs publish working projects.

Jean

#71 Posted: 5/30/2016 12:29:02 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

... there is more to test: as is, 5346 X_Y plot does not support "if/else".
What about plotting some discontinuous from your prefered nightly build ?

Jean
#72 Posted: 5/30/2016 12:47:19 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Wrote



I suppose you may want to vote for SS-2316.



I see: Yep.

Alvaro.
#73 Posted: 5/30/2016 5:01:52 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Wrote

The function at() seems to have a problem similar to those observed in the maxima plugin.


Thank you Martin, I'll work on it ASAP.

Wrote

Hi. I guess that args for cases must to be unevaluated, like those if statements above. That's not only for errors, also for improve the speed of cases, which seems to eval all options before give the answer.


As mentioned by Mike, this is addressed under SS-2316. As for now to evaluate only the function for the target condition you have to use eval() inside functions or numerical optimization outside functions.

I can't reproduce the first error shown in your picture, what plugin version are you running and in what SMath Studio?

2016-05-30 09_52_58-SMath Studio Desktop - [cases_last.sm].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#74 Posted: 5/30/2016 7:05:53 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Wrote


I can't reproduce the first error shown in your picture, what plugin version are you running and in what SMath Studio?



Hi Davide. In the attached, with background are all errors "division by zero" cases_error.sm (98 KiB) downloaded 86 time(s).in version 0.98 b5935 (last stable build, as I understand). Plugin version 1.1.5947.155599

Best regards.
#75 Posted: 5/31/2016 4:51:10 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Wrote

Hi Davide. In the attached, with background are all errors "division by zero" cases_error.sm (98 KiB) downloaded 86 time(s).in version 0.98 b5935 (last stable build, as I understand). Plugin version 1.1.5947.155599


Thank you, I can reproduce. This is before the SS-2318 implementation. In this case, you have to switch the optimization to numeric (symbolic uses the boolean sum and SMath ignores that x is a function's argument). If the function is behind a line, you have to wrap it in a eval().
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Alvaro Diaz Falconi 5/31/2016 11:41:00 PM
#76 Posted: 6/8/2016 4:32:11 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

PLUGIN UPDATED SMath Studio 0.98.5990 Nightly Build only

- fixed at(2) at(3);
- Unknowns now skips the "iterator" argument of diff/int/sum/product functions;
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
2 users liked this post
frapuano 6/8/2016 7:43:00 AM, sergio 6/8/2016 4:50:00 AM
#77 Posted: 6/9/2016 5:03:07 PM
Brian Runagle

Brian Runagle

13 likes in 27 posts.

Group: User

Hello Davide
Sorry to be thick but I need some help with the cases function.

When I type case( or enter cases from the Insert Function… menu, only two lines are placed on the worksheet:
https://smath.com/wiki/GetFile.aspx?File=forum_attach%2fbdrunagle%2fcases_if_otherwise.png
and I don't know how to add extra if cases.

I've tried dragging corners, as for adding array rows, but with no success. How can I add more cases?

Smath: 0.98.5997
Custom Functions: 1.1.5981.13453
Custom Glyphs: 1.1.5973.13108

Many thanks

Brian
#78 Posted: 6/9/2016 5:10:24 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Hi bdrunagle. Try to write , (or ; if you have this as separator) inside the placeholder of cases. This give you the new extra lines. But be carefull, after inserted, can't be deleted. (Must to copy and paste to new one cases).

Best regards.

Alvaro.



#79 Posted: 6/9/2016 5:30:39 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Wrote

Hi bdrunagle. Try to write , (or ; if you have this as separator) inside the placeholder of cases. This give you the new extra lines.


Correct
Wrote

But be carefull, after inserted, can't be deleted. (Must to copy and paste to new one cases).



Since some nightly build it is possible (the cost is that you cannot insert a line at once, you have to press the argument separator twice)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#80 Posted: 6/9/2016 5:38:25 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Wrote



Since some nightly build it is possible (the cost is that you cannot insert a line at once, you have to press the argument separator twice)



That's seems a very cheap price.

Best regards.

Alvaro.
  • New Posts New Posts
  • No New Posts No New Posts