The following warnings occurred:
Warning [2] Undefined array key 180091 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 180091 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





Symbolic Complex Linear System Solver (HP-28S, HP-48G/GX and HP-50g)



#2

This program was written many years ago by Francisco Matheus, one of my classmates back then, originally for the HP-28S. It was particularly useful during Circuit Analysis examinations. The program would accept symbolic equations, no further rearrangement being necessary, which was very impressive.

The author has authorized its free use with the hope it continues to be useful for EE students. No warranty shall be provided though. Test it on your textbook examples before you decide it's suitable for your needs. The HP-48G/GX and HP-50g built-in linear system solver is an option.

1) V1 - V2 = 10*Ix

2) V1/j20 + (V1 - V3)/20 + V2/10 + (V2 - V3)/-j10 = 0

3) V3/j10 + (V3-V2)/-j10 + 2/-45 + (V3 - V1)/20 = 0

4) Ix = -V3/j10

where j = sqrt(-1) and 2/-45 is 2 angle -45 degrees.

As an example, the equations in the linear system above would be entered as

'V1-V2=10*IX'
'V1/(0,20)+(V1-V3)/20+V2/10+(V2-V3)/(0,-10)=0'
'V3/(0,10)+(V3-V2)/(0,-10)+(1.41421356237,-1.41421356237)+(V3-V1)/20=0'
'IX=-V3/(0,10)'

On the HP-28S 2/-45 would have to be previously converted from polar to retangular coordinates. Notice the number of equations could have been reduced to three by substituting eq. 4 in eq. 1, but we'll use the example as it has been presented.

Copy the programs to an empty HP-28S directory. Enter the four equations of the example system, enter the list of unknowns {V1 V2 V3 IX} then run SYS program to solve the linear system. The '<-' program cleans up the directory, that is, it purges all objects at the left of it in the menu.

The lines below can be copied and pasted to Emu42 with an HP-28S ROM and then saved to 'SYS', '<-' and 'EQS', respectively, after applying the STR-> command. ( '<-' should be entered as 142 CHR STR-> )

’ 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
l i GET STO -1
STEP VET ARRY
DROP { n 1 } ARRY
'VET' STO DROP

’ VARS 1 OVER 'Ž'
POS 1 - SUB PURGE

{ 'V1-V2=10*IX' 'V1/
(0,20)+(V1-V3)/20+V2
/10+(V2-V3)/(0,-10)=
0' 'V3/(0,10)+(V3-V2
)/(0,-10)+
(1.41421356237,-1.41421356237)
+(V3-V1)/20=0' 'IX=-
V3/(0,10)' }

Contents of the directory after the example linear system is solved

HP-28S Version:

--------------------------

V1 (-1.88561808316,
-24.5130350811)
V2 (-1.88561808316,
-5.65685424948)
V3 (-18.8561808316,0)
IX (0,-1.88561808316)
MAT
[[ (1,0) (-1,0) (0,0) (-10,0) ]
[ (.05,-.05) (.1,.1) (-.05,-.1) (0,0) ]
[ (-.05,0) (0,-.1) (.05,0) (0,0) ]
[ (0,0) (0,0) (0,-.1) (1,0) ]]
VET
[[ (0,0) ]
[ (0,0) ]
[ (-1.41421356237,1.41421356237) ]
[ (0,0) ]]
EQS { 'V1-V2=10*IX' 'V1/
(0,20)+(V1-V3)/20+V2
/10+(V2-V3)/(0,-10)=
0' 'V3/(0,10)+(V3-V2
)/(0,-10)+
(1.41421356237,-1.41421356237)
+(V3-V1)/20=0' 'IX=-
V3/(0,10)' }

<-
« 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
l i GET STO -1
STEP VET ARRY\->
DROP { n 1 } \->ARRY
'VET' STO DROP
»
»

--------------------------

HP-48G/GX Version:

On the HP-48G/GX and the HP-50g, the third equation can be entered as

'V3/(0,10)+(V3-V2)/(0,-10)+(2,/-45)+(V3-V1)/20=0'

On the HP-48G/GX the angle symbol '/ ' is accessible through right-shift SPC (ALPHA right-shift 6 on the HP-50g).

--------------------------

%%HP: T(3)A(D)F(.);
DIR
V1 (-1.88561808316,-24.5130350811)
V2 (-1.88561808316,-5.65685424948)
V3 (-18.8561808316,0)
IX (0,-1.88561808316)
MAT
[[ (1,0) (-1,0) (0,0) (-10,0) (0,0) ]
[ (.05,-.05) (.1,.1) (-.05,-.1) (0,0) (0,0) ]
[ (-.05,0) (0,-.1) (.05,0) (0,0) (-1.41421356237,1.41421356237) ]
[ (0,0) (0,0) (0,-.1) (1,0) (0,0) ]]
EQS { 'V1-V2=10*IX' 'V1/(0,20)+(V1-V3)/20+V2/10+(V2-V3)/(0,-10)=0' 'V3/(0,10)+(V3-V2)/(0,-10)+(1.41421356237,-1.41421356237)+(V3-V1)/20=0' 'IX=-V3/(0,10)' }
\183\<-
\<< VARS 1 OVER '\183\<-' 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 l i GET STO -1
STEP DROP MAT VET n 1 + COL+ 'MAT' STO 'VET' PURGE
\>>
\>>
END

--------------------------

HP-50g Version:

CAS mode should be set to Complex.

--------------------------
%%HP: T(3)A(D)F(.);
DIR
V1 (-1.88561808316,-24.5130350811)
V2 (-1.88561808317,-5.65685424948)
V3 (-18.8561808316,0.)
IX (0.,-1.88561808316)
MAT
[[ (1.,0.) (-1.,0.) (0.,0.) (-10.,0.) 0. ]
[ (.05,-.05) (.1,.1) (-.05,-.1) (0.,0.) (0.,0.) ]
[ (-.05,0.) (0.,-.1) (.05,0.) (0.,0.) (-1.41421356237,1.41421356237) ]
[ (0.,0.) (0.,0.) (0.,-.1) (1.,0.) (0.,0.) ]]
EQS { 'V1-V2=10*IX' 'V1/(0+20*i)+(V1-V3)/20+V2/10+(V2-V3)/(0+-10*i)=0' 'V3/(0+10*i)+(V3-V2)/(0+-10*i)+(2*COS(-45)+2*SIN(-45)*i)+(V3-V1)/20=0' 'IX=-V3/(0+10*i)' }
\183\<-
\<< VARS 1 OVER '\183\<-' 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 \->NUM NEG 'VET' STO
ELSE VET + \->NUM ARRY\-> DROP
END
NEXT { n n } \->ARRY l PURGE TRAN 'MAT' STO VET MAT / n 1
FOR i DUP i GET l i GET STO -1
STEP DROP MAT VET n 1 + COL+ 'MAT' STO 'VET' PURGE
\>>
\>>
END

--------------------------


Edited: 13 Mar 2011, 4:00 p.m.


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP 50g : More on best rechargeable batteries Miguel Toro 1 1,709 12-12-2013, 05:31 PM
Last Post: David Hayden
  hp-prime solver and variable name fabrice48 22 8,103 12-10-2013, 03:25 AM
Last Post: fabrice48
  HP-48GX & 50G Question Matt Agajanian 2 1,810 12-08-2013, 10:17 PM
Last Post: Matt Agajanian
  HP Prime: complex numbers in CAS. Alberto Candel 1 1,847 12-06-2013, 02:36 PM
Last Post: parisse
  HP 50g switching two keys in the user keyboard Sean Freeman 9 3,828 12-05-2013, 11:44 AM
Last Post: Mark Puscas
  [HP Prime] Plots containing complex numbers bug? Chris Pem10 7 3,541 12-05-2013, 07:40 AM
Last Post: cyrille de Brébisson
  Solver issue with HP 17BII - different from 19BII Jeff Kearns 13 4,423 11-28-2013, 02:36 AM
Last Post: Don Shepherd
  HP Prime Triangle solver BruceH 29 8,297 11-28-2013, 12:03 AM
Last Post: Dale Reed
  HP 50g - displaying result in engineering format Sean Freeman 10 3,152 11-24-2013, 05:44 AM
Last Post: C.Ret
  HP prime: linear solver app Alberto Candel 1 1,403 11-21-2013, 01:57 AM
Last Post: Michael Carey

Forum Jump: