Post Reply 
(DM42) Matrix exponential
08-21-2023, 12:11 AM (This post was last modified: 08-21-2023 12:57 AM by Albert Chan.)
Post: #18
RE: (DM42) Matrix exponential
EXPM1(Matrix X) for HP71B

10 DESTROY ALL @ OPTION BASE 1
20 INPUT "N=";N @ DIM X(N,N),T(N,N),R(N,N)
30 MAT INPUT X
40 S=10^MAX(0,EXPONENT(MAXAB(X))+4) @ MAT X=(1/S)*X
50 MAT R=(1/4)*X @ MAT T=IDN @ MAT R=R+T
60 MAT R=(1/3)*R @ MAT R=R*X @ MAT R=R+T
70 MAT R=(1/2)*R @ MAT R=R*X @ MAT R=R+T
80 MAT R=R*X @ MAT X=R
90 DISP FNF(S) @ DISP @ MAT DISP R @ END

200 DEF FNF(K) @ IF K<=1 THEN 250
210 DISP FNF(K DIV 2);
220 MAT T=R*R @ MAT R=R+R @ MAT R=R+T
230 IF MOD(K,2)=0 THEN 250
240 MAT T=R*X @ MAT T=T+X @ MAT R=R+T
250 FNF=K @ END DEF

>RUN
N=3
X(1,1)? 1
X(1,2)? 2
X(1,3)? 3
X(2,1)? 4
X(2,2)? 5
X(2,3)? 6
X(3,1)? 7
X(3,2)? 8
X(3,3)? 9

1  2  4  9  19  39  78  156  312  625  1250  2500  5000  10000

1118905.69939      1374815.06290      1630724.42641
2533881.04184      3113414.03128      3692947.02074
3948856.38427      4852012.99966      5755169.61507
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (DM42) Matrix exponential - Gil - 08-11-2023, 11:46 PM
RE: (DM42) Matrix exponential - Albert Chan - 08-21-2023 12:11 AM
RE: (DM42) Matrix exponential - Gil - 08-12-2023, 10:01 AM
RE: (DM42) Matrix exponential - Gil - 08-12-2023, 08:26 PM
RE: (DM42) Matrix exponential - Gil - 08-12-2023, 08:55 PM
RE: (DM42) Matrix exponential - Gil - 08-13-2023, 10:51 AM
RE: (DM42) Matrix exponential - Gil - 08-13-2023, 09:46 PM
RE: (DM42) Matrix exponential - Gil - 08-15-2023, 11:42 PM
RE: (DM42) Matrix exponential - John Keith - 08-16-2023, 12:01 PM
RE: (DM42) Matrix exponential - Gil - 08-16-2023, 12:45 PM
RE: (DM42) Matrix exponential - Werner - 08-23-2023, 07:16 AM
RE: (DM42) Matrix exponential - John Keith - 08-27-2023, 04:46 PM
RE: (DM42) Matrix exponential - Gil - 08-23-2023, 09:09 AM
RE: (DM42) Matrix exponential - Werner - 08-24-2023, 01:14 PM
RE: (DM42) Matrix exponential - Gil - 08-28-2023, 08:57 AM



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