Electronics > Beginners

EE Pros: Is RPN still relevant?

<< < (10/21) > >>

TNorthover:

--- Quote from: orolo on March 04, 2017, 10:32:47 pm ---I have often wondered if RPN should be typically used: math notation is burdened by tradition.
--- End quote ---

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

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


Rick Law:

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

--- End quote ---

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.

kultakala:
I searched all drawers...  could only find RPN  ;D



34S is the one always on my desk

Rick Law:

--- Quote from: kultakala on March 05, 2017, 10:00:40 pm ---I searched all drawers...  could only find RPN  ;D
...

--- End quote ---

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

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod