Matrix multiplication

Matrix multiplication - Сообщения

#1 Опубликовано: 29.11.2019 00:48:59
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Hi. Something is wrong here, in both MProd functions, but can't figure what is it.
Thanks in advance.

mprod bug.sm (12 КиБ) скачан 99 раз(а).

Alvaro.
#2 Опубликовано: 30.11.2019 22:06:11
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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 (41 КиБ) скачан 70 раз(а).
Analemma.sm (140 КиБ) скачан 51 раз(а).
Image Rotate RGB.sm (348 КиБ) скачан 47 раз(а).
#3 Опубликовано: 02.12.2019 13:20:00
MBe

MBe

2 сообщений из 21 понравились пользователям.

Группа: User

Wrote

Hi. Something is wrong here, in both MProd functions, but can't figure what is it.
Thanks in advance.

mprod bug.sm (12 КиБ) скачан 99 раз(а).

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 (16 КиБ) скачан 60 раз(а).

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...
IndexNotation.sm (11 КиБ) скачан 68 раз(а).
1 пользователям понравился этот пост
Alvaro Diaz Falconi 03.12.2019 07:12:00
#4 Опубликовано: 02.12.2019 16:11:18
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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
#5 Опубликовано: 03.12.2019 07:17:24
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Wrote

Wrote

Hi. Something is wrong here, in both MProd functions, but can't figure what is it.
Thanks in advance.

mprod bug.sm (12 КиБ) скачан 99 раз(а).

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 (16 КиБ) скачан 60 раз(а).

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...
IndexNotation.sm (11 КиБ) скачан 68 раз(а).



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.
#6 Опубликовано: 03.12.2019 07:20:35
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Wrote

Wrote

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.
#7 Опубликовано: 04.12.2019 07:19:33
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Wrote


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 (7 КиБ) скачан 46 раз(а).

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

Best regards.
Alvaro.
#8 Опубликовано: 04.12.2019 10:34:09
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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 (16 КиБ) скачан 48 раз(а).
#9 Опубликовано: 04.12.2019 12:30:11
MBe

MBe

2 сообщений из 21 понравились пользователям.

Группа: User

Wrote

Wrote


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 (7 КиБ) скачан 46 раз(а).

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 (8 КиБ) скачан 35 раз(а).

P.S.: Sorry, my mistake. Do not consider this post. I just mispelled the function...
#10 Опубликовано: 04.12.2019 15:00:26
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Anybody can explain why lenght() does not accept the evaluation operator?


Maybe I don't understand ...

length.PNG
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений