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

Notification

Icon
Error

6 Pages«<23456>
Options
Go to last post Go to first unread
Offline Davide Carpi  
#61 Posted : 13 April 2016 20:13:36(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,214
Man
Italy
Location: Italy

Was thanked: 1120 time(s) in 731 post(s)
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 a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
Offline Davide Carpi  
#62 Posted : 19 April 2016 02:50:27(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,214
Man
Italy
Location: Italy

Was thanked: 1120 time(s) in 731 post(s)
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 a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 19/04/2016(UTC)
Offline Alex M.  
#63 Posted : 16 May 2016 23:17:54(UTC)
Alex M.


Rank: Advanced Member

Groups: Registered
Joined: 03/03/2014(UTC)
Posts: 402
Canada

Was thanked: 119 time(s) in 92 post(s)
Davide, could you plese update the cases() function to work with units on the RHS? Hugely usefull when integrating piecewise physical properties.

Thank you!

CasesUnitBug.sm (4kb) downloaded 44 time(s).CasesUnitBug.png

Edited by user 16 May 2016 23:26:46(UTC)  | Reason: Not specified

Offline Davide Carpi  
#64 Posted : 17 May 2016 01:24:51(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,214
Man
Italy
Location: Italy

Was thanked: 1120 time(s) in 731 post(s)
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)&(B≤C)).

Edited by user 17 May 2016 01:57:32(UTC)  | Reason: Not specified

If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
Offline Davide Carpi  
#65 Posted : 17 May 2016 01:50:12(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,214
Man
Italy
Location: Italy

Was thanked: 1120 time(s) in 731 post(s)
PLUGIN UPDATED SMath Studio 0.98.5973 Nightly Build onlyBeta

- added image2rgb() / image2rgba();
If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
Offline mkraska  
#66 Posted : 28 May 2016 18:38:55(UTC)
mkraska


Rank: Advanced Member

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

Was thanked: 807 time(s) in 516 post(s)
The function at() seems to have a problem similar to those observed in the maxima plugin.
atproblem.PNG atproblem.sm (5kb) downloaded 36 time(s).
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 28/05/2016(UTC)
Offline Jean Giraud  
#67 Posted : 28 May 2016 19:22:02(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 4,104
Canada

Was thanked: 719 time(s) in 562 post(s)
I prefer the compactum style.

Forum Symbolic Compactum.gif
Offline Razonar  
#68 Posted : 30 May 2016 03:31:12(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 426
Uruguay

Was thanked: 227 time(s) in 138 post(s)
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
Offline mikekaganski  
#69 Posted : 30 May 2016 04:25:49(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
Originally Posted by: Razonar Go to Quoted Post
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.
Best regards,
Mike Kaganski
Offline Jean Giraud  
#70 Posted : 30 May 2016 06:12:47(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 4,104
Canada

Was thanked: 719 time(s) in 562 post(s)
Originally Posted by: Razonar Go to Quoted Post
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

Offline Jean Giraud  
#71 Posted : 30 May 2016 06:29:02(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 4,104
Canada

Was thanked: 719 time(s) in 562 post(s)
... 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
Offline Razonar  
#72 Posted : 30 May 2016 06:47:19(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 426
Uruguay

Was thanked: 227 time(s) in 138 post(s)
Originally Posted by: mikekaganski Go to Quoted Post


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


I see: Yep.

Alvaro.
Offline Davide Carpi  
#73 Posted : 30 May 2016 11:01:52(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,214
Man
Italy
Location: Italy

Was thanked: 1120 time(s) in 731 post(s)
Originally Posted by: mkraska Go to Quoted Post
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.

Originally Posted by: Razonar Go to Quoted Post
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

Edited by user 30 May 2016 11:03:56(UTC)  | Reason: Not specified

If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
Offline Razonar  
#74 Posted : 31 May 2016 01:05:53(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 426
Uruguay

Was thanked: 227 time(s) in 138 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post

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 (99kb) downloaded 34 time(s).in version 0.98 b5935 (last stable build, as I understand). Plugin version 1.1.5947.155599

Best regards.
Offline Davide Carpi  
#75 Posted : 31 May 2016 10:51:10(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,214
Man
Italy
Location: Italy

Was thanked: 1120 time(s) in 731 post(s)
Originally Posted by: Razonar Go to Quoted Post
Hi Davide. In the attached, with background are all errors "division by zero" cases_error.sm (99kb) downloaded 34 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().

Edited by user 31 May 2016 11:34:38(UTC)  | Reason: Not specified

If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 01/06/2016(UTC)
Offline Davide Carpi  
#76 Posted : 08 June 2016 10:32:11(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,214
Man
Italy
Location: Italy

Was thanked: 1120 time(s) in 731 post(s)
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;

Edited by user 08 June 2016 10:35:36(UTC)  | Reason: Not specified

If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
thanks 2 users thanked Davide Carpi for this useful post.
on 08/06/2016(UTC),  on 08/06/2016(UTC)
Offline bdrunagle  
#77 Posted : 09 June 2016 23:03:07(UTC)
bdrunagle


Rank: Member

Groups: Registered
Joined: 18/05/2010(UTC)
Posts: 26
Man
United Kingdom

Was thanked: 12 time(s) in 5 post(s)
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:
http://smath.info/wiki/G...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
Offline Razonar  
#78 Posted : 09 June 2016 23:10:24(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 426
Uruguay

Was thanked: 227 time(s) in 138 post(s)
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.



Offline Davide Carpi  
#79 Posted : 09 June 2016 23:30:39(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,214
Man
Italy
Location: Italy

Was thanked: 1120 time(s) in 731 post(s)
Originally Posted by: Razonar Go to Quoted Post
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 Good
Originally Posted by: Razonar Go to Quoted Post
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 a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
Offline Razonar  
#80 Posted : 09 June 2016 23:38:25(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 426
Uruguay

Was thanked: 227 time(s) in 138 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post


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.
Users browsing this topic
Similar Topics
[Custom Functions plugin] cases SS6179 (Bugs & Problems)
by PompelmoTell 07/02/2017 19:14:23(UTC)
6 Pages«<23456>
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.