All calculation are equal but complex number are more equal...?
All calculation are equal but complex number are more equal...?
Hi,
I have a complex 2x2 matrix on the stack, position X.
It is filled with complex numbers != 0.
I enter "2" and press Y^X ... and get "Invalid Type"
Same setup...same matrix at position X of the stack.
I press X^2 and the result is returned in the matrix.
Why doesn't the first work but the second does ?
From the mathematical point of view they are the same.
Cheers!
mcc
I have a complex 2x2 matrix on the stack, position X.
It is filled with complex numbers != 0.
I enter "2" and press Y^X ... and get "Invalid Type"
Same setup...same matrix at position X of the stack.
I press X^2 and the result is returned in the matrix.
Why doesn't the first work but the second does ?
From the mathematical point of view they are the same.
Cheers!
mcc
DM 42  SN: 00373, Firmware v.:3.11. / 3.11. as compiled by SwissMicros
Re: All calculation are equal but complex number are more equal...?
AFAIK (IIRC) matrix exponentiation isn't defined for the general case.
DM42 SN: 00041  Follower of Platon.
HP35, HP45, ..., HP50, WP 34S, WP 31S, DM16L
HP35, HP45, ..., HP50, WP 34S, WP 31S, DM16L
Re: All calculation are equal but complex number are more equal...?
The real HP42S does the same thing.
Re: All calculation are equal but complex number are more equal...?
Hi,
better....
Here is the defintion of matrix exponential:
https://en.wikipedia.org/wiki/Matrix_exponential
Looks way more stuff as "doesn't work in general" but is far beyond
the stuff I would understood...
Is there a mathmatician here ?
Cheers!
mcc
...repeating (possible) bug/annoyance with a new implementation make not
better....
Here is the defintion of matrix exponential:
https://en.wikipedia.org/wiki/Matrix_exponential
Looks way more stuff as "doesn't work in general" but is far beyond
the stuff I would understood...
Is there a mathmatician here ?
Cheers!
mcc
DM 42  SN: 00373, Firmware v.:3.11. / 3.11. as compiled by SwissMicros
Re: All calculation are equal but complex number are more equal...?
True, but any HP42S program that relies on this behaviour will be broken if this is "fixed".
That is why s good simulator will simulate the behaviour of the original exactly, warts & all. Even the bits that are not necessarily mathematically correct.
Not SwissMicros staff, just an enthusiast.
Re: All calculation are equal but complex number are more equal...?
No, they are not. X^2 is clearly defined as multiplying the matrix by itself. Y^X, on the other hand, opens Pandora's box by allowing also noninteger exponents  for such cases, however, matrix exponentiation is not defined as is written in Wikipedia as well. So, since the calculator can't impede you from entering or using noninteger X in Y^X operating on a matrix Y, it doesn't allow Y^X operating on matrices at all. This is a wise decision IMHO.mcc wrote: ↑Fri Nov 16, 2018 7:32 amI have a complex 2x2 matrix on the stack, position X.
It is filled with complex numbers != 0.
I enter "2" and press Y^X ... and get "Invalid Type"
Same setup...same matrix at position X of the stack.
I press X^2 and the result is returned in the matrix.
Why doesn't the first work but the second does ?
From the mathematical point of view they are the same.
DM42 SN: 00041  Follower of Platon.
HP35, HP45, ..., HP50, WP 34S, WP 31S, DM16L
HP35, HP45, ..., HP50, WP 34S, WP 31S, DM16L
Re: All calculation are equal but complex number are more equal...?
X^2 will square all the matrix elements, it will not square the matrix.
Only (all?) singleargument functions will work on all elements of the matrix.
Eg. MOD doesn't work, but SIN, IP, SIGN, XTOA etc. work.
Cheers, Werner
Only (all?) singleargument functions will work on all elements of the matrix.
Eg. MOD doesn't work, but SIN, IP, SIGN, XTOA etc. work.
Cheers, Werner
42S #3249S01123
DM42 #00345
DM42 #00345
Re: All calculation are equal but complex number are more equal...?
Also, the +, , *, / operations between a number and a matrix apply the operation to each element of the matrix, so they could have done the same thing for y^x, at least when Y is a matrix and X is a number.
It shouldn't be too hard to write a program to raise a square matrix to an integer power (assuming the matrix is invertible in the case of negative powers), but to optimize the number of matrix multiplications required, the absolute value of the exponent should be decomposed into a sum of powers of 2. In fact, Gerald H has already written such a program and posted it on the HPMuseum forum: http://www.hpmuseum.org/forum/thread3096.html
Re: All calculation are equal but complex number are more equal...?
Rats! I tend to forget that. I was reacting on the "matrix exponential" quoted by mcc.
Not all. 1/x inverts the matrix. Consistency, you're called HP.
DM42 SN: 00041  Follower of Platon.
HP35, HP45, ..., HP50, WP 34S, WP 31S, DM16L
HP35, HP45, ..., HP50, WP 34S, WP 31S, DM16L

 Posts: 492
 Joined: Tue May 02, 2017 3:48 pm
 Location: New Jersey, USA
 Contact:
Re: All calculation are equal but complex number are more equal...?
No, it doesn't. INVRT inverts a matrix, 1/x inverts its elements.
Last edited by Thomas Okken on Sat Nov 17, 2018 1:55 pm, edited 1 time in total.