The Museum of HP Calculators

HP Forum Archive 16

[ Return to Index | Top of Index ]

HP48 Complex Matrices or Simultaneous Equations
Message #1 Posted by Tom on 1 Apr 2006, 10:12 p.m.

Hello,

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.

Tom

      
Re: HP48 Complex Matrices or Simultaneous Equations
Message #2 Posted by Gerson W. Barbosa on 1 Apr 2006, 10:18 p.m.,
in response to message #1 by Tom

Hello Tom,

I hope the following may help:

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv015.cgi?read=82010

Gerson.

      
Re: HP48 Complex Matrices or Simultaneous Equations
Message #3 Posted by Karl Schneider on 1 Apr 2006, 11:58 p.m.,
in response to message #1 by Tom

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

            
Re: HP48 Complex Matrices or Simultaneous Equations
Message #4 Posted by Gerson W. Barbosa on 2 Apr 2006, 2:44 p.m.,
in response to message #3 by Karl Schneider

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.

Gerson.

                  
HP48G/49G "compatibility"
Message #5 Posted by Karl Schneider on 2 Apr 2006, 4:57 p.m.,
in response to message #4 by Gerson W. Barbosa

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

                        
Re: HP48G/49G "compatibility"
Message #6 Posted by Gerson W. Barbosa on 2 Apr 2006, 5:43 p.m.,
in response to message #5 by Karl Schneider

Hello Karl,

Quote:
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,

Gerson.

                        
49 series customization [Long]
Message #7 Posted by James M. Prange (Michigan) on 5 Apr 2006, 7:41 p.m.,
in response to message #5 by Karl Schneider

Quote:
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.

Quote:
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: http://www.hpcalc.org/search.php?query=Advanced+User%27s&hp49=1&title=1.

Federico's documents on the flags and reserved names may also be helpful; see: http://www.hpcalc.org/search.php?query=Federico+49G%28%2B%29.

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 approximate.

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: http://page.mi.fu-berlin.de/~raut/WR49/index.htm#Keys.

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 \>> }
  }
  TMENU
\>>
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, right?

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

#2EF67h SYSEVAL
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 comp.sys.hp48 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.

Regards,
James

                              
Re: 49 series customization [Long]
Message #8 Posted by Karl Schneider on 5 Apr 2006, 10:44 p.m.,
in response to message #7 by James M. Prange (Michigan)

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:

Quote:
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


[ Return to Index | Top of Index ]

Go back to the main exhibit hall