Custom Functions plugin

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

#61 Publicado: 13/4/2016 14:13:36
Davide Carpi

Davide Carpi

1.443 me gusta en 2.936 mensajes.

Grupo: 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 Publicado: 18/4/2016 20:50:27
Davide Carpi

Davide Carpi

1.443 me gusta en 2.936 mensajes.

Grupo: 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
A 1 usuarios les gustó este mensaje
Mike Kaganski 18/4/2016 21:21:00
#63 Publicado: 16/5/2016 17:17:54
Alexander O. Melnik

Alexander O. Melnik

127 me gusta en 498 mensajes.

Grupo: 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!

Archivo no encontrado.Archivo no encontrado.
#64 Publicado: 16/5/2016 19:24:51
Davide Carpi

Davide Carpi

1.443 me gusta en 2.936 mensajes.

Grupo: 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 Publicado: 16/5/2016 19:50:12
Davide Carpi

Davide Carpi

1.443 me gusta en 2.936 mensajes.

Grupo: 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 Publicado: 28/5/2016 12:38:55
Martin Kraska

Martin Kraska

1.361 me gusta en 2.275 mensajes.

Grupo: Moderator

The function at() seems to have a problem similar to those observed in the maxima plugin.
Archivo no encontrado.Archivo no encontrado.
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
A 1 usuarios les gustó este mensaje
Davide Carpi 28/5/2016 13:16:00
#67 Publicado: 28/5/2016 13:22:02
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

I prefer the compactum style.

Forum Symbolic Compactum.gif
#68 Publicado: 29/5/2016 21:31:12
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: 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 Publicado: 29/5/2016 22:25:49
Mike Kaganski

Mike Kaganski

184 me gusta en 434 mensajes.

Grupo: 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 Publicado: 30/5/2016 0:12:47
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: 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 Publicado: 30/5/2016 0:29:02
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: 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 Publicado: 30/5/2016 0:47:19
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: User

Wrote



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



I see: Yep.

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

Davide Carpi

1.443 me gusta en 2.936 mensajes.

Grupo: 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 Publicado: 30/5/2016 19:05:53
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: 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,13 KiB) descargado 1625 vez(es).in version 0.98 b5935 (last stable build, as I understand). Plugin version 1.1.5947.155599

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

Davide Carpi

1.443 me gusta en 2.936 mensajes.

Grupo: Moderator

Wrote

Hi Davide. In the attached, with background are all errors "division by zero" cases_error.sm (98,13 KiB) descargado 1625 vez(es).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
A 1 usuarios les gustó este mensaje
Alvaro 31/5/2016 23:41:00
#76 Publicado: 8/6/2016 4:32:11
Davide Carpi

Davide Carpi

1.443 me gusta en 2.936 mensajes.

Grupo: 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
A 2 usuarios les gustó este mensaje
sergio 8/6/2016 4:50:00, frapuano 8/6/2016 7:43:00
#77 Publicado: 9/6/2016 17:03:07
Brian Runagle

Brian Runagle

13 me gusta en 27 mensajes.

Grupo: 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 Publicado: 9/6/2016 17:10:24
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: 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 Publicado: 9/6/2016 17:30:39
Davide Carpi

Davide Carpi

1.443 me gusta en 2.936 mensajes.

Grupo: 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 Publicado: 9/6/2016 17:38:25
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: 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.
  • Nuevos mensajes
  • Sin mensajes nuevos