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
All calculation are equal but complex number are more equal...?
All calculation are equal but complex number are more equal...?
DM 42 - SN: 00373, Firmware release v.:3.22. / DMCP 3.24. 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.
WP43 SN00000, 34S, and 31S for obvious reasons; HP-35, 45, ..., 35S, 15CE, DM16L S/N# 00093, DM42β SN:00041
Re: All calculation are equal but complex number are more equal...?
The real HP-42S 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 release v.:3.22. / DMCP 3.24. as compiled by SwissMicros
Re: All calculation are equal but complex number are more equal...?
True, but any HP-42S 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.
There are only 10 kinds of people in the world: those who understand binary and those who do not.
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 8: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.
WP43 SN00000, 34S, and 31S for obvious reasons; HP-35, 45, ..., 35S, 15CE, DM16L S/N# 00093, DM42β SN:00041
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?) single-argument 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?) single-argument functions will work on all elements of the matrix.
Eg. MOD doesn't work, but SIN, IP, SIGN, XTOA etc. work.
Cheers, Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
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 HP-Museum forum: http://www.hpmuseum.org/forum/thread-3096.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.
WP43 SN00000, 34S, and 31S for obvious reasons; HP-35, 45, ..., 35S, 15CE, DM16L S/N# 00093, DM42β SN:00041
-
- Posts: 1100
- Joined: Tue May 02, 2017 5:48 pm
- Location: Netherlands
- 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 2:55 pm, edited 1 time in total.