電阻計算機 (Resistance calculator)

2019.Jul.31

This is a tool for helping one get a reasonable resistance value given a limit selection of resistor, by generating groups of parallel resistors. The rationale for limiting the question to just parallel resistors/capacitors is that this is the scenario that typically occurs in electronics experiments, particularly with surface mount experiments: stacking components in parallel is much easier (in most cases), than making extra space for components in series. Allowing the use of components in both parallel and serial have the problem much too complicated to write, so I’m limiting the use case to either just parallel or just series.

Be warned that this algorithm is currently very non-optimized, and can consume a very large amount of memory. To help the algorithm end early, try using a smaller tolerance or lower the maximum number of components allowed.

Since I this a tool primarily for my own use. I have loaded in some of the components found in the electronics lab of the UMD CMS group. All the code can be found on the GitHub repository of this blog.

Resistor values


Set custom values

Add a list of impedance values, separated by spaces. The short hands like 100K, 15.6M can be used. The multipliers 'p', 'n', 'u', 'm' 'k/K', 'M', 'G' may be used.


Load preset values
Target value
Max. components
Tolerance
Calculation type R-Series/C-Parallel
R-Parallel/C-Series

Results


About the algorithm

The algorithm is basically brute forcing all possible combinations with an early exist for when combination moves above/below the tolerance, since if calculating resistance series, the total resistance can only go up, and there is no point in trying more if already past the tolerance threshold (vice versa for resistance parallel calculations). This is highly inefficient and very memory hungry, but is easy enough to code in one afternoon, that is what I went with :/