Post Reply 
(38G) 40G: Matrix Power Programme
03-13-2015, 06:11 PM (This post was last modified: 11-26-2023 02:55 PM by Gerald H.)
Post: #1
(38G) 40G: Matrix Power Programme
Edit: Amended to include negative powers.

Edit: Programme slightly more elegant.

Edit: Amended to avoid errors for some powers > 5*10^11.

A lack in the 38G & 40G (not the 40gs) is the inability to find integer powers ≠ 2 or -1 of matrices.

This programme supplies the lack.

Store the matrix to power in M1, enter the integer power on the stack in HOME view & activate the programme.

The powered matrix is recalled as Ans in HOME view & is also stored in M2.

M1 remains unchanged.

Code:
Ans►N:
IFTE(N<0,INVERSE(M1),M1)►M3:
ABS(N)►N:
SIZE(M1):
IDENMAT(Ans(1))►M2:
WHILE N
REPEAT
IF
N MOD 2
THEN
M3*M2►M2:
N-1►N:
END:
M3^2►M3:
N/2►N:
END:
M2:
Find all posts by this user
Quote this message in a reply
03-15-2015, 04:45 AM
Post: #2
RE: HP 38G & 40G: Matrix Power Programme
Thank you Gerald for these programs. Programs for these calculators are few and far between.

François
Find all posts by this user
Quote this message in a reply
03-20-2015, 12:58 PM (This post was last modified: 03-20-2015 12:59 PM by Gerald H.)
Post: #3
RE: HP 38G & 40G: Matrix Power Programme
(03-15-2015 04:45 AM)Francois Lanciault Wrote:  Thank you Gerald for these programs. Programs for these calculators are few and far between.

François

Thanks for the recognition.

It would be nice if others published their programmes.
Find all posts by this user
Quote this message in a reply
03-24-2015, 08:05 AM
Post: #4
RE: HP 38G & 40G: Matrix Power (New - Includes Negative Powers) Programme
Just to advise of the latest edit to include negative powers.
Find all posts by this user
Quote this message in a reply
03-30-2015, 01:35 PM
Post: #5
RE: HP 38G & 40G: Matrix Power (New - Includes Negative Powers) Programme
Much gratitude, Gerald.
Visit this user's website Find all posts by this user
Quote this message in a reply
05-18-2016, 10:08 AM
Post: #6
RE: HP 38G & 40G: Matrix Power Programme
Just to advise of latest edit, avoiding errors for some powers > 5*10^11.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)