I tried to play with your software. Very nice project
. And very complex task.
But either i'm too stupid or it has mayor bugs...
.
Here is an example: if i try to make a 10k resistor with 10 resistors and Rx min and max are 4k7 (i might have a box full of 4k7 resistors left...),
it paints 1R0. If i use 5k for Rx max it uses a 470R and a 680R resistor in addition to the 4k7s, which are not in the range of 4k7 to 5k (not to mention the computation time
).
Actually, this could be a real world example, making 10k out of 4k7s.
Do i think or using the programm the wrong way?
Painted only 1R0 and "division by 0" show up pretty often at calculations. I guess when i input stupid (not always obvious) values.
Some more ideas:
Is it a good idea, to always try to use the maximum number of given resistors? Hmmm...checkbox - "use alway max" or "use rational number" might be useful? Ok, it's getting even more complex
.
Maybe there is a point of derivation from the optimum (or you can insert a value) where a use of more resistors is irrational.
Voltage divider does not work too when you use not the whole E-range (lets say only 1k to 10k) and r sum is bigger (in your start example 100k).
I would suggest a drop down box which you can choose only valid resistor values depending on your other inputs...just an idea
. Or a message box like "Hey...Rsum is too big for the given values".
Or an auto correct function.
What about current sharing? You seem to try to get to the closest result to the given value, but is this always the best or wanted as resistors have tolerances anyway (like 1%, 10%..)?
The reason you use more resistors than only one may be this (current sharing). Which would require a "max current per resistor" field (like "1/2" ...) and so on... (computation reaches hell level
).
It does not include the size (like 1/4w,1/2W...) into calculation, right?
But maybe
your goal really is to get to the closest result. Not practical but for fun be fine too.
Very complex computations
(computation time ->
) and very interesting task. I would never be able to program something like this. I'm looking forward how your project will develop
.
Thank you for sharing and good luck.
Greetings, Tom