# Thread: Ordering resisters for the most stable circuit

1. ## Ordering resisters for the most stable circuit

i have to connect 50 resistors in a series circuit. each resistor has a different value of resistance. i must arrange them in a certain way so that my electrical circuit will be most stabile. although this seems to be an electronical issue, my problem is purely mathematical. the resistors have to be arranged using this equation:

( (R1/sumR - 1/50)^2 + ((R1+R2)/sumR - 2/50)^2 + ((R1+R2+R3)/sumR - 3/50)^2 + ... + ((R1+R2+R3+...+R49)/sumR - 49/50)^2 ) --> min

where R1-R49 are the values of resistance, and sumR is the sum of all 50 resistors

the combination of resistors for which this formula gives the minimum value is the combination i must use.

my problem, obviously, is that i would have to solve this equation for every combination of resistors in order to find the combination i need, and there are 50! possible permutations of 50 numbers.

only thing i've noticed is that the value of the first resistor must be closest to the arithmetic mean of all resistors(sumR/50).

any ideas???

2. Are you sure you didn't mean that the resistors are in a parallel circuit? Resistors in series merely add up, and since addition is commutative, it doesn't matter what order you put the resistors in. In parallel, they do that funky multiplicative inverse thing.

3. Originally Posted by Ackbeet
Are you sure you didn't mean that the resistors are in a parallel circuit? Resistors in series merely add up, and since addition is commutative, it doesn't matter what order you put the resistors in. In parallel, they do that funky multiplicative inverse thing.
actually, the circuit is a little more complicatad than that, but that's not the issue here. the equation i must use is 100% correct.

4. Very well. Let me prettify your equation, so you can confirm that I'm understanding the equation. You have the function

$\displaystyle \displaystyle f(\mathbf{R})=\left(\frac{R_{1}}{\sum_{n} R_{n}}-\frac{1}{50}\right)^{2}+\left(\frac{R_{1}+R_{2}}{\ sum_{n} R_{n}}-\frac{2}{50}\right)^{2}+\dots+\left(\frac{R_{1}+R_ {2}+\dots+R_{49}}{\sum_{n} R_{n}}-\frac{49}{50}\right)^{2}.$

Here, $\displaystyle \mathbf{R}=(R_{1},R_{2},\dots,R_{50}).$

Is that correct? If so, I could write it this way, could I not?

$\displaystyle \displaystyle f(\mathbf{R})=\sum_{k=1}^{49}\left(\frac{\sum_{j=1 }^{k}R_{j}}{\sum_{n=1}^{50}R_{n}}-\frac{k}{50}\right)^{2}.$

Would you agree?

A couple more questions: are the $\displaystyle R_{n}$ known already? And if so, you're saying that your problem is to assign the ordering of the resistors, 1 through 50, to minimize $\displaystyle f?$ Or are the resistor values unknown? In this case, the only constraint is that the resistor values be positive.

5. yes, tnx for making it prettier. all values are known. exactly, my problem is the ordering of resistors. the ordering is determined by the given formula, but i would have to use the formula 50! times to find the minimum value.

6. Ok. One solution would be if all the resistors had the same value. Then f would be equal to zero, and since f is non-negative, you'd have found your min. But you don't have that. Your resistor values are both known, and all the resistors have different values, one from another. Correct?

It seems to me that each term in f is a measure of how far from the average each of the sums

$\displaystyle \displaystyle \sum_{j=1}^{k}R_{j}$ are.

Here's my hunch. Let $\displaystyle R_{50}$ be the resistor whose resistance is farthest away from the mean. Let $\displaystyle R_{1}$ be the resistor whose resistance is closest to the mean. Order the resistors in-between accordingly. As $\displaystyle k$ increases, the resistor $\displaystyle R_{k}$ gets further away from the mean.

The reason I think this will work is that you have the law of large numbers working for you this way. The error in a sum goes up as $\displaystyle \sqrt{n}$, not as $\displaystyle n,$ because you'll have some numbers higher than the average, and some lower. Therefore, you want the error in the sums with fewer terms to be less, because on those sums, the law of large numbers is more against you.

Make sense?

7. actually, all resistors have the same nominal value, but the real values(determined by measuring the resistance of each resistor) differ, some higher, some lower than the nominal value.

i have already tried ordering them the way you suggested, but it seems that's not working...

example:

let's say we have only 4 resistors: 31, 33, 37, 40

the arithmetic mean is 35,25. so if i would order them the way you suggested(the way i also at first thought was correct), i would get: 37, 33, 31, 40

but my equation gives smaller value for lets say: 33, 40, 31, 37

8. Maybe it does. Original post: alternate on either side of the arithmetic mean.

9. I think your function doesn't change if you reverse the order of the resistors.

10. Post # 8 has settled down with my edits.

11. Originally Posted by Ackbeet
I think your function doesn't change if you reverse the order of the resistors.
if i understand you correctly, you're implying that it doesn't matter if the order is 33, 40, 31, 37 or 37, 31, 40, 33. that's true, but there's still the question - how to order them?

12. New idea: order by distance from the mean, but alternate on either side of the mean until you run out on one side. Then just continue on the remaining side.

So, if you had 1,2,3,4,5,6,7,8,9,10,15,20, the mean would be 7.5. Then order this way: 8,7,9,6,10,5,15,4,20,3,2,1. See what this does for you.

13. Originally Posted by Ackbeet
New idea: order by distance from the mean, but alternate on either side of the mean until you run out on one side. Then just continue on the remaining side.

So, if you had 1,2,3,4,5,6,7,8,9,10,15,20, the mean would be 7.5. Then order this way: 8,7,9,6,10,5,15,4,20,3,2,1. See what this does for you.
not sure if that works either. i wrote a program in C that orders the resistors using my formula, but it only works well for 11 resistors or less(for more it's too slow), so i can't test your example.

but here's another example: 2,31,32,33,34,35,36,37,1000,2000

your algorithm, if i'm not mistaking, gives: 37,1000,36,2000,35,34,33,32,31,2

my program says the best combination is: 33,1000,34,36,32,2,2000,31,35,37

14. as i said before, the only thing i figured out is that the first element(or the last, if you look from right to left), is always the one closest to the mean...for the order of others i can't find the rule...

15. A thought. The distribution of the resistance values could have a significant effect on the order. For example: my solution might be perfectly fine if the distribution of the resistance values is well-modeled by a Gaussian curve. Your data set with the 1000 and 2000 in it is not well-modeled by a Gaussian.

What does your program give for this set:

A = {34.3096, 31.8650, 35.3775, 31.5077, 36.4964, 37.5626, 30.0415, 36.0058, 31.5077, 35.2505}?

This order is my candidate for the solution. I got these numbers by generating a set of 10 numbers with Gaussian distribution (this is what you have with your nominal resistor values): mean 34, standard deviation 3.

Because the solution space is so large, you have only two possibilities. One is that you can prove that a particular ordering gives the minimum (you might find this difficult). Or, you have to content yourself with some optimization algorithm that gives a decent answer, but might not be the global minimum. There are loads of algorithms you could try on this problem. I would recommend taking a look at this book for some ideas in that vein.

Page 1 of 2 12 Last