HP48 Complex Matrices or Simultaneous Equations



I am having trouble solving simultaneous equations, 2X2 or 3X3 when complex numbers are used. Despite the approach I take, a syntax error always develops when I enter the constants. Please help!! Thank you.



Hello Tom,

I hope the following may help:




Tom --

In addition to Gerson's link, the following threads from Archive #15 should also be helpful to you:

HP48g function

HP-49G Vector-Matrix Multiplication

-- KS


Hello Karl,

I never used the "Solve lin sys..." in the 48 because my colleague's program was easier to use (I'd just enter the circuit equations and the list of unknows). Too bad the program does not work in the 49G. I tried different flags settings but to no avail. Do you, or someone else, know how flags should be set so that the 49G/G+ becomes as most compatible as possible with the 48? Thanks.



Hello, Gerson --

Sorry, although I have one example of each RPL-based HP calculator (28C/48G/49G) with manuals, I'm not very proficient at any of them, and don't really want to make the effort to do so.

I can't even find some of the menu-driven functionality of the HP-48G (such as numerical integration) on the HP-49G.

Maybe James Prange would know best how to emulate a 48G on a 49G...

-- KS


Hello Karl,

I can't even find some of the menu-driven functionality of the HP-48G (such as numerical integration) on the HP-49G.

I cannot find that either.

On the 49G, I prefer flag -117 set (soft menus instead of choose boxes) and, needless to say, RPN.

I spent so many years before graduating, working during the day and rushing to college after hours, that various generations of HP calculators passed me by (15C, 28S, 48 :-)

Thanks just the same,



Maybe James Prange would know best how to emulate a 48G on a 49G...

Write your own ROM (actually flash) code?

Maybe a huge library?

Although the 49 series has some improvements and is more fun to
play around with, it can be very frustrating to me. When I just
want to get some real work done, I use the 48SX or 48GX.

Sometimes the CAS does things that I don't want, and I don't know
how to work around it. Some of the new system flags (-65 through
-128) are still a bit of a mystery to me; see the 49g+ AUR
appendix C. Maybe some of the new flags, or new CAS commands and
reserved variables, would solve some of my problems.

I can't even find some of the menu-driven functionality of the
HP-48G (such as numerical integration) on the HP-49G.

Maybe you mean the input form that you get on the 48GX by pressing
RS SYMBOLIC and then choosing Integrate...? Me neither; I guess
that we're just supposed to know which order the arguments have to
be in. Let's see now, how many arguments do I need for
integration? Some of the input forms in the 48GX I don't
appreciate, but where the arguments aren't obvious, they can be
helpful. Of course, I could always use INFORM to make my own
integration input form, but the one on the 48GX is pretty nice.

Note that on an RPL level, there are few (if any) differences
between the 49G and the 49g+ (and I suppose the 48gII), except for
some changes in the keyboard layout and perhaps keyboard
shortcuts, and some bug fixes (or new bugs), and the 49g+ is
faster in most cases. Of course the "Saturn+" (processor emulated
in ARM) used in the 49g+ and 48gII has some new instructions that
the hardware Saturn used in the 49G and 48 series doesn't have,
and some of the RPL commands take advantage of them, but this
should be transparent to ordinary users.

The Advanced User's Manual for the 49g+ / 48gII is a lot more
complete; I recommend that you download it, even for use with the
49G. See:

Federico's documents on the flags and reserved names may also be
helpful; see:

As Gerson noted, obviously we want RPN mode. After a memory clear
(or with a brand-new 49 series), do MODE [+/-] ENTER; the
15-keystroke type-ahead is still there, so there's no need to wait
for the input form to display. As he also noted, "soft menus"
instead of "choose boxes" seem better to me; set flag -117 if you
prefer them.

You can use the SF and CF commands, but MODE gives you an input
form, from which other input forms are available, and MODE FLAGS
gives you a browser for most system flags (the settings that
depend on only one flag and don't have a command for changing,
anyway). In the flags browser, the - for the flag isn't displayed;
for example flag -117 is shown as 117, but with Cf and SF, you
have to include the - sign for a system flag, otherwise you'll be
working with a user flag instead.

You may, depending on what you're doing, prefer approximate mode
instead of exact mode. These can be toggled by RS&\->NUM (over the
ENTER key), that is, press \->NUM while holding down RightShift.
If the header is displayed, you'll see an = for exact or a ~ for

The HEADER\-> command returns the header size, and the \->HEADER
command sets it. The header can use 0, 1, or 2 lines.

A "textbook" stack display is available, but I generally prefer to
turn it off by setting flag -79. Try both ways with something like
'1/2' on the stack.

There are various other system flags for the stack display; should
all levels be multi-line or just level 1, should GROBs be
displayed as descriptions or graphically, is the ASCII Line Feed
code a graphical character or a line break, and so on.

Different font sizes are available; how good are your eyes?
Anyway, try out such commands as FONT6, FONT7, FONT8, FONT\->, and
\->FONT. Some of the new system flags control whether the current
system font or the minifont is used in various environments. My
usual preferences are FONT8 and the system font everywhere that
it's an option, but smaller fonts do let you see more at one time.

You can also make your own custom fonts; do you want little bars
on your 7 and Z characters? Or an "open" 4 character? Or something
other than a little black square for ASCII control codes? Do RS
CHARS to open the character browser, then press MODIF to open the
font editor.

The "menu-map" seems to leave a lot to be desired. Sometimes there
just doesn't seem to be any way to get there from here, except for
using the MENU command.

But some of the good old menus are available through shift-hold
combinations. For example, RS TIME gives me a choose list, but
RS&TIME gives me a menu. RS NUM.SLV gives me a choose list, but
RS&NUM.SLV gives me a menu. See the 49g+ AUR appendix G for
various "keyboard shortcuts"; I think that most of them apply to
the 49G as well.

The keycodes have more "planes" (11 of them) available; you can
make shifted alpha and shift-and-hold user key assignments in the
49 series. Just imagine making an overlay with all of those on it!

Wolfgang's Keyman library allows even more user key assignments,
double-click and long-hold, just in case you feel a need for them.
Well, it's also supposed to generally make assigning keys easier
and reduce the memory used for the assignments, even if you don't
really need the extra possibilities. See:

The 49g+ AUR's appendix H lists the menu numbers, including the
"old" menus that seem hard to get to. Appendix I shows you how to
get to a menu for any command that's in a menu.

Once you're at a menu, you can use the RCLMENU command to get the
current menu (including the page) number, which can be used with
the MENU or TMENU command.

You could write a program like

\<< 75. MENU \>>
to go directly to the numeric root solver. Or you could make a
program like
{ "PLOT" \<< 81. MENU \>> }
( "SYMBO" \<< 93. MENU \>> }
{ "TIME" \<< 94. MENU \>> }
{ "STAT" \<< 96. MENU \>> }
{ "I/O" \<< 104. MENU \>> }
{ "LIBRA" \<< 110. MENU \>> }
to give you a menu for getting to various useful built-in menus.
Or if you change the TMENU to MENU, the program will make your
CUSTOM menu.

The CAT operation lets you browse all of the commands. Some
commands even have HELP available from the browser.

The KEYEVAL command lets you "press a key", allowing you to
include operations that aren't programmable commands within a
program. With KEYEVAL, a negative keycode always gives you the
standard key action; a positive keycode gives you the user key
action if you're in user mode, and otherwise the standard key
action. Hey, did they discover "keystroke programming"? Well,
maybe not quite.

Generally, if a command is available for what you want, that's
preferable. After all, if an operation was meant to be used in a
program, then they would've given it a name and made it a command,

You can, for example, execute the CAT operation on the 49G by
doing -42.1 KEYEVAL, or on the 49g+, by doing -44.3 KEYEVAL. But
if you try this, notice that the display isn't completely updated
after KEYEVAL; only the part that really needs to be. An HP
developer wrote that this is intentional (it's faster), although
it feels like a bug to me. Where this is a problem, The SysRPL
command SysDisplay, which can be invoked by

on the 49 series, is a work-around.

I just discovered that disabling last stack saves also trashes any
local variables (although local variables in a suspended
environment aren't affected), so using KEYEVAL to toggle last
stack (and presumably to invoke various other operations) within a
program can go very wrong.

It seems to me that KEYEVAL might best be considered a "hacker's
command"; use it with care.

But KEYEVAL can be useful. Don't like the keyboard layout? An
example to swap the key assignments for the MODE and CUSTOM
operations when in user keys mode:

{ \<< -22.2 KEYEVAL \>> 22.1 \<< -22.1 KEYEVAL \>> 22.2 } STOKEYS
Assigning those simple programs to user keys seems pretty safe.

The 49 series includes MASD for programming in SysRPL and assembly
language right on the calculator, although you'll want to install
the extable library to use MASD. Attach library 256 and do 256
MENU to get to the "hacker's library". Wolfgang's OT49 makes
things easier, and Jurgen's Nosy let's you decompile even the
built-in commands. Some things are just so much easier in SysRPL,
and if you're already comfortable with UserRPL, it isn't hard to
learn. For that matter, assembly language isn't hard to learn
either, although the Saturn processor is rather unusual. Just be
prepared to restore the calculator's memory when you program in
these "internal" languages.

The SYSEVAL, LIBEVAL, and FLASHEVAL commands allow you to invoke
"internal" routines within an otherwise UserRPL program, but of
course these must be used with care.

Also see (and search) the
usenet group
hpcalc.org, and the
HP48 Ring.

Like the 48 series, the 49 series is highly customizable, but even
more so. It seems to be designed, first, for students, and second,
for hackers by hackers.

I have my doubts that you can make the 49 series behave just like
the 48 series, but I hope this helps.



James --

Thank you for the extraordinary effort in your response -- it was "above and beyond the call of duty", to use a military expression.

The original question in the thread was from Gerson:

Do you, or someone else, know how flags should be set so that the 49G/G+ becomes as most compatible as possible with the 48?

And yes, I was indeed referring to the menu-assisted input form for symbolic and numeric integration on the HP-48G series.

-- KS

Possibly Related Threads...
Thread Author Replies Views Last Post
  HP Prime Matrices curiosity bluesun08 0 715 12-09-2013, 06:44 PM
Last Post: bluesun08
  [HP-Prime CAS] "Warning, ^ (Command) Is ambiguous on non square matrices"?? CompSystems 1 1,012 12-07-2013, 07:15 PM
Last Post: CompSystems
  HP Prime: complex numbers in CAS. Alberto Candel 1 842 12-06-2013, 02:36 PM
Last Post: parisse
  [HP Prime] Plots containing complex numbers bug? Chris Pem10 7 1,689 12-05-2013, 07:40 AM
Last Post: cyrille de Brébisson
  HP Prime: matrices in programs, in need of help Alberto Candel 9 1,533 11-26-2013, 01:33 AM
Last Post: cyrille de Brébisson
  [HP Prime] Tips for Solving Differential Equations More Efficiently Chris Pem10 8 1,413 11-21-2013, 08:25 PM
Last Post: Chris Pem10
  Complex Number Entry on Prime Jeff O. 19 2,746 11-16-2013, 12:34 PM
Last Post: Jeff O.
  HP 50g - question about matrices arrays vectors etc. Sean Freeman 6 1,251 11-14-2013, 01:44 PM
Last Post: peacecalc
  HP Prime complex results Javier Goizueta 0 530 10-06-2013, 12:59 PM
Last Post: Javier Goizueta
  HP Prime Solving Nonlinear System of Equations for Complex Results Helge Gabert 11 2,131 09-30-2013, 03:44 AM
Last Post: From Hong Kong

Forum Jump: