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

Notification

Icon
Error

2 Pages12>
Options
Go to last post Go to first unread
Offline Davide Carpi  
#1 Posted : 24 November 2013 17:05:24(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1203 time(s) in 794 post(s)
Glyphs for functions Beta

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: CustomGlyphs.sm (6kb) downloaded 53 time(s). CustomGyphs.pdf (32kb) downloaded 64 time(s).;
  • 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:

Edited by user 31 May 2016 10:28:03(UTC)  | Reason: Not specified

File Attachment(s):
FunctionsExtension_examples.sm (55kb) downloaded 138 time(s).
Davide Carpi attached the following image(s):
001.png
If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
thanks 3 users thanked Davide Carpi for this useful post.
on 24/11/2013(UTC),  on 24/11/2013(UTC),  on 24/11/2013(UTC)
Offline omorr  
#2 Posted : 24 November 2013 18:59:05(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Many thanks Davide Good

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 Good
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

Edited by user 24 November 2013 19:11:54(UTC)  | Reason: Not specified

omorr attached the following image(s):
SMathBadRequest.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline mkraska  
#3 Posted : 24 November 2013 19:36:23(UTC)
mkraska


Rank: Advanced Member

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

Was thanked: 933 time(s) in 589 post(s)
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)

Originally Posted by: omorr Go to Quoted Post
Fortunately, we can use distrib package in Maxima Good

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

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

File Attachment(s):
at.sm (8kb) downloaded 66 time(s).
mkraska attached the following image(s):
at.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline Davide Carpi  
#4 Posted : 24 November 2013 22:27:30(UTC)
Davide Carpi


Rank: Advanced Member

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

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

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

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

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

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

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

Edited by user 24 November 2013 22:30:38(UTC)  | Reason: Not specified

Davide Carpi attached the following image(s):
2013-11-24 19_26_07-SMath Studio Desktop - [at.sm_].png
2013-11-24 19_26_40-SMath Studio Desktop - [at.sm_].png
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 24/11/2013(UTC)
Offline mkraska  
#5 Posted : 24 November 2013 23:00:08(UTC)
mkraska


Rank: Advanced Member

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

Was thanked: 933 time(s) in 589 post(s)
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 a<x<b, then integration (definite and indefinite) should be possible.
mkraska attached the following image(s):
piecewise.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline Davide Carpi  
#6 Posted : 24 November 2013 23:16:02(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1203 time(s) in 794 post(s)
I miss something... why this doesn't work?
Davide Carpi attached the following image(s):
2013-11-24 19_26_40-SMath Studio Desktop - [at.sm_].png
If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
Offline mkraska  
#7 Posted : 24 November 2013 23:58:42(UTC)
mkraska


Rank: Advanced Member

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

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

Maxima(is(1<2))=true@#

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<b by 0,5(1+sign(b-a)), which is not entirely the same, the difference is in how the case a=b is handled. For integration purposes, however, that does not matter.

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline Davide Carpi  
#8 Posted : 25 November 2013 02:07:21(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1203 time(s) in 794 post(s)
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)

Edited by user 25 November 2013 02:38:14(UTC)  | Reason: Not specified

Davide Carpi attached the following image(s):
2013-11-24 23_48_18-SMath Studio Desktop - [at.sm_].png
If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
Offline omorr  
#9 Posted : 25 November 2013 03:40:15(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Originally Posted by: mkraska Go to Quoted Post

Originally Posted by: omorr Go to Quoted Post
Fortunately, we can use distrib package in Maxima Good

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!"
Offline omorr  
#10 Posted : 25 November 2013 03:50:27(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Originally Posted by: w3b5urf3r_reloaded Go to Quoted Post
Originally Posted by: omorr Go to Quoted Post

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

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

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 Sad .

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline Davide Carpi  
#11 Posted : 11 December 2013 04:10:16(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1203 time(s) in 794 post(s)
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

Edited by user 11 December 2013 22:00:10(UTC)  | Reason: Not specified

File Attachment(s):
at.sm (18kb) downloaded 58 time(s).
Davide Carpi attached the following image(s):
001.png
If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
thanks 3 users thanked Davide Carpi for this useful post.
on 11/12/2013(UTC),  on 11/12/2013(UTC),  on 14/12/2013(UTC)
Offline mkraska  
#12 Posted : 15 December 2013 19:05:51(UTC)
mkraska


Rank: Advanced Member

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

Was thanked: 933 time(s) in 589 post(s)
How about this one:
mkraska attached the following image(s):
col.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline experimentator  
#13 Posted : 10 March 2014 16:04:55(UTC)
experimentator


Rank: Member

Groups: Registered
Joined: 26/05/2013(UTC)
Posts: 21
Spain

Was thanked: 1 time(s) in 1 post(s)
I can't work out how the function 'cases' works.
experimentator attached the following image(s):
Portapapeles01.jpg
Learning by doing
Offline mkraska  
#14 Posted : 10 March 2014 16:16:02(UTC)
mkraska


Rank: Advanced Member

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

Was thanked: 933 time(s) in 589 post(s)
Just add some argument separators (, or Wink 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/wi...th%20with%20Plugins.ashx
Offline experimentator  
#15 Posted : 10 March 2014 16:46:04(UTC)
experimentator


Rank: Member

Groups: Registered
Joined: 26/05/2013(UTC)
Posts: 21
Spain

Was thanked: 1 time(s) in 1 post(s)
Danke nochmals. Many thanks, so easy...
Learning by doing
Offline Davide Carpi  
#16 Posted : 08 May 2014 00:47:12(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1203 time(s) in 794 post(s)
I've never used MathCad but looking the continuous posts the evaluation through vector elements seems like a drug Laugh wild

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... Cool


Best regards,

Davide

Edited by user 08 May 2014 01:25:34(UTC)  | Reason: Not specified

Davide Carpi attached the following image(s):
2014-05-07 23_52_14-SMath Studio Desktop - [each.sm_].png
If you like my plugins please consider a donation to SMath Studio; for personal contributions to me: paypal.me/dcprojects
thanks 3 users thanked Davide Carpi for this useful post.
on 08/05/2014(UTC),  on 08/05/2014(UTC),  on 08/05/2014(UTC)
Offline omorr  
#17 Posted : 08 May 2014 11:37:00(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Maybe foreach(2) if it is not too long Good

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline mkraska  
#18 Posted : 08 May 2014 12:33:25(UTC)
mkraska


Rank: Advanced Member

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

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

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)

apply(res,expr,i1,i2):line(ii1:i1,ii2:i2,for(i1,ii1,for(i2,ii2,el(res,i1,i2):expr)),res,4,1)

The input

el(M,i,j):i+j

would be translated to

apply(M,i+j,i,j)

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.

Edited by user 08 May 2014 12:37:55(UTC)  | Reason: Not specified

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline Davide Carpi  
#19 Posted : 09 May 2014 00:26:22(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1203 time(s) in 794 post(s)
Originally Posted by: omorr Go to Quoted Post
Maybe foreach(2) if it is not too long Good

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

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

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)

apply(res,expr,i1,i2):line(ii1:i1,ii2:i2,for(i1,ii1,for(i2,ii2,el(res,i1,i2):expr)),res,4,1)

The input

el(M,i,j):i+j

would be translated to

apply(M,i+j,i,j)

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...).

Edited by user 09 May 2014 01:13:11(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 mkraska  
#20 Posted : 09 May 2014 02:09:38(UTC)
mkraska


Rank: Advanced Member

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

Was thanked: 933 time(s) in 589 post(s)
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/wi...th%20with%20Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 09/05/2014(UTC)
Users browsing this topic
2 Pages12>
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.