cancel
Showing results for 
Search instead for 
Did you mean: 
ryanm1
New member
3 1 0 0
Message 1 of 4
342
Flag Post

HP prime - Matrix inversion rounding erro

HP Recommended
HP Prime
Other

My HP prime is inverting matrices incorrectly. (I know because I am comparing the results against MATLAB and textbook examples.

 

For example, inverting the following matrix,

[821667 308125

308125 616250]

 

returns

 

[1.4979e-6 0

0 1.9972e-6] ****This is an icorrect answer

 

The correct answer is

 

[.1498 -0.0749

-0.0749 0.1997]*1e-5

 

Why is the calculator zeroing out those two values of the matrix instead of returning the correct values? I have tried manipulating the settings several different ways and still get the incorrect results.

 

I am performing these calculations in home screen in RPN mode. The calculator seems to be able to invert this matrix correctly in CAS mode, but this is useless to me because I need to perform calculations in the stack. CAS gives me improper fractions so I can't do anything with them.

 

I recently took an exam that required matrix inversion and I failed it because my calculator kept giving me bogux answers.

 

 

 

Any help would be appreciated.

3 REPLIES 3
Joe_Horn
Level 8
649 634 124 222
Message 2 of 4
Flag Post
HP Recommended

Until somebody gives a better reply, here's a workaround that might help you. If you store your matrix in M1, then type 1./M1 in CAS (be sure to include that decimal point!), you'll get the result you're looking for.  OR you can turn off the "Exact" setting in the CAS Settings screen.

 

Disclaimer: I don't work for HP. I'm just another HP calculator fanatic.

-Joe-
Was this reply helpful? Yes No
ryanm1
Author
New member
3 1 0 0
Message 3 of 4
Flag Post
HP Recommended

That worked, thank you!

 

 

Was this reply helpful? Yes No
cyrille
Level 6
Level 6
252 251 42 78
Message 4 of 4
Flag Post
HP Recommended

Hello,

 

In home, the result will be rounded to 0 as "most times", numerical matrix inversion will result in small, close to 0, but not 0, while it should have been 0.

 

Of course, you here, have a counter example where indeed, the result should NOT be 0 and where the Prime "default" round to 0 behavior is incorrect.

 

The best way to solve this is to do the calculations in the CAS where you will get EXACT result and not approximate ones. This should solve your problem.

 

Cyrille

I am an HP Employee
Was this reply helpful? Yes No
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation