Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Jean Giraud  
#1 Posted : 25 May 2016 06:48:06(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Razonar Go to Quoted Post
Hi Uni. Admirable work, thanks a lot for this plugin. Just few questions:

- Not related with your plugin, but ... easy asking you: SMath don't have maple's traperror or mathcad onerror functions?

Have a nice day.

Alvaro.


Saludad Alvaro,

The Mathcad program "on error" looks like to me, it has no Smath equivalent.
If you remember Paul W. "Rotate Image" is essentially working on the final
"on error". I must have spent a day attempting, not to avail.
I have posted everything in this forum "Rotate Image", but no reply.
Mike, atempted but not working in Smath 5346 OFFicial release.

Cheeres, Jean

Edited by moderator 27 May 2016 17:41:56(UTC)  | Reason: part of discussion not related with the plugin moved here

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Davide Carpi  
#2 Posted : 25 May 2016 10:32:05(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: Razonar Go to Quoted Post
- Not related with your plugin, but ... easy asking you: SMath don't have maple's traperror or mathcad onerror functions?


Yes, it is named try(2); this function as for now is available only in nightly build and cloud (since SMath Studio 0.98.5952)

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Jean Giraud  
#3 Posted : 25 May 2016 17:38:10(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
I'm not convinced 'try', 'on error' makes it Mathcad "on error".
The example 1/{-3}+1/{-2}+1/{-1}+1/1+1/2+1/3+1/4+1/5=0.45 works fine.

Easy to check with the latest nightly build, see attached.
The work sheet is "autocal OFF"

Jean

Rotate Image [Mike 16042016].sm (384kb) downloaded 36 time(s).

Edited by moderator 27 May 2016 15:22:00(UTC)  | Reason: Not specified

Offline Davide Carpi  
#4 Posted : 25 May 2016 18:23:08(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1329 time(s) in 875 post(s)
They works both for me (try/onerror, if/else); slow like how it flows the glass, however the loop runs.

2016-05-25 17_20_17-SMath Studio Desktop - [Rotate%20Image%20[Mike%2016042016].sm_].png

Code:
x = 1, y = 1, i = 5, j = -5
error
sum = mat(-6375,-6375,-6375,1,3)
x = 1, y = 1, i = 5, j = -4
error
sum = mat(-11475,-11475,-11475,1,3)
x = 1, y = 1, i = 6, j = -5
error
sum = mat(-19125,-19125,-19125,1,3)
x = 1, y = 1, i = 6, j = -4
error
sum = mat(-25245,-25245,-25245,1,3)
x = 1, y = 2, i = 4, j = -4
error
sum = mat(-4080,-4080,-4080,1,3)
x = 1, y = 2, i = 4, j = -3
error
sum = mat(-7140,-7140,-7140,1,3)
...
...
...
x = 2, y = 7, i = 2, j = 1
sum = mat(379,379,379,1,3)
x = 2, y = 8, i = 1, j = 1
sum = mat(126.333333333333,126.333333333333,126.333333333333,1,3)
x = 2, y = 8, i = 1, j = 2
sum = mat(373,373,373,1,3)
x = 2, y = 8, i = 2, j = 1
sum = mat(625.666666666667,625.666666666667,625.666666666667,1,3)
x = 2, y = 8, i = 2, j = 2
sum = mat(1120.33333333333,1120.33333333333,1120.33333333333,1,3)
...

Edited by user 25 May 2016 18:28:59(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Razonar  
#5 Posted : 26 May 2016 02:04:06(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Jean, Uni, Davide. Thanks a lot for your effort and information.
Finally, a traperror for SMath!. That´s great. I'm go to try this "nightly" build, just for have this command. Thanks a lot, Davide.

And Uni, I'm reading your source code and SMath documentation for imagine how to do that.

Best regards.

Alvaro.
Offline Razonar  
#6 Posted : 26 May 2016 07:31:43(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Whell, here some applications of try. But a lot of issues implementing it.
Regards.
Alvaro.



Rows$Cols.sm (21kb) downloaded 40 time(s).
Offline mikekaganski  
#7 Posted : 26 May 2016 11:17:04(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
Whell, here some applications of try. But a lot of issues implementing it.


I only see two issues. First two aren't issues.

  1. IsScalar(f): you fail before try(), in IsString(x), where the non-defined f exhibits itself. You must take into account, that f(x):=3*x didn't define symbol f, only symbol f(#), because in SMath, variable, function with one argument, function with two arguments, ... having same name are different entities.
  2. lineRows(a) - here rows(x) actually succeeds, giving symbolic answer: rows(a). try() returns it to line(), which then returns it to evaluator in your numeric "=", where it finally fails. Use eval() here.


Only the pair IsScalarWithoutAnd(x) and IsScalarWithAnd(x) both work wrong. Here, in first definition case, rows() is evaluated symbolically, gives itself (without failing), then the result of try() is considered fixed, thus try(...) is reduced to its "result" - IsScalarWithoutAnd(x)=rows(x). Then this simplified function fails on invocation.
In second definition, the topmost and (&) evaluates its arguments numerically, rows(x) numerically fails because x is undefined, try() intercepts it and returns 0, which is compared to 0, and result (equal=true=1) is anded with 1, which gives ... yes, 1. So, the resulting preprocessed definition looks like IsScalarWithAnd(x)=1 (it always returns same result regardless its argument).

Oh, by the way, diff(x,x) always gives 1. So last function is simplified to IsVariable(x)=1.

Edited by user 26 May 2016 11:22:36(UTC)  | Reason: Not specified

Best regards,
Mike Kaganski
Offline Jean Giraud  
#8 Posted : 26 May 2016 17:21:13(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
I don't see much use for all those new coding.
"IsScalar" is missing: YES
"ifIsScalar" was added in Mathcad in 2003 [DAEP].
Quite a few suggestions are redundant. I might be missing some real use.

We need the 1/1 Mathcad "on error" as exemplified in "Image Rotate"
Just as is to keep things simple in program.

on error.gif

Every time a new code is developped, it might scrap Smath work sheets
working well in previous version(s). Why not invent a batch run of user
work sheets to enable testing. That supposes an Smath repository and
some voluntary work

Integrate Adaptive.sm (17kb) downloaded 24 time(s).

Offline Razonar  
#9 Posted : 26 May 2016 20:53:52(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
I say a lot of issues because developing those simple functions can´t be sure about which is the best implementation before testing it, and need to try (me, not the smath function) a lot of posible combination of implementations. The analysis about when the function go to be evaluated symb or numerically is hard to do for me. So, thanks very much for the explanations. I want an uniform way to define functions, this is, if some Is function have line, then the others too.

About the f, what is an issue for me is not the error when evaluate the last example, is the not-error in the others evaluations.

About the diff, I don't understand when the type check is implemented. diff(x,x) actually is a theorem, a rule or something like that, but type check must to be before any answer.

About this version, I see that my jacobian now don't work: http://en.smath.info/for...ource.ashx?a=661&b=2 in this old post: http://en.smath.info/for..._postst1555_Hessian.aspx

Best regards.
Offline Razonar  
#10 Posted : 26 May 2016 23:13:48(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Oh, another thing. For me "variable" is that thing that can you can use second arg in diff. MapleV accept only names, but higher versions also take other things, like vector elements (V[i], for example) which is very very useful. And what I try actually is some kind of independence test. The best independence test that I know is, preciselly, diff(f,x)=0.

And sorry Uni for post this things here, but my original intention was implement try function inside of a script in vb or python, and other functions like Is testing and those others.

Best regards.

Alvaro.

Edited by user 26 May 2016 23:17:30(UTC)  | Reason: Not specified

Offline Jean Giraud  
#11 Posted : 27 May 2016 04:31:00(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Razonar Go to Quoted Post
Oh, another thing. For me "variable" is that thing that can you can use second arg in diff. MapleV accept only names, but higher versions also take other things, like vector elements (V[i], for example) which is very very useful. And what I try actually is some kind of independence test. The best independence test that I know is, preciselly, diff(f,x)=0.

And sorry Uni for post this things here, but my original intention was implement try function inside of a script in vb or python, and other functions like Is testing and those others.

Best regards.

Alvaro.


The way you write "diff(f,x)=0" ... I read 1rst derivative of 'f' wrt 'x'
then equate to 0 for roots. Simple: assign diff(f,x) to a new function,
for instance ff(x):=diff(f,x) ... equate ff(x)=0 for roots.
For the derivative of a vector, if the vector is not smooth you get derivative
+ an immense amount of noise. If the vector is smooth from a function, then get the drivative from the function, then evaluate at points. It could be Maple spline the
vector but that is as bad as good as you know nothing under the hood.

Cheers, Jean

Forum Derivative.gif

Offline Razonar  
#12 Posted : 27 May 2016 05:46:52(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post


The way you write "diff(f,x)=0" ... I read 1rst derivative of 'f' wrt 'x'
then equate to 0 for roots. Simple: assign diff(f,x) to a new function,



Hi Jean. Yes, you're rigth. What I must to wrote was diff(f,x) identically equals zero, i.e. f'(x)=0 for all x in Domain(f). This is the good definition for independence criteria, and, as you say, diff(f,x)=0 is for search critical points.

I found a new nightly build, http://en.smath.info/for...-5990--26-May-2016.aspx, where my jacobian works, but ... with a but. Attached in pdf too.

Best regards.

Alvaro.
Jacobian.sm (30kb) downloaded 22 time(s). Jacobian.pdf (62kb) downloaded 19 time(s).
Offline Davide Carpi  
#13 Posted : 27 May 2016 09:09:17(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: Razonar Go to Quoted Post
here my jacobian works, but ... with a but.


Opened an issue: SS-2353


Just to remember it, this is the thread of the Script Region plugin; would be better to don't go too much off topic Good

edit: discussion about try function moved here.

Edited by user 07 June 2016 23:19:14(UTC)  | Reason: marked as solved

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline mikekaganski  
#14 Posted : 27 May 2016 18:23:34(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: Jean Giraud Go to Quoted Post
I have posted everything in this forum "Rotate Image", but no reply.
Mike, atempted but not working in Smath 5346 OFFicial release.


Jean,

I promised not to touch anything you write here, but here you have mentioned a problem that I had helped you to solve, in a manner that makes it look like I failed, so I have to respond.

First, in your message, you failed to provide a link to the topic where that problem was dealt, so that anyone could just look at it themselves, and see that the suggested solution works in timespan of about a minute in 5346 on a modest hardware (my PC gives ~40 s).

Then you provide a file that you name as if it is mine:

Originally Posted by: Jean Giraud Go to Quoted Post
Rotate Image [Mike 16042016].sm (384kb) downloaded 36 time(s).

and actually is an incompetent modification that shows lack of comprehension. Inserting things like "a:=(R+G+B)/3" into an innermost loop is your footgun that you fire again. I don't mind, unless you blame me with this.

Please go on making useless claims when you declare your wishes as everyone's demand (like "We" in We need the 1/1 Mathcad "on error" as exemplified in "Image Rotate"), but please refrain claiming others failing when describing your endless failures, like everywhere in this forum, or in Mathcad Collaboratory - like that case, that you claimed later as "I defeated my detractors twice and for ever in this Colaboratory" and "I put units in the Reynolds number [unitless] but got result that none could decipher, even Mathsoft".
Best regards,
Mike Kaganski
thanks 1 user thanked mikekaganski for this useful post.
on 27/05/2016(UTC)
Offline Razonar  
#15 Posted : 27 May 2016 23:08:12(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post
Originally Posted by: Razonar Go to Quoted Post
here my jacobian works, but ... with a but.


Opened an issue: SS-2353


Just to remember it, this is the thread of the Script Region plugin; would be better to don't go too much off topic Good

edit: discussion about try function moved here.


Hi Davide. Thanks for move the post and make clean Uni's script plugin.

Best regards.

Alvaro.

Users browsing this topic
Similar Topics
try on error [to move in the one below] (Questions)
by Jean Giraud 25/05/2016 17:38:10(UTC)
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.