m***@gmail.com
2018-10-19 06:14:53 UTC
Note:
I don't know where this message is delivered.
However, anyone reading this, please help me. I'd like to add this program to my HP48GX.
It is for solving a system of linear equations. I plan to use it in my course of Electric Circuits (implies phasors and matrixes).
If anyone there can help me checking this code, please explain me how to enter it on the calculator because I don't understand the syntax at all.
The code is:
%%HP: T(2)A(D)F(.);
DIR
·\<-
« VARS 1 OVER
'·\<-' POS 1 - SUB
PURGE
»
SYS
« DUP SIZE \-> l
n
« n \->LIST
'EQS' STO 0 n
FOR i 1 n
FOR j i j
== 1 0 IFTE l j GET
STO
NEXT 1 n
FOR j '
EQS(j)' \->NUM
NEXT n
\->ARRY i
IF NOT
THEN NEG
'VET' STO
ELSE VET
+ ARRY\-> DROP
END
NEXT { n n
} \->ARRY l PURGE TRN
CONJ 'MAT' STO VET
MAT / n 1
FOR i DUP i
GET \->Q l i GET STO
-1
STEP DROP
MAT VET n 1 + COL+
'MAT' STO 'VET'
PURGE
»
»
END
Source and credits: http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv015.cgi?read=82010
PS. I don't have the PC adapter for the calc, therefore I need to do it all manually.
Thanks for investing time reading this.
-Mateo
I don't know where this message is delivered.
However, anyone reading this, please help me. I'd like to add this program to my HP48GX.
It is for solving a system of linear equations. I plan to use it in my course of Electric Circuits (implies phasors and matrixes).
If anyone there can help me checking this code, please explain me how to enter it on the calculator because I don't understand the syntax at all.
The code is:
%%HP: T(2)A(D)F(.);
DIR
·\<-
« VARS 1 OVER
'·\<-' POS 1 - SUB
PURGE
»
SYS
« DUP SIZE \-> l
n
« n \->LIST
'EQS' STO 0 n
FOR i 1 n
FOR j i j
== 1 0 IFTE l j GET
STO
NEXT 1 n
FOR j '
EQS(j)' \->NUM
NEXT n
\->ARRY i
IF NOT
THEN NEG
'VET' STO
ELSE VET
+ ARRY\-> DROP
END
NEXT { n n
} \->ARRY l PURGE TRN
CONJ 'MAT' STO VET
MAT / n 1
FOR i DUP i
GET \->Q l i GET STO
-1
STEP DROP
MAT VET n 1 + COL+
'MAT' STO 'VET'
PURGE
»
»
END
Source and credits: http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv015.cgi?read=82010
PS. I don't have the PC adapter for the calc, therefore I need to do it all manually.
Thanks for investing time reading this.
-Mateo