Post Reply 
More Accurate Parallel Resistance
01-26-2014, 10:33 AM (This post was last modified: 05-29-2017 01:41 PM by Joe Horn.)
Post: #1
More Accurate Parallel Resistance
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.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
01-26-2014, 11:46 AM
Post: #2
RE: "Pres": More Accurate Parallel Resistance
Thank you, Joe. That "catastrophic accumulation of roundoff errors" issue while calculating parallel resistance values has been keeping me up at night lately Smile
Visit this user's website Find all posts by this user
Quote this message in a reply
01-27-2014, 07:31 AM
Post: #3
RE: "Pres": More Accurate Parallel Resistance
(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.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
09-01-2014, 10:20 AM
Post: #4
RE: "Pres": More Accurate Parallel Resistance
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?
Find all posts by this user
Quote this message in a reply
09-01-2014, 10:50 AM (This post was last modified: 09-01-2014 10:51 AM by Didier Lachieze.)
Post: #5
RE: "Pres": More Accurate Parallel Resistance
(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]
Find all posts by this user
Quote this message in a reply
09-01-2014, 02:56 PM
Post: #6
RE: "Pres": More Accurate Parallel Resistance
Indeed, this is the more direct way. Couldn't find it in the manual.
Thank you very much, Didier.
Find all posts by this user
Quote this message in a reply
01-12-2017, 11:56 PM (This post was last modified: 01-14-2017 05:46 PM by BERNARD MICHAUD.)
Post: #7
RE: "Pres": More Accurate Parallel Resistance
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
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)