Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[HP 49G] solving linear system with complex coefficents

251 views
Skip to first unread message

xar...@gmail.com

unread,
Nov 12, 2006, 9:53:15 AM11/12/06
to
hi all, i'm just new here ;)

i got a problem with my HP 49G calculator: i'm trying to solve a linear
system by entering in NUM.SLV -> Solve lin sys... applet, where i'm
asked to insert matrix A and vector B to get the solution vector X. i
have to solve a system with complex numbers: let me make a simple
example like:

(3i)a + (1+2i)b = i
a - (4+2i)b = 5

so, i'd have to enter this as A:

3i 1+2i
1 -4-2i

this as B:

i
5

then, move the cursor to X line in the main screen of the applet then
press F6 to solve the system. oki, that is fine: as i enter 3i as the
first entry of A matrix, i see the complex number shown in his algebric
cartesian coordinates (0, 3). fine. all the other entries, including
real numbers, are shown in this way. i enter B, solve the system, get
the solution. fine.

you may ask, where's the problem then. here it is, let's solve this
system now:

3a + (1+2i)b = i
a - (4+2i)b = 5

so, i'd have to enter this as A:

3 1+2i
1 -4-2i

this as B:

i
5


well it's almost the same, but a coefficient in the first equation is 3
(real), not more 3i (complex). this shouldn't be a problem. i enter the
first number in A, 3. ok, but this time it's not entried with
coordinates, but just like a number. no more (3, 0), but only 3. it
shouldn't be a problem. now the second number, 1+2i. aw, like expected,
it's shown in his coordinates (1, 2) but... whohooo, what's happening
now? "Bad Argument Type" error. nice.

so, that's the issue: no way to enter a complex entry, if you entered
the first entry (yeah, it's cacophonic, i know :) of the matrix is a
real number. if you did that, there's no more way to enter a complex
number in your matrix, except this: exit from the "Solve lin sys..."
applet and re-enter the number this way: enter the first number (real)
in a complex format (for instance (3,0) if you mean 3), then enter all
other coefficents. kinda weird: it seems that the calculator
interpretes the matrix format (complex or real) according to the first
entry, without a correction possibility: that sounds crazy to me!

so i'm asking: did anyone else experience something similar on his
calculator? i found some threads made by people having my same problem,
but however i couldn't get a way to fix this problem (if any).

regards, Stefano

John H Meyers

unread,
Nov 12, 2006, 4:46:48 PM11/12/06
to
On Sun, 12 Nov 2006 08:53:15 -0600, Stefano wrote:

> that's the issue: no way to enter a complex entry,

> if you entered the first entry of the matrix as a real number.

If the first element is 3, then enter it as (3,0) instead;
now the matrix is recognized as being "complex,"
and will accept the remaining real *or* complex-valued numbers.

What ROM and CAS versions are you using, by the way?
(VERSION and VER commands)

A type 29 array accepts mixed object types anyway, however,
so this doesn't seem to bother my calc -- if you have
what looks like an all-numeric array with "mixed"
real and complex values in it, the AXM command
will make it uniformly complex-valued.

[r->] [OFF]

xar...@gmail.com

unread,
Nov 13, 2006, 12:29:21 PM11/13/06
to
> On Sun, 12 Nov 2006 08:53:15 -0600, Stefano wrote:
>
> > that's the issue: no way to enter a complex entry,
> > if you entered the first entry of the matrix as a real number.
>
> If the first element is 3, then enter it as (3,0) instead;
> now the matrix is recognized as being "complex,"
> and will accept the remaining real *or* complex-valued numbers.

yes, that was exactly the only solution i found and i posted it before.
i was just asking if there is another one to correct an entry and set
it in complex format if i previously typed it in real format.


> What ROM and CAS versions are you using, by the way?
> (VERSION and VER commands)

here they are:

VERSION: "Version HP49-C Revision #1.16" "Copyright HP 1999"

VER: 4.19991123


> A type 29 array accepts mixed object types anyway, however,
> so this doesn't seem to bother my calc -- if you have
> what looks like an all-numeric array with "mixed"
> real and complex values in it, the AXM command
> will make it uniformly complex-valued.

what do you exactly mean with "A type 29 array"? i see you told me that
i have to use the AXM command on a matrix/array that has both complex
and real values, but that's the problem: i can't have such a matrix
because it seems it can only be all either complex-format or
real-format depending on the first entry.

> [r->] [OFF]

thank you for your help :)

regards, Stefano

John H Meyers

unread,
Nov 13, 2006, 1:40:10 PM11/13/06
to
On Mon, 13 Nov 2006 11:29:21 -0600, Stefano wrote:

> VERSION: "Version HP49-C Revision #1.16"

> VER: 4.19991123

That may be the last "official" HP version for 49G,
but there was a much-improved later ROM 1.19-6,
a "CAS Release" 1.24 (with CAS source),
and then various later updates for 49G+
which some people say they have managed
to transfer to and work fine in a 49G
(except still as slow as a 49G :)

> what do you exactly mean with "A type 29 array"? i see you told me that
> i have to use the AXM command on a matrix/array that has both complex
> and real values, but that's the problem: i can't have such a matrix
> because it seems it can only be all either complex-format or
> real-format depending on the first entry.

Any array which contains either mixed types or any type
which isn't real *or* complex (e.g. symbolic or exact integer)
is, at least nowadays, automatically stored in a different
form (internally as a "list of lists," but displaying
and acting in most respects just like purely numeric arrays).

This was bound to have been the case even in HP's older ROM,
but perhaps subsequent improvements have since been made
to the Matrix Writer and other commands
to remove bugs or other obstacles.
given that these issues no longer seem to arise.

[r->] [OFF]

John H Meyers

unread,
Nov 13, 2006, 4:06:55 PM11/13/06
to
Addendum:

On this older (1.16) 49G ROM:

Try setting flag -91,
then see whether you can enter
anything you want into the Matrix Writer.

After you have stored the result,
it should appear on the stack as a "list of lists,"
to which you should be able to apply the AXL command
to change into an array (whose TYPE would be 29),
then AXM should convert further (if possible)
to an all-numeric array (object type 3 or 4
for real or complex) with the same type in each cell.

Otherwise a ROM update might be indicated.

[r->] [OFF]

Veli-Pekka Nousiainen

unread,
Nov 13, 2006, 11:15:41 PM11/13/06
to

"John H Meyers" <jhme...@nomail.invalid> wrote in message
news:op.tiyxv...@w2kjhm.ia.mum.edu...

> Addendum:
>
> On this older (1.16) 49G ROM:
>
> Try setting flag -91,
> then see whether you can enter
> anything you want into the Matrix Writer.
>
> After you have stored the result,
> it should appear on the stack as a "list of lists,"
> to which you should be able to apply the AXL command
> to change into an array (whose TYPE would be 29),
> then AXM should convert further (if possible)
> to an all-numeric array (object type 3 or 4
> for real or complex) with the same type in each cell.

test also ->NUM

> Otherwise a ROM update might be indicated.

I suggest that you immediately upgrade your ROM

> [r->] [OFF]

[<-l] [CONT]


Veli-Pekka Nousiainen

unread,
Nov 13, 2006, 11:49:07 PM11/13/06
to

"Veli-Pekka Nousiainen" <DROP...@dlc.fi> wrote in message
news:Tic6h.51663$eP4....@reader1.news.jippii.net...

>
> "John H Meyers" <jhme...@nomail.invalid> wrote in message
> news:op.tiyxv...@w2kjhm.ia.mum.edu...
>> Addendum:
>>
>> On this older (1.16) 49G ROM:
>>
>> Try setting flag -91,
>> then see whether you can enter
>> anything you want into the Matrix Writer.
>>
>> After you have stored the result,
>> it should appear on the stack as a "list of lists,"
>> to which you should be able to apply the AXL command
>> to change into an array (whose TYPE would be 29),
>> then AXM should convert further (if possible)
>> to an all-numeric array (object type 3 or 4
>> for real or complex) with the same type in each cell.
>
> test also ->NUM
In place of the AXM

John H Meyers

unread,
Nov 14, 2006, 12:34:08 PM11/14/06
to
On Mon, 13 Nov 2006 22:49:07 -0600, VPN wrote:

> test also ->NUM (in place of AXM)

Here goes a test:

[ 1 2. (3.,4.) ] \->NUM ==> [ 1. 2. (3.,4.) ] still type 29

while:

[ 1 2. (3.,4.) ] AXM ==> [ (1.,0.) (2.,0.) (3.,4.) ] now type 4

What sort of test did you do yourself?

[r->] [OFF]

Veli-Pekka Nousiainen

unread,
Nov 14, 2006, 2:11:22 PM11/14/06
to
"John H Meyers" <jhme...@nomail.invalid> wrote in message
news:op.ti0oe...@w2kjhm.ia.mum.edu...
=============================
None, Point taken, John
I have to compete with Nina for the use of our only PC
so I have to be extremely quickly and
answer directly from my faint memory
sometimes I have more time and thus better answers
but I always try my best
--
Veli-Pekka
BTW: I never knew the usefulness of AXM
so I learned something new
Thanks, John!

xar...@gmail.com

unread,
Nov 15, 2006, 4:49:18 AM11/15/06
to
thank you for all your answers :)

i tried setting the -91 flag, and since the matrix is displayed as
"list of lists", i can enter both complex and real values. the problem
now, is that i can't solve systems anymore (i think solve linear system
applet just requires a matrix, not a list of lists), and i simply
couldn't apply to my matrix AXM end NUM commands (bad argument type
error)... i confess it, i have no idea on how to use those commands,
because i'm not so skilled in using this calculator :x

as last resource, i though to upgrade my ROM, and i browsed to:
http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ca101en&lc=en&cc=it&lang=en&os=181&product=60523&dlc=en
and, besides the problem that i don't have any of the OS listed there
(i got Windows XP, but that shouldn't be a problem, should it?), i
don't have a 10 pin serial port (as the cable seems to require in order
to connect to my pc). plus, the cable seems a little strange: F/F and
not M/F as it's supposed to be. so i cannot upgrade the rom until i buy
an adapter, so by now, that's definitely a solution for me.


regards, Stefano

John H Meyers

unread,
Nov 15, 2006, 9:24:26 AM11/15/06
to
On Wed, 15 Nov 2006 03:49:18 -0600, Stefano wrote:

> i tried setting the -91 flag, and since the matrix is displayed as
> "list of lists", i can enter both complex and real values. the problem
> now, is that i can't solve systems anymore (i think solve linear system
> applet just requires a matrix, not a list of lists)

True.

> and i simply couldn't apply to my matrix AXM end NUM commands
> (bad argument type error)...

Use AXL to convert the list form to Matrix form;
use AXM to convert mixed-type Matrix to uniformly real or complex.

To use these commands, have the current object on the stack
(level 1) and type the command name (use RPN mode).

> as last resource, i thought to upgrade my ROM, and i browsed to:


> http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ca101en&lc=en&cc=it&lang=en&os=181&product=60523&dlc=en
> and, besides the problem that i don't have any of the OS listed there
> (i got Windows XP, but that shouldn't be a problem, should it?)

I wouldn't expect any problem; is anyone using the 49G kit on XP?

A simpler program, however, for doing ROM updates only
(the same utility program which the transfer kit invokes) is:

"HP's Flash Download Program for updating the HP 49G's ROM"
http://www.hpcalc.org/search.php?query=fdp

Or, if you know anyone else who has an already-updated 49G,
the "calc-to-calc" cable can be used to transfer ROM
from one 49G to another, using the ROMPUPLOAD command.

Actually, to get the very latest ROM available,
it may be better to perform ROMUPLOAD
from an up-to-date 49G *emulated* on the computer itself
(and the most up-to-date emulated 49G is in "debug4x"),
using a computer with a serial port,
and the proper cable for "calc to computer serial port."

> I don't have a 10 pin serial port (as the cable seems


> to require in order to connect to my pc).

There may be ten little pins in the 49G's proprietary connector,
but only three or four of those are passed
thru the proper interface cable to the PC
(transmit, receive, signal ground, and perhaps a "shield");
at the PC end is usually a standard "DB9" (nine pin) connector,
which likewise actually uses only three wires to talk to the calc.

By the way, the other pins in the 49G go to the *display*
(this was a trick for sharing the same outlet to attach
an optional "overhead projector" accessory for classroom use,
of course using the remaining pins *not* used for serial data).

> plus, the cable seems a little strange,


> so i cannot upgrade the rom until i buy an adapter

If you never got an HP serial cable
(which during one period was included with every new calc,
along with a calc-to-calc cable that also mated with 48 series),
do a "find" for "cables and adapters" at https://www.calcpro.com
(you would need the HP48 cable plus the HP49G adapter).

This one-piece cable fits the 49G, and seems cheaper:
http://www.samsoncables.com/catalog/prodDetail.cfm?Prod_ID=194&Sku=SCHP49

See also (scroll down for 49G version, see home page for email):
http://www.codefit.com/HP48Cable.html

Or did you mean that you *have* some sort of calc <-> PC cable,
but it doesn't seem to be the right one?

Here are all HP serial calculator cables in one "Cable Table"
http://holyjoe.org/hp/cable.htm (thanks to Joe Horn,
who by now must be old enough to be most HP calcs' Father :)

[r->] [OFF]

The Phantom

unread,
Nov 16, 2006, 12:29:01 AM11/16/06
to

I find it easier to not even use the NUM.SLV applet.

Put your calculator in approximate mode and enter your system like this:

First put the B vector on the stack. Press the purple prefix key and then the
"times" key to get [] on the display. Do this again and see [[]] on the
display. Don't press "ENTER" yet. With the cursor still pointing between the
inner pair of brackets, type the {1,1} element of your vector so that you have
[[ (0., 1.) ]] on the display. Press the cursor right key until the cursor is
pointing between the 2 right brackets. Now type 5 and then ENTER. You should
see:

[[ (0.,1.) ]
[ (5.,0.) ]]

That is your B vector. Notice that as soon as you type the first complex
element, the entire vector (or matrix) becomes complex.

Now press the <purple prefix and times key> sequence twice to get [[]] on the
display again. Now type 3, SPC, (1 2). Next press the cursor right key until
the cursor points between the 2 right brackets. Finish typing the rest of your
A matrix and then press ENTER. You should see:

[[ (3.,0.) (1.,2.) ]
[ (1.,0.) (-4.,-2.) ]]

Now press the divide key and you will get the solution vector on the stack.
What this does is to invert the A matrix and premultiply it times the B vector.

This method can also be used for larger matrices and vectors. Just type in
the first row and then press the cursor right key until the cursor points
between the 2 right hand brackets. Then type all the rest of the elements of
the matrix (or vector) and press ENTER.

Veli-Pekka Nousiainen

unread,
Nov 17, 2006, 10:33:15 AM11/17/06
to

<xar...@gmail.com> wrote in message
news:1163584158....@e3g2000cwe.googlegroups.com...

> thank you for all your answers :)
>
> i tried setting the -91 flag, and since the matrix is displayed as
> "list of lists", i can enter both complex and real values. the problem
> now, is that i can't solve systems anymore (i think solve linear system
> applet just requires a matrix, not a list of lists), and i simply
> couldn't apply to my matrix AXM end NUM commands (bad argument type
> error)... i confess it, i have no idea on how to use those commands,
> because i'm not so skilled in using this calculator :x

First AXL (Array eXchange List) which works both way
then that AXM (Array eXchange Matrix)
which gives you uniform answers

Have you tried picking up the matrices from the Stack using
[HIST]
=======
No, I did not try it this time either, John!
I just finished installing the whole XP & Office once again
Now everything seems to work, but I'm a bit tired..
--
Veli-Pekka Nousiainen


xar...@gmail.com

unread,
Nov 19, 2006, 6:05:55 PM11/19/06
to
aw men, thank you all for your answers!

that's the situation now: thanks to john's really useful information, i
found that the cable i have is the F1633-66000 one, that connects two
HP 49Gs. the cable i need is this one
http://www.samsoncables.com/catalog/prodDetail.cfm?Prod_ID=194&Sku=SCHP49,
and i hope i'll manage to get it as soon as possible. when i'll have
it, i'll try to follow the infos you posted to update the ROM of my
calculator, since i don't know anyone that has this HP model, so i
cannot just update it from another one. thanks to the phantom too,
really great idea to divide two matrices to get the solution vector
X=B/A. didn't really think that HP49 G would have done that this cool
way. plus, MTRW applet doesn't seem to be affected by the "bug"
regarding compelx numbers that NUM.SLV seems to have, so... great
solution man!

i'll be back for futher informations, as i said, when i'll get the
cable to link pc and calculator, but i think i'll open another thread
to talk about ROM updating.

thank you all again :)

regards, Stefano

0 new messages