HP Forums
(15C) Parallel Resistance, two resistors - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (15C) Parallel Resistance, two resistors (/thread-20376.html)



(15C) Parallel Resistance, two resistors - SlideRule - 08-23-2023 11:52 PM

An excerpt from EDN magazine, HP-15 program needs fewest strokes, Jon Vicklund, 11/OCT/1990, page 242.

"The program in LISTING 1 takes advantage of a Hewlett-Packard RPN calculator's stack operators to calculate the parallel resistance of two resistors using a minimum number of keystrokes.

Listing 1―Minimal-keystroke parallel-resistance
              calculation for HP-15 calculator

R1                            ; R1 value
ENTER↑ ENTER↑         ; press enter twice
R2                            ; R2 value
ENTER↑                     ; enter
R↓                            ; roll down
+                             ; add
X↔Y                         ;interchange X, Y
÷                             ; divide Y by X
÷                             ; divide Y by X
Display = REQ"

BEST!
SlideRule


RE: (15C) Parallel Resistance, two resistors - Steve Simpkin - 08-24-2023 12:31 AM

It seems like the typical steps shown (4) below to calculate parallel resistance use less keystrokes than the EDN example (8).

R1
1/x
R2
1/x
+
1/x


RE: (15C) Parallel Resistance, two resistors - Joe Horn - 08-24-2023 01:36 AM

Both programs above return 5.999999999 for values of 15 and 10 in R1 and R2 respectively. The program below returns the correct result of 6.

RCL 1
RCL × 2
RCL 1
RCL + 2
÷
RTN

Optimizing this code is left as an exercise for old PPC members. Big Grin


RE: (15C) Parallel Resistance, two resistors - Steve Simpkin - 08-24-2023 03:02 AM

This is about the shortest I can come up using the above formula and only the stack.
To use:
R1
Enter
R2

----------
Enter
Rdn
X<>Y (swap X-Y)
X
Last X
Rup
+
/
RTN


RE: (15C) Parallel Resistance, two resistors - Thomas Klemm - 08-25-2023 03:30 AM

It's interesting that it was declared as the minimal solution when the obvious solution is shorter:

R1
ENTER ENTER
R2

×
x↔y
LST x
+
÷

On the HP-41C we can bring it down to:

ST* Z
+
/

And even Joe can be happy with the result.


RE: (15C) Parallel Resistance, two resistors - J-F Garnier - 08-26-2023 02:18 PM

(08-24-2023 01:36 AM)Joe Horn Wrote:  Both programs above return 5.999999999 for values of 15 and 10 in R1 and R2 respectively. The program below returns the correct result of 6.

RCL 1
RCL × 2
RCL 1
RCL + 2
÷
RTN

Beside the two mentioned equivalent formulae:
   Req=R1.R2/(R1+R2)
and
   Req=1/(1/R1+1/R2)
there is a third (also equivalent) one that I'm using occasionally, even without programming:
   Req=R1/(1+R1/R2)
which is quite convenient when R1 is a multiple of R2, e.g.
R1=100k, R2=10k, Req=100k/(1+10) = 9.09k

The benefit of the two last formulae is that they can be easily extended to handle multiple parallel resistors:
   Req=1/(1/R1+1/R2+1/R3+...+1/Rn)
or
   Req=R1/(1+R1/R2+R1/R3+...+R1/Rn)

J-F


RE: (15C) Parallel Resistance, two resistors - Thomas Klemm - 08-26-2023 05:20 PM

(08-26-2023 02:18 PM)J-F Garnier Wrote:     Req=R1/(1+R1/R2)

Nice. With this formula we can make it even shorter:

R1
ENTER ENTER
R2

÷
1
+
÷


If we use it with R1=15 and R2=10 Joe is still happy.
Not so much if we reverse the entries.