Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
A brute force attack should work.
If your list of available resistors consists of n elements, then calculate the n^2 possible outcomes and use the closest.
Here are some rules of thumb. If you put equal resistors in parallel you will get a simple fraction i.e. 1/n. For example two (2) , 10k ohm equal resistors in parallel give you 1/2 (1/n in general) of 10k or 5k ohms etc.
So if I needed 2.5k ohms of resistance then two 5k ohms resistors would work or four (4) 10k ohm resistors.
Now if you put two (2) in parallel where one is very large (x10 or more) compared to the other then you just get a value very close to the smaller resistor. For example a 1k ohm and a 10k ohm in parallel basically will be approximately 1k ohm (actually 910 ohm).
So if you put two resistors in parallel the equivalent will never be more than the smallest value and never less than 1/2 of the smallest one.
Also when you are working with two resistors in parallel if the first is R1 and the second is a multiple (n) of it that is R2 = n x R1 then R1|| R2 = (n/n+1)* R1. So if you put a 100 ohm resistor in parallel with a 400 ohm resistor you get (4/5) x R1 or 750 ohms. This should make it easy to find two resistors that will work with math you can do in your head.
Hi,
Let me point out that parallel resistors are current dividers, while series resistors are voltage dividers. To solve your problem you must first of all take into account the tolerance of each resistor, that is, if the resistances all have the same tolerance then the resultant has the same tolerance. It is not so obvious if the tolerances are different. For example for two resistors in parallel, the equivalent resistance has a tolerance equal to:
For equal tolerances:
for different tolerances:
So you could create a C ++ program that, given the values and tolerances of the resistances, calculates the equivalent resistance of the parallel and goes to search into the database for the resistor with a value that is closer to that calculated taking into account also the resulting tolerance.
The inverse process is valid if, given a resistor, you look for two whose parallel, gives the given resistor.
Hi MFra Topaz and Derbigdog,
Thanks for your response. I think there is misunderstanding to my question.
I know how to find equivalent resistance, but what I don't know, how to automate the process if I need to find 2 values which gives me the expected equivalent resistance. These two resistors should be picked form the known database.
similar like this, but in PTC:
R3=1;
int main() R[n]; //database of knows values R[0] = 1; R[1]=2; R[2]=3 etc
{ for (int i = 0; i < 10; i++)
{ for (int j = 0; j < 10; j++)
{ if ((R[i]*R[j])/(R[i]+R[j])) == R3
then { R1:=R[j]; R2:=R[i]; } } }
return 0; }
thanks
Here goes the brute force method:
Attached is Prime 4.
Success!
Luc
Hi Luc!
That's great! I will try this method. It should work.
Thank you a lot!
Hi Luc,
How can I integrate more than one column of resistors in the database? Matrix does not work...R in not defined as it was a vector I suppose.
Your database should be a single column. If you specifically want a matrix there, you can write a program to work with that, but it makes things unnecessary complicated. My advice: Don't.
Also your database is corrupt: it contains the value 5 Ohm twice and three times the 7 Ohm.
Success!
Luc
great! thanks anyway!
You can get rid of the two iteration variables i and j, and also from the explicit matrix Rp, by assembling all that in a single function by programming.
Have a try at it, and if you run into problems come back here with your mathcad sheet attached. Due to Express I cannot start a program, but I may be able to edit an existing program. Else other forum members may be able to help.
Success!
Luc
Hi,
The database should respect the EIA standard values of the resistors, the most common are shown here:
so that yours database could be (for example resistors in kΩ):
Here is my version of the brute force attack I had in mind in my first answer.
Its an all-in-one routine and it calculates the table of possible achievable values every time it is called. I guess that, as long as your data table of resistance values is not really huge, this should be no performance problem. Otherwise you may change the function so its second argument is an already precalculated table.
The function also returns the value actually achieved and the relative difference - change as you need.
The function will also work with matrix of possible resistance values but I see no reason why you shouldn't use a simple vector.
Prime 4 worksheet attached
Thank you Werner!
Yes, there are many ways to solve this problem. Thank you all for contributing to the solution!
It's great to have such a support!