The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

HP48 Arrays...
Message #1 Posted by Bill Zimmerly on 16 Apr 2012, 12:05 p.m.

Hello!

I'm trying to create an array of simultaneous equations, but the ->ARRY function doesn't seem to be working properly. Can anyone see what I'm doing wrong?

The stack contains:

4: 'X+Y=30'

3: 'Y=Z+2'

2: 'X=14+Z'

1: 3

...and when I issue the ->ARRY function, I get:

->ARRY Error: Bad Argument Type

I'm totally confused, since the MSLV function REQUIRES an array of the equations!

      
Re: HP48 Arrays...
Message #2 Posted by Luiz C. Vieira (Brazil) on 16 Apr 2012, 12:35 p.m.,
in response to message #1 by Bill Zimmerly

Hi.

The ~>ARRY command accepts only numerical entries in the HP48 series. IIRC, the HP49 accepts single variables, but I cannot tell you for sure.

You should try:

[1 1 0]
[0 1 -1]
[1 0 -1]
3
to assemble the coefficient matrix, then
[30]
[2]
[14]
3
to assemble the constants vector. Please, check for possible syntax relevance, I am writing by heart.

One question: the MSLV you mention is the MSOLVR? If so, it demands a list of equations (or expressions, I do not recall correctly) stored in the EQ variable.

Cheers.

Luiz (Brazil)

Edited: 16 Apr 2012, 12:40 p.m.

            
Re: HP48 Arrays...
Message #3 Posted by Bill Zimmerly on 16 Apr 2012, 1:13 p.m.,
in response to message #2 by Luiz C. Vieira (Brazil)

Thanks Luiz! That does appear to be the problem - that strings can't be arguments for ->ARRY. :(

Also, MSLV is the name of the function I wrote about. If you have the 864 page 48gii user's guide it is described on page 7-4.

      
Re: HP48 Arrays...
Message #4 Posted by Gilles Carpentier on 16 Apr 2012, 12:36 p.m.,
in response to message #1 by Bill Zimmerly

Looks correct ... This must works

Can you verify that your equations are TYPE 9. ?

Edit : oups... My reponse is for 49-50 (it works perfectly), I do not know about 48.

Edited: 16 Apr 2012, 12:39 p.m.

      
Re: HP48 Arrays...
Message #5 Posted by Gerson W. Barbosa on 16 Apr 2012, 1:26 p.m.,
in response to message #1 by Bill Zimmerly

You might want to try this program. If the stack contains

4: 'X+Y=30'

3: 'Y=Z+2'

2: 'X=14+Z'

1: {X Y Z}

press SYS (F2) to obtain

X (F1)   -->  21.

Y (F2) --> 9.

Z (F3) --> 7.

MAT (F4) --> |1. 1. 0. 30. | |0. 1. -1. 2. | |1. 0. -1. 14.|

EQS (F5) --> { 'X+Y=30' 'Y=Z+2' 'X=14+Z' }

            
Re: HP48 Arrays...
Message #6 Posted by Bill Zimmerly on 16 Apr 2012, 4:36 p.m.,
in response to message #5 by Gerson W. Barbosa

Thank you Gerson! :)

            
Re: HP48 Arrays...
Message #7 Posted by Gilles Carpentier on 16 Apr 2012, 4:44 p.m.,
in response to message #5 by Gerson W. Barbosa

With 49/50 you can solve this systems in 2 ways :

1/Use LINSOLVE with vectors

['X+Y=30' 'Y=Z+2' 'X=14+Z'] @ you can use Matrix and equation writer for this [ 'X' 'Y' 'Z' ] @ It must be _vectors_ and not matrices ( VEC must be check in matrix writer : VEC#) LINSOLVE @ Shift S.SLV LINSO

->

[ X=21 Y=9 Z=7 ]

This works in symbolic way even with more than 3 unknows for 3 equations

I have forgot that this don't work on 48

|x| |x| -1 2/ Use matrices : M.|y|=V => |y| = M .V |z| |z|

[[1 1 0] @ With matrix writer type [0 1 -1] @ 1 1 0 ENTER RShift <- v [1 0 -1]] @ 0 1 -1 1 0 -1 ENTER

[[30][2][14]] @ With matrix writer 30 ENTER 2 14 ENTER @ or [] [] 30 -> 2 14 ENTER SWAP /

-> | 21 | | 9 | | 7 |

This works in numeric and symbolic with HP49/50 Only in numeric with my old 48SX (it works here for exemple)

Edited: 16 Apr 2012, 5:12 p.m.

                  
Re: HP48 Arrays...
Message #8 Posted by Gerson W. Barbosa on 16 Apr 2012, 6:10 p.m.,
in response to message #7 by Gilles Carpentier

You're right! On the HP-49/50g LINSOLVE is a better option, as I've just checked. On the HP-48, AFAIK, there's no built-in command to do it symbolically though.

      
Re: HP48 Array [10 x 4]
Message #9 Posted by Joerg Woerner on 16 Apr 2012, 6:17 p.m.,
in response to message #1 by Bill Zimmerly

            
Re: HP48 Array [10 x 4]
Message #10 Posted by Allen on 16 Apr 2012, 11:34 p.m.,
in response to message #9 by Joerg Woerner

Nice solution!! Curious how you invert that matrix?

                  
Re: HP48 Array [10 x 4]
Message #11 Posted by Gilles Carpentier on 17 Apr 2012, 6:18 a.m.,
in response to message #10 by Allen

You can't because it's not a square matrix :D

Edited: 17 Apr 2012, 7:01 a.m.

                  
Re: HP48 Array [10 x 4]
Message #12 Posted by Dave Shaffer (Arizona) on 17 Apr 2012, 2:25 p.m.,
in response to message #10 by Allen

Quote:
Curious how you invert that matrix?

How about this (especially for Joerg!)

            
Re: HP48 Array [10 x 4]
Message #13 Posted by gdeldago on 16 Apr 2012, 11:39 p.m.,
in response to message #9 by Joerg Woerner

Quote:
...

In fact that is a 4 x 10 matrix ;)

Edited: 16 Apr 2012, 11:40 p.m.

                  
Re: HP48 Array [10 x 4]
Message #14 Posted by Reth on 19 Apr 2012, 6:07 a.m.,
in response to message #13 by gdeldago

Quote:

In fact that is a 4 x 10 matrix ;)


not for the TI fans :)

            
Re: HP48 Array [10 x 4]
Message #15 Posted by Luiz C. Vieira (Brazil) on 17 Apr 2012, 6:20 p.m.,
in response to message #9 by Joerg Woerner

This is a unique system: has more solutions in itself than the ones needed to solve it!


[ Return to Index | Top of Index ]

Go back to the main exhibit hall