voltageDivider(vin, vout, resitorOrderOfMagnitude, maxTolerance, resistorTolerance, series)

import electronics.rlc.resistorDividers-1

Calculate a voltage divider with real world resistances.

import electronics.rlc.resistorDividers-1;
voltageDivider( 5V, // input voltage 1.2V, // desired output voltage 100kOhm // order of magnitude for the divider )
vinInput voltage.
voutDesired output voltage.
resitorOrderOfMagnitudeThe order of magnitude for the resistors (optional). If not given, one resistor will be in 1-10Ohm range.
maxToleranceMaximum tolerance allowed for ideal resistor case (optional). If not given, 1% is used.
resistorToleranceThe tolerance of the used resistors (optional). Used for calculation of worst case values. If not given, 1% is used.
seriesThe resistor series to use. If not given, E24 is used.
return valueArray of realisable voltage dividers.

The difference bethween the voltage divider and the reisistor divider above is that in this case, the output voltage and its errors are given instead of the resulting division ratio.

The result is an array containing the matching resistor pairs, output voltages, and the error in percents:

For more details on resistor series, please see electronics.datasets.resistors.series-1. If you want to design a feedback divider for power supply, please see calculateFeedbackDivider.