Author Topic: EE Pros: Is RPN still relevant?  (Read 30588 times)

0 Members and 2 Guests are viewing this topic.

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6420
  • Country: de
Re: EE Pros: Is RPN still relevant?
« Reply #25 on: March 04, 2017, 09:11:35 pm »
Quote
Instead I bought a SwissMicros DM15L clone of the HP 15C.

Are you aware that the SwissMicro devices are less than half the size (in area) of an original HP-15C? I think you may need pointy fingers.
HP-15C: ~130 x 95 mm2
DM15: 88 x 59 mm2

 

Elf

  • Guest
Re: EE Pros: Is RPN still relevant?
« Reply #26 on: March 04, 2017, 09:17:43 pm »
Are you aware that the SwissMicro devices are less than half the size (in area) of an original HP-15C? I think you may need pointy fingers.
HP-15C: ~130 x 95 mm2
DM15: 88 x 59 mm2
The DM15 (non-L) version is the small version with the plastic dome keys. However the L ("Large") version is near the original size: 129x79x13mm. It also has normal (apparently pretty good) keys, and is a bit more expensive.
 

Offline eugenenine

  • Frequent Contributor
  • **
  • Posts: 871
  • Country: us
Re: EE Pros: Is RPN still relevant?
« Reply #27 on: March 04, 2017, 09:31:45 pm »
Do yourself a favor, download "free42" on your phone (fruit or robot), and if you want, to your desktop (fruit, non-flying bird or glazed hole in the wall).
It's a one to one emulation of one of the best (IMHO) HP calculators.


I have a 48sx so I'm using this one https://sourceforge.net/projects/x48.berlios/files/
 

Offline jakeisprobablyTopic starter

  • Regular Contributor
  • *
  • Posts: 168
  • Country: us
    • Upcycle Electronics
Re: EE Pros: Is RPN still relevant?
« Reply #28 on: March 04, 2017, 09:53:04 pm »
So, I think I understand now... Get, and learn how to use an old RPN calculator because it's effective, and secondly, it's a nod to the current generation of EE masters. It might be worth a bit of street cred on a new guy's work station down the road.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6420
  • Country: de
Re: EE Pros: Is RPN still relevant?
« Reply #29 on: March 04, 2017, 09:55:10 pm »
Quote
The DM15 (non-L) version is the small version with the plastic dome keys. However the L ("Large") version is near the original size: 129x79x13mm. It also has normal (apparently pretty good) keys, and is a bit more expensive.

Ah! Thanks. The SwissMicros site is somehow a bit "lobotomized", several of the links don't work.

 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6420
  • Country: de
Re: EE Pros: Is RPN still relevant?
« Reply #30 on: March 04, 2017, 10:01:31 pm »
Quote
It might be worth a bit of street cred on a new guy's work station down the road.

Actually, the street/lab cred comes when you whip out the HP-15C from your breast pocket, turn it on and do the calculation in 5 seconds, then return it to your pocket, while the PFY, nose down in his smartphone, is still searching for the calculator app.

« Last Edit: March 04, 2017, 11:23:01 pm by Benta »
 

Offline TNorthover

  • Contributor
  • Posts: 42
  • Country: us
Re: EE Pros: Is RPN still relevant?
« Reply #31 on: March 04, 2017, 10:03:13 pm »
Taking a tuple is essentially the same as taking a couple of elements from the top of a stack. When one uses infix notation, one is implicitly currying the addition function, which is in fact stretching its algebraic definition.

That's a computation-theoretic view of what's going on, and even then it's one particular computational model. By taking the stack as the fundamental object you're baking in RPN or some equivalent. I don't think it's a model used by most mathematicians for their general work.

Infix expressions seem to naturally be some kind of tree structure over operations or formulae or whatever (it'll vary by context); and you could indeed use a stack to combine the components into a final one, but it doesn't seem necessary. Alternatively you could make some kind of tree-traversal your basis; some stack involvement is likely as an implementation detail simply because that's how computers work.

Edit: And maths itself is just logical formulae with no stack in sight, at its basis. ZF set theory and so on.
« Last Edit: March 04, 2017, 10:07:23 pm by TNorthover »
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6420
  • Country: de
Re: EE Pros: Is RPN still relevant?
« Reply #32 on: March 04, 2017, 10:12:48 pm »
@ orolo and TNorthover:

You're scaring people away from HP RPN calculators. Just sayin'   ::)
 
The following users thanked this post: orolo

Offline bson

  • Supporter
  • ****
  • Posts: 2497
  • Country: us
Re: EE Pros: Is RPN still relevant?
« Reply #33 on: March 04, 2017, 10:19:01 pm »
RPN really excels when chaining calculations, and in fact promotes thinking like this instead of setting up formal expressions to be evaluated left to right.  For example, you want to drive a small LED at 2mA, so you have a simple BJT: 12V supply, a resistor, the LED, and a BJT - and you just want a ballpark figure for Ib so you can size a resistor for it to interface to a 3.3V CMOS output.

So you start with the supply voltage 12V.
Subtract Vce(sat) for the transistor, say 0.25V.
Subtract Vf for the LED.  Now you're left with the voltage over R.
Hmm, maybe we should also check the power dissipation of R?
So DUP it on the stack.
Divide the voltage on the stack by R, now we have Ic.
Calculate the power dissipation: dup, over, *, swap; now we have it in Y and Ic in X
Approximate Ie = Ic, and divide by min current gain for the BJT
Now we need the base resistor voltage: 3.3V, subtract 0.65 for Vbe
Divide this by the current in Y: swap, divide
Now we have the base resistor resistance in X, and the current limiting resistor dissipation in Y

As a result of doing this, you will have implicitly sanity checked every single step of the way.
No pen and paper needed to sit and write up expressions to type in on the calculator.  In addition to the transcription stage you only get very limited partial results out of algebraic calculators.
« Last Edit: March 04, 2017, 10:22:08 pm by bson »
 

Offline bson

  • Supporter
  • ****
  • Posts: 2497
  • Country: us
Re: EE Pros: Is RPN still relevant?
« Reply #34 on: March 04, 2017, 10:30:33 pm »
When evaluating formal expressions on an RPN calculator you generally want to work your way from the innermost subexpression and out.  This tends to be easier and less error prone than piling up partial values going left to right.  Leave that task to compilers.  Or get a calculator like the HP-50g HP Prime that has symbolic entry; this lets you enter your expression and check it for correctness before evaluating.
« Last Edit: March 04, 2017, 10:33:49 pm by bson »
 

Offline orolo

  • Frequent Contributor
  • **
  • Posts: 352
  • Country: es
Re: EE Pros: Is RPN still relevant?
« Reply #35 on: March 04, 2017, 10:32:47 pm »
My argument was that RPN arises naturally from function composition. In strict algebraic terms, 2+3 is shorthand for +(2,3) where '+' is a function acting on tuples. It is, therefore, more natural to write 2 3 +, meaning you first define the tuple, and then apply the function. As I mentioned, with arithmetics there is little trouble going infix, bit with higher levels of abstraction things get different. The stack model is mostly irrelevant; it's the tuples that are important. I have often wondered if RPN should be typically used: math notation is burdened by tradition. Perhaps the worst detail is the use of - both for substraction and negative numbers. Lots of trouble for begginers.
 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2507
  • Country: gb
Re: EE Pros: Is RPN still relevant?
« Reply #36 on: March 04, 2017, 10:32:56 pm »
I've been watching a few tutorials on the Fourth programming language and looking into the history of calculators. Reverse Polish Notation seems, to me, to be more intuitive due to it's linear structure.
    For a new student just getting started, is it worthwhile to learn and utilize RPN in the professional world at this point?
Cool.  FORTH was a great language of its time.  In fact I've been toying with the ideal of re-visiting it myself.  There was a really interesting book called "Threaded Interpretive Languages by Loeliger" that is worth a read is you are interested in computer archaeology; this book managed to make my interested enough to spend my last year at school porting FIG FORTH to the Commodore PET!  FORTH was big in niche areas like Astronomy for a while.
For a new student just getting started, is it worthwhile to learn and utilize RPN in the professional world at this point?
Short answer: NO.
Modern calculators have brackets so expressions do not need to be decomposed in the same way they used to.  My kids use fx-995ES type calculators and it does most of what they need will no RPN in sight.

Long answer: YES
RPN is fun!  There are commercial RPN calculators like HP35s which I have sitting beside me which are readily available. Personally I grew up without brackets so it works for me.

Even longer answer: YES!
Build yourself a https://sourceforge.net/projects/wp34s/.   I have made a few of these in the past and sold them on EBAY.  All you need is a HP-30B calculator, often available at bargain prices as there seems to be excess stock (or was when I last looked), a keyboard overlay from http://commerce.hpcalc.org/overlay.php and then a simple reflash using a USB Serial TTL converter.  I love my WP34S but keep forgetting how to use it!




 

Online artag

  • Super Contributor
  • ***
  • Posts: 1284
  • Country: gb
Re: EE Pros: Is RPN still relevant?
« Reply #37 on: March 04, 2017, 10:42:25 pm »
I'm not sure what you mean by 'is RPN still relevant ?'.
It's still a pleasure. Isn't that enough ?

The thing about calculators is that they're personal. You use them to help your brain. It's reasonable to ask if some programming language is relevant, because there's a good chance you'll use it to earn money and you might want to learn a language that will get you a job. But you learn a calculator's keystrokes for your own use.

Despite that, there's probably only one calculator on the planet that IS a stock-in-trade for some profession (though, I hope, not one we'll find represented here). And that's the HP12C.

« Last Edit: March 04, 2017, 10:47:42 pm by artag »
 

Offline claytonedgeuk

  • Contributor
  • Posts: 28
  • Country: nz
Re: EE Pros: Is RPN still relevant?
« Reply #38 on: March 04, 2017, 10:50:59 pm »
I'm not sure what you mean by 'is RPN still relevant ?'.
It's still a pleasure. Isn't that enough ?

The thing about calculators is that they're personal. You use them to help your brain. It's reasonable to ask if some programming language is relevant, because there's a good chance you'll use it to earn money and you might want to learn a language that will get you a job. But you learn a calculator's keystrokes for your own use.

Despite that, there's probably only one calculator on the planet that IS a stock-in-trade for some profession (though, I hope, not one we'll find represented here). And that's the HP12C.
Haha....its actually the hp12c that got me into this.  My first rpn....set the standard really.

Sent from my SM-G900F using Tapatalk

 

Offline xrunner

  • Super Contributor
  • ***
  • Posts: 7836
  • Country: us
  • hp>Agilent>Keysight>???
Re: EE Pros: Is RPN still relevant?
« Reply #39 on: March 04, 2017, 11:09:12 pm »
Do yourself a favor, download "free42" on your phone (fruit or robot), and if you want, to your desktop (fruit, non-flying bird or glazed hole in the wall).
It's a one to one emulation of one of the best (IMHO) HP calculators.

Thank you! I still have my HP 42S right in front of me, and I didn't know of that app.  :clap:
I told my friends I could teach them to be funny, but they all just laughed at me.
 

Online artag

  • Super Contributor
  • ***
  • Posts: 1284
  • Country: gb
Re: EE Pros: Is RPN still relevant?
« Reply #40 on: March 05, 2017, 01:04:04 am »
"Hey, can I borrow your calculator?"
"Sure, here you go."
*silence while calculator is inspected*
"Um, no thanks."

https://xkcd.com/1806/
 

Offline w2aew

  • Super Contributor
  • ***
  • Posts: 1780
  • Country: us
  • I usTa cuDnt speL enjinere, noW I aR wuN
    • My YouTube Channel
Re: EE Pros: Is RPN still relevant?
« Reply #41 on: March 05, 2017, 01:06:46 am »
...and one of the best reasons to use RPN calculator at work...  ..it will keep most people from borrowing your calculator.
YouTube channel: https://www.youtube.com/w2aew
FAE for Tektronix
Technical Coordinator for the ARRL Northern NJ Section
 
The following users thanked this post: xrunner, NivagSwerdna

Offline xrunner

  • Super Contributor
  • ***
  • Posts: 7836
  • Country: us
  • hp>Agilent>Keysight>???
Re: EE Pros: Is RPN still relevant?
« Reply #42 on: March 05, 2017, 01:07:44 am »
...and one of the best reasons to use RPN calculator at work...  ..it will keep most people from borrowing your calculator.

 :clap:  :-+
I told my friends I could teach them to be funny, but they all just laughed at me.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17427
  • Country: us
  • DavidH
Re: EE Pros: Is RPN still relevant?
« Reply #43 on: March 05, 2017, 04:06:53 am »
"Hey, can I borrow your calculator?"
"Sure, here you go."
*silence while calculator is inspected*
"Um, no thanks."

https://xkcd.com/1806/

Haha, I've done that!

I used to rewire my keyboards to swap Caps Lock and Control so that the Control key is adjacent to the A key like God intended.  These days I install a driver or edit the registry to do the same thing because modifications to membrane keyboards are difficult but I suspect my next keyboard will have mechanical switches.
 

Offline TNorthover

  • Contributor
  • Posts: 42
  • Country: us
Re: EE Pros: Is RPN still relevant?
« Reply #44 on: March 05, 2017, 05:21:40 am »
@ orolo and TNorthover:

You're scaring people away from HP RPN calculators. Just sayin'   ::)

Not intentionally at all (I just have a weakness for discussing the foundations of maths). My primary calculator is actually an HP-48G. I think a reasonably competent human can use both schemes without diffficulty.

Where I think HP really excels is actually the programming language. Before I used Casio graphing calculators, and they use some kind of proprietary bastardised basic dialect. I've played with TI before too without being too impressed. Being able to write programs in terms of something remarkably close to lambda calculus is great!
 

Offline TNorthover

  • Contributor
  • Posts: 42
  • Country: us
Re: EE Pros: Is RPN still relevant?
« Reply #45 on: March 05, 2017, 05:44:03 am »
I have often wondered if RPN should be typically used: math notation is burdened by tradition.

Now that last part I definitely agree with.

Personally, I don't think RPN is the right way to go (which isn't to say it's a bad way to enter computations into a computer or calculator at all!). Its strict linearization doesn't really reflect how people actually manipulate concepts, which I think is more of a pattern-matching substitution kind of operation.

An interesting data-point is one of the more modern mathematical notations: Feynman diagrams. These are pictures that are used to represent concrete terms in some approximation for quantum mechanics. Syntactically they're not trees, or even acyclic graphs. They're possibly loopy graphs with bells and whistles; but if you give one to a bunch of physicists and ask them to write down an equivalent formula they'll basically agree.

So I'm in favour of searching for richer notations rather than trying to linearize everything (except at the human/computer interface where it's essential, and I'm undecided on the best approach).
 
The following users thanked this post: orolo

Offline djacobow

  • Super Contributor
  • ***
  • Posts: 1170
  • Country: us
  • takin' it apart since the 70's
Re: EE Pros: Is RPN still relevant?
« Reply #46 on: March 05, 2017, 08:58:53 am »
I'm still a big RPN fan. I use a 48GX, 32S II, and a couple others.

Another neat thing about RPN is how easy it is to implement. I have done so in Perl and in Node.js and use them all the time. Part of the fun of doing it was writing RPN programs to test the calculator, expand taylor series, perform numeric integration, etc. Learning to deal with the stack to hold not just your operands but working variables, counters, etc, can get trippy, especially if your program calls programs that call programs, etc.

One simple program that I use every single day is this one:

<< inv swap inv + inv >> 'REQ' STO

Then I can just do: 2200 3300 REQ and I'll get 1320 -- the equivalent parallel resistance.

My calculators (the real ones and the software ones) do complex numbers naturally, too, so I can use the same function with complex impedances and it's all hunky dory.

Attached is a picture of the node version running as a chatbot connected to Google talk. This is nice because I can access the calculator from any of my devices, and they all share the same stack because it is hosted on the server.


« Last Edit: March 05, 2017, 09:00:25 am by djacobow »
 
The following users thanked this post: frozenfrogz

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3490
  • Country: us
Re: EE Pros: Is RPN still relevant?
« Reply #47 on: March 05, 2017, 08:38:18 pm »
So, I think I understand now... Get, and learn how to use an old RPN calculator because it's effective, and secondly, it's a nod to the current generation of EE masters. It might be worth a bit of street cred on a new guy's work station down the road.

It is a bit more than "because it's effective" and "street cred" is computation/programming more than it is EE.

Some calculator can resolve an expression and then do the arithmetic.  Whereas RPN is a method of doing the arithmetic steps expressed in the expression.  Furthermore, RPN is a methodology that is similar to how the CPU used to work.  So if you don't know how to evaluate an expression using RPN, you would not be able to write assembler code to do the evaluation.

An expression contains multiple steps: Answer=A-B*(C+D) is an expression.
To add C and D is an arithmetic step to solving the expression expressed above.


CPU has changed much.  Even simple MCU's can work on numbers in directly in memory (skipping the need to first load them into registers), but it still can't do expressions.  It needs a higher level language such as C/C++ to translate the expression into arithmetic steps.  In assembly, the programmer is the one doing translation of an expression into arithmetic steps.  In many cases, we still need to do some assembler language stuff to make our MCU program do certain things.  Your being able to translate an algebraic expression into RPN reassures everyone that you can do arithmetic with your MCU when needed.
 

Offline kultakala

  • Regular Contributor
  • *
  • Posts: 111
  • Country: de
Re: EE Pros: Is RPN still relevant?
« Reply #48 on: March 05, 2017, 10:00:40 pm »
I searched all drawers...  could only find RPN  ;D



34S is the one always on my desk
« Last Edit: July 18, 2017, 11:37:27 am by kultakala »
 

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3490
  • Country: us
Re: EE Pros: Is RPN still relevant?
« Reply #49 on: March 05, 2017, 11:04:29 pm »
I searched all drawers...  could only find RPN  ;D
...

I know I have an HP35 + an HP45 somewhere.  I can even picture the name sticker I put on the HP45 eons ago, but I can't find them.

Then again, it was hard times during college/grad school.  Given my age, it is possible I sold my HP's just to get by dry spells and forgot all about selling it.

Always look on the bright side of life.  When more severe senility strikes, I would have an infinite collection of great movies I have not seen before.  And then shortly after (re)watching them, I would forgot and I can watch it again as "new" movies... 
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf