Custom Glyphs plugin (previously known as Functions' Extension)

Custom Glyphs plugin (previously known as Functions' Extension) - Messages

#1 Posted: 11/24/2013 10:05:24 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Glyphs for functions

2016-03-03 19_48_19-SMath Studio Desktop - [CustomGlyphs.sm].png

  • requirements: SMath Studio 0.97.5737 or later (previous versions may have different features);
  • installation: SMath Studio: Tools > Plugins... > Online Gallery;
  • documentation: File not found. File not found.;
  • sources: SVN repository.


>>> PLEASE REPORT IN THIS THREAD ANY ISSUE, MORE DETAILED AS POSSIBLE <<<





For older versions of SMath (prior to 0.97.5737) the password is: test

Documentation for those old versions is attached below:
FunctionsExtension_examples.sm (54 KiB) downloaded 204 time(s).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
3 users liked this post
Martin Kraska 11/24/2013 12:59:00 PM, ioan92 11/24/2013 3:56:00 PM, Radovan Omorjan 11/24/2013 11:23:00 AM
#2 Posted: 11/24/2013 11:59:05 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Many thanks Davide

I would mentioned once more that having so many functions from the growing number of plugins becomes more and more problematic in tracking them out (I just can imagine how problematic should be for Martin to keep up in making the Handbook up to date). The number of Function Categories should be increased because it is the first instance (Besides the Dynamic Assistance) when you can see what function you can use for the specific problem.

Regards,
Radovan

PS. By the way Davide, what happened with ICDF.t(), ICDF.ChiSquare() and ICDF.F() from Statistical Tools plugin? Fortunately, we can use distrib package in Maxima
PSS. Once more to note the possible problem when frequantly installing/updating plugins from the Gallery (see the picture). If this happened, the only way is to delete the extension folder, and to install all the plugins again - AFAIK
SMathBadRequest.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Posted: 11/24/2013 12:36:23 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Davide, thanks for the update.

There is still quite something to do until we can symbolically integrate functions involving your operators. Maxima can do that only if the cases expand to sign() and abs() or possibly unitstep(). Perhaps we also could split the integrals appropriately at the interval limits and send the individual functions to Maxima.

The at() operator currently can handle just very special types of expressions. We could map it to the at() function in Maxima, see attachment. We did so with the det() function in the recent update (announcement to come)

Wrote

Fortunately, we can use distrib package in Maxima


How about posting an example in the Maxima topic of the Samples subforum? Maybe, there are still usability issues which we could fix...

Wrote

PSS. Once more to note the possible problem when frequantly installing/updating plugins from the Gallery (see the picture). If this happened, the only way is to delete the extension folder, and to install all the plugins again - AFAIK


Normally it is sufficient to delete the most recently installed plugins. Usually I have to delete the Maxima and the TableRegion directories.


at.sm (7 KiB) downloaded 115 time(s).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#4 Posted: 11/24/2013 3:27:30 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Wrote

I would mentioned once more that having so many functions from the growing number of plugins becomes more and more problematic in tracking them out (I just can imagine how problematic should be for Martin to keep up in making the Handbook up to date). The number of Function Categories should be increased because it is the first instance (Besides the Dynamic Assistance) when you can see what function you can use for the specific problem.


I know, maybe the Viacheslav proposal about namespaces will help...

Wrote

PS. By the way Davide, what happened with ICDF.t(), ICDF.ChiSquare() and ICDF.F() from Statistical Tools plugin? Fortunately, we can use distrib package in Maxima


I'm looking for numerical approximations , if someone knows about some resources to use ...

Wrote

PSS. Once more to note the possible problem when frequantly installing/updating plugins from the Gallery (see the picture). If this happened, the only way is to delete the extension folder, and to install all the plugins again - AFAIK


I've never experimented the error in your screenshot, in the other hand the plugin updates sometimes (2 times, as for now) causes me workspace's "red cross of death" scrolling up and down worksheets ...

Wrote

There is still quite something to do until we can symbolically integrate functions involving your operators. Maxima can do that only if the cases expand to sign() and abs() or possibly unitstep(). Perhaps we also could split the integrals appropriately at the interval limits and send the individual functions to Maxima.


I see, I don't know how to fix this (because anyway I'm expecting the use of booleans in the conditions - see the screenshots)

Wrote

The at() operator currently can handle just very special types of expressions. We could map it to the at() function in Maxima, see attachment. We did so with the det() function in the recent update (announcement to come)


I'd like to add a function to make working at(2) and at(3) (indipendently from the Maxima plugin), let me know what I can do...
2013-11-24 19_26_40-SMath Studio Desktop - [at.sm_].png
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
Martin Kraska 11/24/2013 4:03:00 PM
#5 Posted: 11/24/2013 4:00:08 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Maxima can integrate piecewise continuous functions, if they do not contain boolean expressions. Fortunately, there are workarounds for that. If you redefine the cases() functions in a similar way as apiecewise.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#6 Posted: 11/24/2013 4:16:02 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

I miss something... why this doesn't work?
2013-11-24 19_26_40-SMath Studio Desktop - [at.sm_].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#7 Posted: 11/24/2013 4:58:42 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Handling of boolean expressions is quite different between Maxima and SMath. The way I proposed is inspired by how Derive (R.I.P.) simplified piecewise functions 20 years ago.

You could use abs() instead of sign(), that might work as well.

From the maxima manual:

The symbols < <= >= and > represent less than, less than or equal, greater than or equal, and greater than, respectively. The names of these operators are "<" "<=" ">=" and ">", which may appear where the name of a function or operator is required.

These relational operators are all binary operators; constructs such as a < b < c are not recognized by Maxima.

Relational expressions are evaluated to Boolean values by the functions is, maybe, if, while, unless. They are not otherwise evaluated or simplified to Boolean values, although the arguments of relational expressions are evaluated (when evaluation is not otherwise prevented by quotation).
...

[MATH]Maxima(is(1<2))=true@#[/MATH]

I do not understand the expression sign(abs(x>0)). if x>0, then the boolean expression returns 1, otherwise 0. abs() does not change that, neither does sign().

In SMath you can replace a
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#8 Posted: 11/24/2013 7:07:21 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Okay, the problem is that cases output conditions and statements without preprocessing, so there are booleans... Maxima can't add (as general rule) an is() when there are boolean operators, or, if this is not possible, overriding the cases function?

The sign(abs(#)) was to reproduce the actual behavior of the symbolic cases(), that use any 0 value as 'false' and any not null value as 'true' (mainly to skip the preprocessing of the conditions and to avoid scaling factors)
2013-11-24 23_48_18-SMath Studio Desktop - [at.sm_].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#9 Posted: 11/24/2013 8:40:15 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Wrote


Wrote

Fortunately, we can use distrib package in Maxima


How about posting an example in the Maxima topic of the Samples subforum? Maybe, there are still usability issues which we could fix...


Done

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#10 Posted: 11/24/2013 8:50:27 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Wrote

Wrote


Wrote

PS. By the way Davide, what happened with ICDF.t(), ICDF.ChiSquare() and ICDF.F() from Statistical Tools plugin? Fortunately, we can use distrib package in Maxima


I'm looking for numerical approximations , if someone knows about some resources to use ...


Davide, I would really like to help - but simply do not know how what is a common programming way of these functions in order to avoid the problematic numerical issues .

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#11 Posted: 12/10/2013 9:10:16 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

UPDATED

- at(2) and at(3) now are working functions

features:
* implicit equivalence needs a value for each variable, sorted alphabetically;
* with explicit equivalence (variable == value) the replacement could be limited to some unknowns or extended to anyone.


[edit] 1st post documentation updated
001.png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
3 users liked this post
sergio 12/11/2013 10:00:00 AM, IVR 12/11/2013 2:57:00 PM, Martin Kraska 12/14/2013 12:47:00 PM
#12 Posted: 12/15/2013 12:05:51 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

How about this one:
col.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#13 Posted: 3/10/2014 9:04:55 AM
experimentator

experimentator

1 likes in 21 posts.

Group: User

I can't work out how the function 'cases' works.
Portapapeles01.jpg
Learning by doing
#14 Posted: 3/10/2014 9:16:02 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Just add some argument separators (, or until you see some magic. Add more separators to get more lines. Take care, you cannot remove lines.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#15 Posted: 3/10/2014 9:46:04 AM
experimentator

experimentator

1 likes in 21 posts.

Group: User

Danke nochmals. Many thanks, so easy...
Learning by doing
#16 Posted: 5/7/2014 5:47:12 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

I've never used MathCad but looking the continuous posts the evaluation through vector elements seems like a drug

So I've planned to add something similar in this plugin; here's a screenshot of the undressed working function... I'm looking for a name, I've thinked to do(2) (because is fast to write - but this may be used hereafter for a do statement?) or maybe each(2)... if anyone has some better ideas about the name... b)


Best regards,

Davide
2014-05-07 23_52_14-SMath Studio Desktop - [each.sm_].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
3 users liked this post
Radovan Omorjan 5/8/2014 4:36:00 AM, sergio 5/8/2014 3:08:00 AM, Martin Kraska 5/8/2014 3:34:00 AM
#17 Posted: 5/8/2014 4:37:00 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Maybe foreach(2) if it is not too long

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#18 Posted: 5/8/2014 5:33:25 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Davide, thanks for approaching this challenge. I see two different issues:

1. mapping functions or expressions to structures by element vec(expr)
- identify the variables in expression (without preprocessing
- get variable values (structures) from context
- iterate over the elements replacing the element values for the structure variable names in expr and building a result of the same structure as the variables.
This would require the variables in expression to be either of the same structure or scalars. You might relax that condition to variables being of identical length, if linear adressing is unique and well defined. Then you would return a vector of corresponding length.
I think, the right over-arrow just like in Mathcad would be appropriate, even if I'd rather like arrows, overbars or the like to be available as decorations for variable names.
This is essentally what your function do() does already, except that perhaps the function could find out by itself, which variable to iterate over.

2. Implicit loops to generate matrix or vector results. Input is the index equation or it's parts (result name, expression, index names). I failed to provide a working example, the definitions might illustrate, what I mean.

[MATH lang=eng]apply(res,expr,i1,i2):line(expr1:at(expr,sys(i1≡ii1,i2≡ii2,2,1)),for(ii1,i1,for(ii2,i2,el(res,ii1,ii2):expr1)),res,3,1)[/MATH]

[MATH lang=eng]apply(res,expr,i1,i2):line(ii1:i1,ii2:i2,for(i1,ii1,for(i2,ii2,el(res,i1,i2):expr)),res,4,1)[/MATH]

The input

[MATH lang=eng]el(M,i,j):i+j[/MATH]

would be translated to

[MATH lang=eng]apply(M,i+j,i,j)[/MATH]

But that would require your function decorating to cover both sides of an assignment.

The names in my examples are arbitrary, I would stick, however to something like vectorize(), vector() or vec(), as this would be consistent with Mathcad speech and with the decoration symbol.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#19 Posted: 5/8/2014 5:26:22 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Wrote

Maybe foreach(2) if it is not too long


unfortunately this is a popular statement too, like do/while...

Wrote

I see two different issues:

1. mapping functions or expressions to structures by element vec(expr)
- identify the variables in expression (without preprocessing
- get variable values (structures) from context
- iterate over the elements replacing the element values for the structure variable names in expr and building a result of the same structure as the variables.
This would require the variables in expression to be either of the same structure or scalars. You might relax that condition to variables being of identical length, if linear adressing is unique and well defined. Then you would return a vector of corresponding length.
I think, the right over-arrow just like in Mathcad would be appropriate, even if I'd rather like arrows, overbars or the like to be available as decorations for variable names.
This is essentally what your function do() does already, except that perhaps the function could find out by itself, which variable to iterate over.

2. Implicit loops to generate matrix or vector results. Input is the index equation or it's parts (result name, expression, index names). I failed to provide a working example, the definitions might illustrate, what I mean.

[MATH lang=eng]apply(res,expr,i1,i2):line(expr1:at(expr,sys(i1≡ii1,i2≡ii2,2,1)),for(ii1,i1,for(ii2,i2,el(res,ii1,ii2):expr1)),res,3,1)[/MATH]

[MATH lang=eng]apply(res,expr,i1,i2):line(ii1:i1,ii2:i2,for(i1,ii1,for(i2,ii2,el(res,i1,i2):expr)),res,4,1)[/MATH]

The input

[MATH lang=eng]el(M,i,j):i+j[/MATH]

would be translated to

[MATH lang=eng]apply(M,i+j,i,j)[/MATH]

But that would require your function decorating to cover both sides of an assignment.

The names in my examples are arbitrary, I would stick, however to something like vectorize(), vector() or vec(), as this would be consistent with Mathcad speech and with the decoration symbol.


The function was thinked to handle functions with scalar single unknown; I think could be extendeded to other cases using (implicitly) at(2) when there are more than a single unknown, limiting the evaluation at the first nesting level (or maybe not, looking from the deepest level and going up, but this is another step...). As for the "dress" I don't like a LHS+RHS approach, because in this case it would seem an assignment instead of a function (and if you place a function on the canvas without an evaluation, nothing happens); as first approach I've thinked to a modified version of at(2) or el(2), with some bracket [#] <#> or symbol @# near the subscript (BTW apply is not a bad idea...).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#20 Posted: 5/8/2014 7:09:38 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

I'd propose to limit special formatting of functions to those cases that have a chance of being understood by non-SMath-experts or non-programmers. at(), cases() or the ternary comparisons are very good examples of this approach. That's why the range variables are that popular, because most engineers would understand the index equations.

How would you write your do() functions on paper? That might then inspire the "dressing".

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/8/2014 7:16:00 PM
  • New Posts New Posts
  • No New Posts No New Posts