How I use my HP50G at work.



#2

I hope this isn't too long, but I thought I'd share how I use my HP50G. I'm an electrical Engineer, with a speciality in designing radio's. 
There are a couple of dozen equations that I use fairly frequently, and
I've programmed them into PEQEM rather than use Excel because of the
numeric solver and multiple equation solver that's built into the 50G.

Asciiflow (http://www.asciiflow.com/ ) is a useful website/drawing tool
that will create ASCII drawing for documentation. While it's not as nice
looking at a GROB, it's a lot faster to put together, and text is all
that PEQEM supports.

Since I like typing on a large keyboard as well, I use a SD card to hold
text files, and translate them on the calculator from ASCII format to
directories and variables. I've also developed a couple of utility
programs to assist with this, and I'll document them here. I use
AsciiBin (http://www.hpcalc.org/details.php?id=3648) to go from a text
string on the stack to HP50g executable objects. I've renamed
ASCIIBIN.49 to UZ on my calculator, just to make things easier to type.

First, the PEQUM Equation Directory. This is a cut down version of the
one I use, as that one is ~ 20k of ASCII. I use the @ as a comment
delimiter, and try to format equations so that they are readable. This
text file resides in the root directory of the SD Card.

PEQUM is located here http://www.hpcalc.org/details.php?id=6306 , and is
a pretty handy equation library routine.


*******************************************************************************
%%HP: T(3)A(D)F(.);
@ Collected directory of equations for PEQUM.
@ PEQUM:
@ Equations are stored in a directory
@ {Equations}.
@ Constants can enter directly
@ variable$ is a text note Can attach to variables or directories
@ Can also support subdirectories.
@ http://www.asciiflow.com/ is a useful website for creating some


DIR
@ Start of Directory
@******************
RXPerformance$
"Directory of Receiver Performance
Equations"
RXPerformance
DIR
@+++++++++
IP3.eq$
"All powers in dBm
OIP3: Output IP3
Pout: Single Tone Output Power
Pspur: Spurious 3rd order Tone
From RFCafe web site. "
IP3.eq 'OIP3=3/2*Pout-1/2*Pspur'
@+++++++++
IIP3.eq 'IIP3=(2.*PD+PA+G-IMD3)/2.'
IIP3.eq$
"Input IP3
IIP3:Input IP3
PD: Input Power
PA:
G: Gain
IMD3: IMD3 Power"
@+++++++++
RXSense.eq 'RXSense=BBSNR+10.*LOG(1.38E-23*(T+273.15)*BW*1000.*(NFRx))'
RXSense.eq$
"Receiver Sensitivity
RXSense: Receiver Sensitivity,
BBSNR: Baseband SNR at Sensitivity
T: Temperature, C
BW: System BW
NFRx: Receiver Noise Figure"
@+++++++++
FriisV.eq 'Ftot=Fm+(Fmp1-1)/gm^2*(1/(Rim/(Romm1+Rim))^2)*(1/(Romm1/Rom))'
FriisV.eq$
"From Gu, Eq. 4.2.20
Fm: Noise Factor, Stage m
Fmp1: Noise Factor, Stage m+1
gm: Stage Voltage Gain
Rim: Input R Stage m
Romm1: Output R, Stage m-1
Rom: Output R, Stage m"
@+++++++++
IR.eq 'IR=10*LOG((1+2*(1+A)*COS(P)+(1+A)^2)/(1-(2*(1+A)*COS(P)+(1+A)^2)))'
IR.eq$
"IR: Image Reject
A: Amplitude Mismatch, Linear
P: Phase Mismatch"
@+++++++++
IRINP.eq 'IRINP=10*LOG(Fc2kT0*LN(f2/f1)+10^(NFth/10)*(f2-f1))+-170.97'
IRINP.eq$
"IRINP: Input Referred Noise Power
Fc2KTO: 1/f Noise Corner
f1: Start Frequency
f2: Stop Frequency
NFth: Stage noise Figure"
@+++++++++

LNAFOM.eq 'FOM=(ALOG(G/10)*ALOG(IIP3/10)*f)/((ALOG(NF/10)-1)*P)'
LNAFOM.eq$
"LNA FOM
FOM: FOM
G: Gain(dB)
IIP3: Input IP3(dB)
NF: Noise Figure(dB)
P: DC Power (mW)
f: Center Freq (GHz)
From Yao et al: Algorithmic Design of CMOS LNA's and Pa's for 60 Ghz Radio
"


@+++++++++
END
END


'EQUATION'
PGDIR
'EQUATION'
STO

*******************************************************************************
In practice, I recall this text file from the SD Card to the stack, and
then run UZ on it, to translate it to a directory. I can then "EVAL"
this, and the object on the stack will purge the old 'EQUATION'
directory and store the new one into the same one. Below is the program
that I use (from the home directory) to pull EQ02.txt and a Notes file.
The Notes File is a simple text file that I display using VV, which is
the text display part from ( http://www.hpcalc.org/details.php?id=7213).
When I update either text file on the SD card, I run this utility, which
I've named rclSD, to pull from the SD card and install on the
calculator.

*******************************************************************************
Recall from the SD Card. Stored in my home directory.

*******************************************************************************

%%HP: T(3)A(D)F(.);
@ Utility to recall directory objects from the SD card
@ and put them into the {HOME DEV} sub directory. Each one of these
@ directory objects will purgedir of the previous version and then
@ store itself into that named variable.
\<<
PATH @ Put the Path on the Stack

{HOME} EVAL @ Move to Home
:3:"EQ02.txt" RCL UZ EVAL @ Get Equations directory
:3:"HP50GNotes.txt" RCL UZ EVAL @ Get Notes file

EVAL @ Now I'm done, EVAL the path to get back
SORTD
\>>

*******************************************************************************
Notes on the 50G

*******************************************************************************

%%HP: T(3)A(D)F(.);

\<<
\<< "Notes on HP50G Usage
LIBS - Returns list of installed
libaries to stack

50g display size 131x80

Updating the two equation libraries
that I have on the 50g:

PEQUM:
Equations are stored in a
directory {Equations}. RPL code
bkupeqn copies the equation to
the SD card, after running uz
on it. File name is eq.txt.
Once this is on a computer,
use EQ01.txt as the human
readable version to edit
and cleanup and then use
uz to recover the directory
object.

"
VV DROP \>>
'NOTES'
PURGE
'NOTES'
STO
\>>


#3

Great post, David. More like this please.


#4

Definitely!

Lots to learn from posts like this.


#5

Well, I can only explain how much I use it once :-)

As a practical matter, I'm really torn, as Excel, with a little VBA, really does 90% of what I use a calculator for now, with some substantial advantages. I can send an Excel spreadsheet to a colleague for other use, as well as add detailed explanations of what the calculations are for, boundary conditions, etc. All of these are things that I can't do easily with a 50G.

If I could work out a multiple equation solver in Excel, I think that would really take up the remaining 10%.


#6

Excel does the 90%, but the last 10% is like grinding your face off with an angle grinder and dipping the remains in a salt bed.

In the early 00's I did a spell of C++/COM integration with Excel to try and extract a company's data which was a tangle of xls files forwarded around by email, some of which were full of macro viruses.

I work in the financial services sector which is basically held together with Excel, sticky tape, fluff and luck.

Edited: 7 May 2013, 11:19 a.m.

#7

Try "What´s Best" optimization software. It can be configured to handle global variables and so forth to solve multiple equations.

Give it a try. LINDO Inc. is the company that makes the software. Search the net for the obvious...

Cheers, Matti, Sweden

#8

Thanks David.

As an RF IC guy myself this is much appreciated, though now I'm thinking if the 50g should be on my desk too.

#9

Very nice! If only my HP15C had an USB port to load/store programs


Possibly Related Threads...
Thread Author Replies Views Last Post
  emu48 - copy stack doesn't work (as expected) Thomas Radtke 2 613 11-11-2013, 02:19 PM
Last Post: Thomas Radtke
  Another Prime mystery - templates don't work anymore Michael de Estrada 2 473 11-02-2013, 11:34 AM
Last Post: Michael de Estrada
  Does the HP Prime software only work with Win 7/ 8 ? Michael de Estrada 3 569 10-12-2013, 02:52 PM
Last Post: John Ioannidis
  Back to School/Work/Other Calculator Poll Eddie W. Shore 63 5,471 09-12-2013, 06:03 AM
Last Post: bhtooefr
  hp50g screen weird line Sok-khieng Chum Hun 2 415 09-10-2013, 08:11 AM
Last Post: Sok-khieng Chum Hun
  Documentation about Hp50g / 49g+ / 48gII and wikis Pier Aiello 9 871 09-10-2013, 04:22 AM
Last Post: Software49g
  "A Penny for your thoughts" on the HP50g Tom Grydeland 3 487 08-01-2013, 03:57 AM
Last Post: Les Koller
  Is there a HP50g emulator for Linux? Matti Övermark 2 433 07-03-2013, 07:40 AM
Last Post: Matti Övermark
  HP50G advanced applications for mathematics CompSystems 0 370 06-17-2013, 08:38 AM
Last Post: CompSystems
  HP50g rebind stat key Chris Smith 1 364 05-26-2013, 06:21 PM
Last Post: Software49g

Forum Jump: