HP Forums

Full Version: More Accurate Parallel Resistance
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
A program was recently posted which calculates the total resistance of multiple resistors connected in parallel. Unfortunately it uses the standard definition of the reciprocal of the sum of the reciprocals. That definition often leads to roundoff errors accumulating. For example, the total resistance of a 10 ohm resistor and a 15 ohm resistor conntected in parallel is exactly 6 ohms, but all 12-digit HP calculators (in standard display mode) get 5.99999999999 for 1/(1/10+1/15) because of accumulated roundoff errors.

Here's a more accurate parallel resistance program, called "Pres". It avoids catastrophic accumulation of roundoff errors in all but pathological cases (e.g. many large numbers). It's so simple that it can be entered as a user function.

Press the Shift Define key. Type Pres in the Name field, and the following in the Function field:

Code:
ΠLIST(L)/ΣLIST(ΠLIST(L)/L)

To use it, type Pres({list of two or more resistances}). Example: Pres({10,15}) --> 6.

Note #1: Search comp.sys.hp48 for a thorough discussion of various methods of finding parallel resistance accurately, such as this one. Roger Rosenbaum and John Meyers shared many insights and discoveries about it over the years. Many pathological examples are also given, showcasing the strengths and weaknesses of each method. The standard definition is the worst.

Note #2: Since Prime's CAS performs exact math on integers and ratios of integers, a CAS program would always get the exact answer, even for many huge inputs, if they were all integers or ratios of integers. The above user function is only accurate to 12 digits.
Thank you, Joe. That "catastrophic accumulation of roundoff errors" issue while calculating parallel resistance values has been keeping me up at night lately Smile
(01-26-2014 11:46 AM)Steve Simpkin Wrote: [ -> ]Thank you, Joe. That "catastrophic accumulation of roundoff errors" issue while calculating parallel resistance values has been keeping me up at night lately Smile

Exactly! Being off by 0.00000000001 ohms makes space shuttles explode! >:-O

More seriously, I was hugely impressed as a youngster at the lengths HP went to in search of excellence and accuracy in their calculators, even worrying about errors in the last digit. And in this case it's very easy to be more accurate, so why not. Even when excellence is not necessary, it's still a fun challenge.
Gentlemen, call me stupid, but how can I type in a line like
ΠLIST(L)/ΣLIST(ΠLIST(L)/L) ?
Look up the Pi and Sigma symbols via the Chars key or is there a more direct way?
(09-01-2014 10:20 AM)René Franquinet Wrote: [ -> ]Gentlemen, call me stupid, but how can I type in a line like
ΠLIST(L)/ΣLIST(ΠLIST(L)/L) ?
Look up the Pi and Sigma symbols via the Chars key or is there a more direct way?

Toolbox Key, Math, List, items 8 & 9:
[Image: Math_List.png?psid=1]
Indeed, this is the more direct way. Couldn't find it in the manual.
Thank you very much, Didier.
A simple small programs for for those interested, using Joe's formula above which can calculate Series or Parallel Impedances. The program prompts you to enter several resistance and/or impedance values except '0' of course in the List L1 which you usually get by <Shift 7>, and press Enter.

Code:
//Program Name SerParImp or your choice.
EXPORT Series()
BEGIN
L1:=0;//Clears values in L1
MSGBOX("  Enter your impedances
        in the List L1
         Press Enter");
EDITLIST(L1);//Prompts to enter values in the list
PRINT();
PRINT("





       Total Series Impedance = "+ΣLIST(L1));//Calculate and display result.
END;

EXPORT Parallel()
BEGIN
L1:=0;
MSGBOX("  Enter your impedances
        in the List L1
         Press Enter");
EDITLIST(L1);
PRINT();
PRINT("





    Total Paralllel Impedance = "+ΠLIST(L1)/ΣLIST(ΠLIST(L1)/L1));
END;

BM
Reference URL's