Using Row 1 and column 1 as co-ordinates.

C

Cap'n Jax

I understand this will seem confusing, but I am quite certain someone will
know how to help me.

I am an electronic engineer, and as such I use different value resistors a
lot.
However, there are only certain values of resistors available, and i
frequently need an obscure value, which is not available as a single
resistor, but i can make through a combination of resistors.

I made a table in Excel to help with this, with the values of the resistors
in the first column and row, and all of the other cells read the value of the
resulting resistance for that cell's column and row (e.g. 12 Ohms and 24 Ohms
would give me 8 Ohms)

What I need help with is I have been asked to make a program that, if you
input a number, will tell you which combination of resistors I would need.

I would much appreciate any input from anyone who thinks they can help.

Jack
 
S

Stefan Hoffmann

hi,

Cap'n Jax said:
I made a table in Excel to help with this, with the values of the resistors
in the first column and row, and all of the other cells read the value of the
resulting resistance for that cell's column and row (e.g. 12 Ohms and 24 Ohms
would give me 8 Ohms)
This is imho a kind of Knapsack problem:

http://en.wikipedia.org/wiki/Knapsack_problem

To make it worse, you have to take into account that you can have
infinite series and parallel circuits with resistors. But there is
always a boundary condition limiting this, e.g. limited space on your
board, length of circuit path, number of resistors.

I would try to create a complete calculated list of all possibilities
(formulas):

- one resistor (trivial): R1
- two resistors (simple): R1+R2, R1||R2
- three resistors:
R1+R2+R3,
R1+R2||R3, R1||R2+R3, R1||R3+R2,
R1||R2||R3
- four resistors:
R1+R2+R3+R4,
R1+R2+R3||R4, ...,
R1+R2||R3||R4, ...,
R1||R2+R3||R4, ...,
R1||R2||R3||R4

Then I would use this list and calculate the values.

As you see this gets really complex.


mfG
--> stefan <--
 
C

Cap''n Jax

Thanks for replying.

I'm not even going to pretend that i fully understand what you meant.
pretty certain I got the point though.

I'm only planning to use 2 resistors in total, and the table only goes from
10r to 910r (E24 resistors), because I can figure out any other denomination,
because they would only be a multiple of one already stated.
I already have the table with the formula sorted, I'm just trying to figure
out how to get it into a database, and then making the (i don't know the
correct term) 'program(?).

Ii can e-mail you a copy of the table if you want.
 
S

Stefan Hoffmann

hi,

Cap''n Jax said:
I'm only planning to use 2 resistors in total, and the table only goes from
10r to 910r (E24 resistors), because I can figure out any other denomination,
because they would only be a multiple of one already stated.
Okay, this makes it simple. You've got only R1+R2 and R1||R2.
I already have the table with the formula sorted, I'm just trying to figure
out how to get it into a database, and then making the (i don't know the
correct term) 'program(?).
Create a table containing your resistors (type, value).

Create a standard module, there you need these two functions:

Public Function Serial(R1 As Double, R2 As Double) As Double

Serial = R1 + R2

End Function

Public Function Parallel(R1 As Double, R2 As Double) As Double

Parallel = (R1 * R2) / (R1 + R2)

End Function

Create a new query. Add your resistor table twice. Delete any connection
between the two resistor tables. This creates a full cartesian product,
so you get all combinations.
Add from each table the value field to the field list.

Add this two extra fields:

Serial: Serial([value1], [value2])

and

Parallel: Parallel([value1], [value2])


Hope you can sort that out :)

mfG
--> stefan <--
 
K

KARL DEWEY

Don't forget to include a records of 0 (zero) ohms so that if 50 ohms is
wanted it will result in a 50 & 0 as a combination and not have to have 100 &
100.
--
KARL DEWEY
Build a little - Test a little


Bob Quintal said:
Thanks for replying.

I'm not even going to pretend that i fully understand what you
meant. pretty certain I got the point though.

I'm only planning to use 2 resistors in total, and the table only
goes from 10r to 910r (E24 resistors), because I can figure out
any other denomination, because they would only be a multiple of
one already stated. I already have the table with the formula
sorted, I'm just trying to figure out how to get it into a
database, and then making the (i don't know the correct term)
'program(?).

Ii can e-mail you a copy of the table if you want.

What i woukld do, using MS-Access, (this is an MS-Access help forum)
is to create a one-column table with the allowed values, and a query
that uses the table twice, which returns three columns, (R1 value,
R2 Value and parallel resistance. Do not join the two tables on any
field, if access auto-creates a join, delete it.
set criteria on the computed column to the value you want.

SQL would be
PARAMETERS [target value] IEEEDouble;
SELECT R1.Ohms, R2.Ohms, 1/(1/[R1].[ohms]+1/[R2].[ohms]) AS Result
FROM resistance AS R1, resistance AS R2
WHERE (((R2.Ohms)>=[R1].[ohms]) AND ((1/(1/[R1].[ohms]+1/[R2].
[ohms])) Between [target value]*0.9 And [target value]*1.1))
ORDER BY 1/(1/[R1].[ohms]+1/[R2].[ohms]);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top