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

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Razonar  
#1 Posted : 29 November 2019 06:48:59(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 435
Uruguay

Was thanked: 236 time(s) in 145 post(s)
Hi. Something is wrong here, in both MProd functions, but can't figure what is it.
Thanks in advance.

mprod bug.sm (13kb) downloaded 19 time(s).

Alvaro.
Online Jean Giraud  
#2 Posted : 01 December 2019 04:06:11(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 4,134
Canada

Was thanked: 727 time(s) in 569 post(s)
Originally Posted by: Razonar Go to Quoted Post
Something is wrong here, in both MProd functions, but can't figure what is it.

Hola, Alvaro.
Not sure what you are attempting to do
1. Multiply a two cols matrix by a single number [2D rotation].
2. Multiply a 3 cols matrix by a 3x3 matrix [3D rotation]
3D rotation from Smath 3D [3 cols] creator.
Both exemplified Annalema.
3. RGB nxm matrix rotation [example Venturi RGB]
4. Square matrix [nxn] rotation [example Hyper-Surface]
Thanks Alvaro ... Jean

Image Rotate Matrix.sm (42kb) downloaded 11 time(s).
Analemma.sm (141kb) downloaded 9 time(s).
Image Rotate RGB.sm (349kb) downloaded 9 time(s).
Offline MBernacca  
#3 Posted : 02 December 2019 19:20:00(UTC)
MBernacca


Rank: Member

Groups: Registered
Joined: 28/11/2017(UTC)
Posts: 14
Italy
Location: Pisa

Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: Razonar Go to Quoted Post
Hi. Something is wrong here, in both MProd functions, but can't figure what is it.
Thanks in advance.

mprod bug.sm (13kb) downloaded 19 time(s).

Alvaro.


Hello Alvaro, I can't explain the problem, but I see that it originates from the way arguments are passed to MDot.
See attachment, writing arguments directly into MDot gives correct result, passing through row() and col() gives an "a not defined" error.
It seems that using row() and/or col() a numerical evaluation is triggered, even if the region is marked as "Symbolic".
Sorry, I can't give a better explanation.

Marco
mprod_bug_MBe.sm (17kb) downloaded 7 time(s).

P.S.: for matrix multiplication also index notation can be used, which works pretty nice in Smath.
I attach here an example, just in case it could be useful to somebody.
I wonder if Einstein notation could be implemented in Smath, so that summation symbols could be implicitly applied on mute indexes... maybe this is aking too much... Good
IndexNotation.sm (12kb) downloaded 11 time(s).

Edited by user 02 December 2019 20:05:26(UTC)  | Reason: Not specified

thanks 1 user thanked MBernacca for this useful post.
on 03/12/2019(UTC)
Online Jean Giraud  
#4 Posted : 02 December 2019 22:11:18(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 4,134
Canada

Was thanked: 727 time(s) in 569 post(s)
Originally Posted by: MBernacca Go to Quoted Post
Hello Alvaro, I can't explain the problem, but I see that it originates from the way arguments are passed to MDot.
See attachment, writing arguments directly into MDot gives correct result, passing through row() and col() gives an "a not defined" error.
It seems that using row() and/or col() a numerical evaluation is triggered, even if the region is marked as "Symbolic".
Sorry, I can't give a better explanation.

BTW: Thanks Marco for the Scilab/Smath Vector Intersection code.
I encountered many instances row(,,) col(,,)
that must be assigned as an algo
My understanding is like this:
1. Assume Alvaro has an 'n col vector A'
2. He wants to multiply any col or all [even in mixed order]
3. Multiplication by a number is immediate.
4. Multiplication by 'L length vector' needs a vectorize algo.
In the soon/next posted Rainbow it is ± what we are doing.
Instead of multiplying, we linterp.
Jean
Offline Razonar  
#5 Posted : 03 December 2019 13:17:24(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 435
Uruguay

Was thanked: 236 time(s) in 145 post(s)
Originally Posted by: MBernacca Go to Quoted Post
Originally Posted by: Razonar Go to Quoted Post
Hi. Something is wrong here, in both MProd functions, but can't figure what is it.
Thanks in advance.

mprod bug.sm (13kb) downloaded 19 time(s).

Alvaro.


Hello Alvaro, I can't explain the problem, but I see that it originates from the way arguments are passed to MDot.
See attachment, writing arguments directly into MDot gives correct result, passing through row() and col() gives an "a not defined" error.
It seems that using row() and/or col() a numerical evaluation is triggered, even if the region is marked as "Symbolic".
Sorry, I can't give a better explanation.

Marco
mprod_bug_MBe.sm (17kb) downloaded 7 time(s).

P.S.: for matrix multiplication also index notation can be used, which works pretty nice in Smath.
I attach here an example, just in case it could be useful to somebody.
I wonder if Einstein notation could be implemented in Smath, so that summation symbols could be implicitly applied on mute indexes... maybe this is aking too much... Good
IndexNotation.sm (12kb) downloaded 11 time(s).


Hi Marco. Thanks very much for your appointments. I go to take them in consideration for see the best way to extend dot product for some simple manipulations with symbolic algebra and taking the conjugate transpose instead the second argument.

Best regards.
Alvaro.
Offline Razonar  
#6 Posted : 03 December 2019 13:20:35(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 435
Uruguay

Was thanked: 236 time(s) in 145 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: Razonar Go to Quoted Post
Something is wrong here, in both MProd functions, but can't figure what is it.

Hola, Alvaro.
Not sure what you are attempting to do
...


Hi Jean. Just make very simple math, checking how to write the elemental things in SMath. If not, how to write something more complex?

Best regards.
Alvaro.
Offline Razonar  
#7 Posted : 04 December 2019 13:19:33(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 435
Uruguay

Was thanked: 236 time(s) in 145 post(s)
Originally Posted by: MBernacca Go to Quoted Post

It seems that using row() and/or col() a numerical evaluation is triggered, even if the region is marked as "Symbolic".
Sorry, I can't give a better explanation.

Marco


Hi. Enogh to know that problem it's in row and col functions. Even I can't write the code for them, seems to be solved the issue rewriting length function.

mprod_workaround.sm (8kb) downloaded 7 time(s).

Same solution it's used for Lagrange equations with vectors.

Best regards.
Alvaro.
Online Jean Giraud  
#8 Posted : 04 December 2019 16:34:09(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 4,134
Canada

Was thanked: 727 time(s) in 569 post(s)
Originally Posted by: Razonar Go to Quoted Post
Even I can't write the code for them,

Alvaro ... is that what you are looking for ?

Mprod.PNG

Utilities Matrix Product[X,Y].sm (17kb) downloaded 4 time(s).
Offline MBernacca  
#9 Posted : 04 December 2019 18:30:11(UTC)
MBernacca


Rank: Member

Groups: Registered
Joined: 28/11/2017(UTC)
Posts: 14
Italy
Location: Pisa

Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: Razonar Go to Quoted Post
Originally Posted by: MBernacca Go to Quoted Post

It seems that using row() and/or col() a numerical evaluation is triggered, even if the region is marked as "Symbolic".
Sorry, I can't give a better explanation.

Marco


Hi. Enogh to know that problem it's in row and col functions. Even I can't write the code for them, seems to be solved the issue rewriting length function.

mprod_workaround.sm (8kb) downloaded 7 time(s).

Same solution it's used for Lagrange equations with vectors.

Best regards.
Alvaro.


Hello everybody. More on the strange behaviour of function "lenght()". See attached.
Anybody can explain why lenght() does not accept the evaluation operator?
Thanks
Marco

Lenght_MBe.sm (9kb) downloaded 6 time(s).

P.S.: Sorry, my mistake. Do not consider this post. I just mispelled the function...Confusion

Edited by user 04 December 2019 18:34:03(UTC)  | Reason: Not specified

Online Jean Giraud  
#10 Posted : 04 December 2019 21:00:26(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 4,134
Canada

Was thanked: 727 time(s) in 569 post(s)
Originally Posted by: MBernacca Go to Quoted Post
Anybody can explain why lenght() does not accept the evaluation operator?

Maybe I don't understand ...

length.PNG
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.