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 : 05 February 2016 19:25:33(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)
Hello Ioan,

If you go back few weeks ago in my huge "Matrix Treasury", you will notice that
the Smath matrix stuff works identical to Mathcad . Particularly well to stack/augment
included in program to nest/unest. "ForLoopSelect" and a many of these precious tools
work just perfect. One matrix function does not work logical, i.e: submatrix.
Example: you want the mirror matrix in Mathcad, just reverse the column order.
In Smath: niet kamarad. In Mathcad, you can reuse same variable name for a matrix
just preceed the new assignment M:= 0 ... in Smath, that does not work. You can reuse
same variable name providing the new vector/matrix is of longer dimension as it starts
storing new stuff from its own ORIGIN. The other thing to bear in mind is the local
definition that Smath does not have working as in Mathcad. Often we make it work, often
it's not possible. The other case is that Smath does not accept an index as a variable.
It toke me days to make de Boor work because of the index in the construction. Another
thing is the <, >. Generally it must be complete <_ but exceptionaly it must be incomplete.

The smoothlet "Ksmooth" is a case of the index in the definition => local assigment in
the program, works well but slow.

Salut Ioan and all Smath contributors.

Jean

thanks 1 user thanked Jean Giraud for this useful post.
on 05/02/2016(UTC)

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

Offline Davide Carpi  
#2 Posted : 05 February 2016 19:32:11(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)
Hello Ioan,

Definetly a bug. Seems the problem is in augment vs unary subtraction in matrices vs symbolic optimization

2016-02-05 17_42_01-SMath Studio Desktop - [BigBug.sm_].png

In the example above, for the symbolic evaluation of f(0):
- if k1 is a number, all goes right;
- if k1 is a matrix and k2:=-k1 -> wrong augment
- if k1 is a matrix and k2:=eval(-k1) or k2:=-1*k1 -> ok

No problems if the evaluation is numeric.

In your example the evaluation of RkL:Hing3d(DaStr) is set to symbolic.

2016-02-05 17_45_21-SMath Studio Desktop - [BigBug.sm].png


Reported as bug 2292

Edited by user 20 May 2016 21:58:54(UTC)  | Reason: marked ad fixed

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 05/02/2016(UTC)
Offline Davide Carpi  
#3 Posted : 05 February 2016 21:20:41(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: Davide Carpi Go to Quoted Post
In your example the evaluation of RkL:Hing3d(DaStr) is set to symbolic.

This is not important, sorry to have mentioned it.


The problem is all about the augment() function, the optimization, and unary subtraction in matrices.

You can test in the attachment that the issue can be replicated in the canvas, without lines and functions. Since k2:=-k1 is not evaluated numerically, the bug in augment is triggered (subtraction sign lost). augment.sm (6kb) downloaded 11 time(s).

2016-02-05 19_12_33-SMath Studio Desktop - [augment.sm].png

If you change the optimization of k2 to numeric you can see that the sign is moved from outside the matrix to the elements (and the minus sign is no more lost by augment)

2016-02-05 19_15_45-SMath Studio Desktop - [augment.sm_].png
2016-02-05 19_16_22-SMath Studio Desktop - [augment.sm_].png

Inside the lines:
- you can trigger the error in your A sequence (line on the canvas) changing the optimization;
- in B seems that the optimization choosen doesn't change the (wrong) output -> I suppose that inside the functions the optimiztion is by default set to none or symbolical (not sure if this applies to any level or on nested functions, needs more tests)


Originally Posted by: ioan92 Go to Quoted Post
Finally, I mention that I pointed already (almost a year ago), Bug SS-2269, a similar case, without a minimum echo. Mad

Totally missed, I'll look at it ASAP.

Edited by user 05 February 2016 21:26:15(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
thanks 1 user thanked Davide Carpi for this useful post.
on 05/02/2016(UTC)
Offline Jean Giraud  
#4 Posted : 05 February 2016 22:53:39(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)
Smath is reliable. Watch the 32 bit resulting granularity.
XP Home is 64 bits extended, XP Pro is 32 bits. Even if Smath
would be 64 bits extended, in my XP Pro: still 32 bits.
I understand Andrey not bothering with XP's obsolete
Vista obsolete ... nextnextnext obsolete.

Back to the matrix/vector bug; there is no bug, just
wrong user coding wrt matrix/vector conventions.
-k1 does not negate the matrix. To negate a matrix it
must be multipled in the appropriate order by a scalar .
Here your scalar is 1 it is equivalent to the combined
Euler rotation ... you must write k2:= k1*(-1)
............................NOT k2:=(1)*k1
though Smath does accept this non-conventional rule.

Remenber the rule k2:= k1*(-1) to be in convention
with conventional software [typical Mathcad 8.... 11]
Probably convention in Western Avionics.

Jean

Utilities Matrix Bug.sm (13kb) downloaded 13 time(s).

Offline Jean Giraud  
#5 Posted : 05 February 2016 23:38:52(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)
... last word: the vector /matrix rotation is data*(rotfunction)
Not the other way around [Syntax error]. In your definition -k1
underscore (_)is a variable name. That Smath interprets eval(,)
as meaning k1*(-1), can't explain to myself.

Jean
Offline Jean Giraud  
#6 Posted : 06 February 2016 02:52: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)
Ioan,

I'm scared "mon ami" that if you doctor something in there
you might kill several birds with one stone. What about
our friend Dragilev animations ? For practical use in the
common context, the rule is the vector/matrix rule. I can
see some geometric applications. As you can see, there is
only one way to rotate the star. Other subuse should go by
the same rules. Can't please every wish. The most lucky is
the farmer : on Sunday he can please his wife [she gets
coquette un brin] and his horse [no hard work scheduled].

I bet the vector/matrix rule dates back to Euler times ?
If not otherwise confirmed, symbolic returns untreated
expression, just like Maple.

jean

Analemma Star.sm (41kb) downloaded 14 time(s).
Offline Davide Carpi  
#7 Posted : 06 February 2016 12:18:47(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)
I have Scilab, Octave, FreeMat (and more); in all of these -Matrix, scalar*Matrix, Matrix*scalar are allowed... don't know if this is not correct as mathematical principle, anyway if this is allowed in the program it must be consistent, otherwise there is a bug (f.e. stack and augment they produce 2 different results -> this is a bug)

Edited by user 06 February 2016 12:25:15(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
thanks 1 user thanked Davide Carpi for this useful post.
on 06/02/2016(UTC)
Offline Davide Carpi  
#8 Posted : 06 February 2016 14:12:40(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: ioan92 Go to Quoted Post
I mention that I pointed already (almost a year ago), Bug SS-2269, a similar case, without a minimum echo


SS-2269: the problem is in row()... to know what is the cause we are in the hands of Andrey Good
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 06/02/2016(UTC)
Offline mkraska  
#9 Posted : 06 February 2016 20:49:18(UTC)
mkraska


Rank: Advanced Member

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

Was thanked: 1124 time(s) in 721 post(s)
There is just one very simple rule:

If you want reliable results, don't use symbolic optimization.

There are several bugs related to symbolic optimization in the BTS.
Particularly annoying is that you can't tell what optimization is used without consulting the context menu.
There is a long standing proposal to have different symbols for numeric or symbolic evaluation and assignment.
In the early days -> was the symbol for symbolic evaluation and = meant numeric evaluation.

This has been removed not to the better of SMath. Maybe, that is patent protected...
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Jean Giraud  
#10 Posted : 06 February 2016 21:43:30(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: ioan92 Go to Quoted Post
My main concern is not to create nor to criticize SMath but simply to use it.


Can't be more right: Ioan, Martin, Davide as long as the rules are simple algebraic.
Working with "Advanced Algebra" is known as symbolic in scalar maths, that is the great
Maple, Mathematica [two different engines considered ~ equivalent].
Vectors/matrices also go by their own "Advanced Rules". That starts by "baby logic"
I have a matrix, I want it it to be all elements be negative. So the logic comes
what I have I mutltiply. Even if the matrix multiplication is commutative, it's
non sense saying I have (-1) then multiply by something [i.e: matrix].

That's why advanced matrix algebra follow this rule.
In the attached, you can see two applications of advanced vector/matrix algebra.

1. Convolution
2. Cholesky solver.

They go strictly by the rules the "Mathematicians Society" have established to
work universally for all user. To complicate matters, even advanced vector/matrix
algebra are limited in solving. Many decades ago, Souriau [don't recall the decade]
found out a way to transform unusable matrix to usable one : PseudoMatrix by a process
of PseudoInversion [Mathcad "geninv']. What's that doing ? putting wings to stones !

Once in PseudoInverse form, a chemical balance of fractional composition can be
solved generally and in the right proprotion of all "inter actants".

I bet Knovel [essentially Smath] has that implemented... [in visible code ?]

Reverse the order in the "convolution" ... Syntax error or not in correct order.
Cholesky solver is not commutative either.
Think more: think in term of "Eigen stuff" from which "polyroots results".

Follow the rules: don't drive RHS in UK, don't drive LHS in US/Canada.

For an unknown reason to me, in wide routes, horses naturally drove LHS,
English toke it as is. Unfortunately the "church" couldn't burn to stake all
horses to teach them a lesson. But ± imposed human not to be as stupid as the horse.

Working with advanced matrix algebra is like working with Fourier, Laplace...
You convert in the "transform domain", proceed in that domain, reverse from the
"transform domain" back to normal domain and something happened. Isn't great !

Good thing: Smath obeys "advanced Matrix algebra". Just border line in some
applications.

Jean

Convol.sm (100kb) downloaded 20 time(s).

thanks 1 user thanked Jean Giraud for this useful post.
on 07/02/2016(UTC)
Offline Jean Giraud  
#11 Posted : 07 February 2016 04:02:44(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 have not seen where it is your Cholesky solver.
==> Below the convolution data set, we fit with a Lagrange 5th degree polynomial.
==> Description shows "Chlesky solver", highlighted in red, as simple as it looks.
==> It solves the "Matrix construction" in the LS sense [LS = least square].
==> Nothing better has been found through centuries. It has been optimised by
==> Levenberg-Marquardt., which Smath has but don't know how to make it work.
==> RenToDo, Jean ... LM parametric fit to model function(s). That would enrich
==> Smath with the glorious Padé rational function.

Is it normal that the same calculation sequence gives a result when used in a free
linear disposition and gives other result when settled behind a function name???
Are we using a deterministic tool or not ?

==> Yes, we are using a deterministic tool wrt the "deterministic coding" [too circular ?].
==> Quite right: Smath coding does not make noise. At least it is tracable and piecewise
==> checkable. On the other hand, many take too big the bite with not enough knowledge
==> base about Smath [myself the first].

Jean
Offline Jean Giraud  
#12 Posted : 07 February 2016 09:01:02(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)
My dear friends, you can't image how much I'm pedalllllling to rotate an image.
If it works, will burn a candle ... maybe the barn too.
0K, it will be graysaclae, but who cares ? Bed time.

Jean
Offline Jean Giraud  
#13 Posted : 08 February 2016 04:56:29(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)
Ioan,

Tout ça, c'est "La Quadrature du Cercle" [Squaring the Circle].
Using any CAS is like "pushing the greasy round pig in the square hole"
Mathematica 4.0 had a list of bugs. From recollection, I think Uni mentionned
Maple had bugs too. In many aspects, IMHO, Smath is more educative than the
Mathcad 8 ... 11. Though this application was superb, many things go by themselves
keeping the user blind of the gear box. The concept of this forum is exceptional,
it shortens the Smath learning curve.

Lot more to come as well as spring time.

Jean
Users browsing this topic
Guest
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.