Post Reply 
How do I learn RPL and solve this problem with it?
09-25-2017, 06:36 PM (This post was last modified: 09-25-2017 06:52 PM by mfleming.)
Post: #17
RE: How do I learn RPL and solve this problem with it?
(09-25-2017 05:39 PM)pier4r Wrote:  Anyway I had to stop the process because after 20+ hours it was not finished.

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.

Consider Req = R1 || R2 = R1*R2/(R1+R2). If R1 = R2, then R1 & R2 = 2*Req. Neither R1 or R2 can be less that Req which puts a lower bound on the values we can choose. Also notice that if R2 increases to infinity then the computed Req value will converge on R1. If 2*Req happens to be a valid discrete resistor value, pick two resistors of that value and we're done.

Highly unlikely though, so pick R1 and R2 such that they bracket 2*Req. If we maintain that R1 is less than 2*Req, then there are only a few discrete resistor values that satisfy the constraint Req < R1 < 2*Req. Furthermore if R1 is fixed and R1 || R2 > Req, then any further increase in the value of R2 will only diverge from the desired Req value.

To use pier4r's example value of 177 for Req, 2*Req is 354 which is not a valid discrete resistor value. So choose R1=330 and R2=390. According to the previous constraint, the discrete value of R1 can only be 180, 200, 270, 300 and 330.

330||390 = 178.8 which is greater than 177, so no point increasing R2 any further. We will need to decrease R1 and compute again.

300||390 = 169.5 < 177 and 300||470 = 183.1 > 177 so keep the value of R2 and decrease the value of R1 again.

270||470 = 171.5 < 177 and 270||560 = 182.1 > 177 so again keep the value of R2 and decrease the value of R1.

I won't bore you with the rest of the series, but there are obviously a limited number of pairs to examine. Keep them sorted by how close they are to the desired resistor value and pick the closest pair.

Give this a try in RPL!
~Mark

Cui Bono?
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? - mfleming - 09-25-2017 06:36 PM



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