ryanm1 Honor Student
Honor Student
3 1 0 0
Message 1 of 4
238
Flag Post
HP Recommended

HP prime - Matrix inversion rounding erro

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
PhD Student
PhD Student
497 484 79 143
Message 2 of 4
213
Flag Post
HP Recommended

HP prime - Matrix inversion rounding erro

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-
Reply
0 Kudos
ryanm1 Honor Student
Honor Student
3 1 0 0
Message 3 of 4
211
Flag Post
HP Recommended

HP prime - Matrix inversion rounding erro

That worked, thank you!

 

 

Reply
0 Kudos
Grad Student Grad Student
Grad Student
190 189 34 64
Message 4 of 4
182
Flag Post
HP Recommended

HP prime - Matrix inversion rounding erro

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
Reply
0 Kudos
† 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