How can I write complex equations using Reverse Polish notation?

  • Thread starter Thread starter Synetos
  • Start date Start date
  • Tags Tags
    Notation Reverse
Click For Summary
SUMMARY

This discussion focuses on writing complex equations using Reverse Polish Notation (RPN) specifically on the HP 48 calculator. The user illustrates how to compute the square root of the sum of squared derivatives of variables x, y, and z using RPN syntax. Key operations include 'Enter' for storing values, 'X2' for squaring, '+' for addition, and 'Sqrt' for square root extraction. The final expression is presented in a compact RPN format: x d/dt 2 y d/dt 2 + z d/dt 2 + SqRoot Integrate.

PREREQUISITES
  • Understanding of Reverse Polish Notation (RPN)
  • Familiarity with basic calculus operations such as differentiation and integration
  • Knowledge of using the HP 48 calculator
  • Basic algebraic manipulation skills
NEXT STEPS
  • Learn advanced RPN techniques for complex mathematical expressions
  • Explore the differentiation and integration functions available on the HP 48
  • Study the implementation of custom operators in RPN calculators
  • Practice writing and evaluating RPN expressions for various mathematical functions
USEFUL FOR

Mathematicians, engineering students, and anyone interested in using RPN for complex calculations, particularly those utilizing the HP 48 calculator.

Synetos
Messages
37
Reaction score
1
So I need some help with RPN, I checked the wiki page but I still don't quite get it. Like I get simple multiplications, aditions etc. But how would you for example write:
}^{2}%20\sqrt{%20(\frac{dx}{dt})^{2}%20+%20(\frac{dy}{dt})^{2}%20+%20(\frac{dz}{dt})^{2}%20%20}}.png
 
Last edited:
Physics news on Phys.org
Synetos said:
So I need some help with RPN, I checked the wiki page but I still don't quite get it. Like I get simple multiplications, aditions etc. But how would you for example write:
}^{2}%20\sqrt{%20(\frac{dx}{dt})^{2}%20+%20(\frac{dy}{dt})^{2}%20+%20(\frac{dz}{dt})^{2}%20%20}}.png

Let me simplify things a bit, using x', y', and z' for values the derivatives, so that x' means the value of dx/dt at some specific t. Same for y' and z'.

To get the value of the radical you could do this:
x' Enter X2 y' Enter X2 + z' Enter X2 + Sqrt

I'm thinking in terms of how you would evaluate a similar expression on an RPN calculator, such as the HP 48.

In the expression above X2 is the operation that pops the value at the top of the stack, squares it, and stores the squared value at the top of the stack.
Enter is the operation that stores the value preceding it on the stack.
+ is the operation that pops the top two values on the stack, adds them, and stores their sum at the top of the stack.
Sqrt pops the top of the stack, takes the square root of it, and stores that value on the stack top.
 
Synetos said:
So I need some help with RPN, I checked the wiki page but I still don't quite get it. Like I get simple multiplications, aditions etc. But how would you for example write:
}^{2}%20\sqrt{%20(\frac{dx}{dt})^{2}%20+%20(\frac{dy}{dt})^{2}%20+%20(\frac{dz}{dt})^{2}%20%20}}.png

It's the way you'd do it in your head if you didn't want to remember too many intermediate results. There are different things you might want to use as operators, I made it simple with d/dt and integrate. You might instead have a d?/d? operator which takes two parameters, the function and the variable to differentiate with respect to.

Find x
Apply d/dt to it
Square it
Find y
Apply d/dt to it
Square it
Add the results of those two squarings
Find z
Apply d/dt to it
Square it
Add the result of the previous sum to this last result
Square root it
Integrate it

Rewritten in one line it becomes
x d/dt 2 y d/dt 2 + z d/dt 2 + SqRoot Integrate

To interpret that it might be clearer with brackets. Each operator applies to the "thing" immediately before it. Or two things in case of the + operator.
( < [ ((x d/dt)2) ((y d/dt)2) + ] [ (z d/dt)2 ] + >SqRoot )Integrate
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 0 ·
Replies
0
Views
1K
  • · Replies 11 ·
Replies
11
Views
5K