Post Reply 
How do I learn RPL and solve this problem with it?
09-25-2017, 08:27 PM
Post: #23
RE: How do I learn RPL and solve this problem with it?
(09-25-2017 06:36 PM)mfleming Wrote:  Hi guys,

I believe you've been misled by the OP's approach of pre-computing all possible values of two resistors in parallel (combinatorial explosion), when in reality there are only a few combinations of two resistors that will meet the original criteria of being within 1% of the desired resistance value.

I agree, there's 4 or 5 valid values, no need to precompute anything.
The basic tasks can be broken into:
  1. Find the smallest resistor in E12 that is >= requested.
  2. Find the largest resistor in E12 <= 2*requested.
  3. Make a list of all valid resistors in E12 between them (only 4 or 5 total, since 1.211^4 > 2)
  4. Compute the second resistor needed for each case, but in each case finding the closest E12 resistor to the computed value.
  5. Compute the error for each case, make sure is within tolerance.
  6. Present the choice to the user in a nice way

Note that 1, 2 and 4 are basically the same, lookup the E12 resistor given a value, but in one case get the lower bound, in the other the upper and the third is closest match. Perhaps a single routine can handle all 3 cases. Task #3 can also reuse the same routine, since the next valid resistor would be the closest match to R*1.211 (with R being a valid E12 resistor).
That's the simplest way I see it. And that's not taking anybody by the hand, as each task is a project on itself.
So the first goal would be a routine that given any value, finds the lower, upper and closest match in the E12 series.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How do I learn RPL and solve this problem with it? - Claudio L. - 09-25-2017 08:27 PM



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