constraints module#
- class VoltageDividerConstraints(v_in, v_out, current, prec_series=<factory>, search_range=10.0, min_sources=3, query_limit=50, temp_range=Toleranced(12.5, 12.5, 12.5), base_query=<factory>)[source]#
Voltage Divider Constraints
This type encapsulates the necessary parameters for the solver as well as other logistics parameters for the generated result.
This type solves the “forward” voltage divider problem. Meaning that the input voltage is the hi side of the voltage divider and the objective voltage we are solving for is the middle node of the voltage divider (out).
This type of solve might be used when building an attenuator where we want to keep the output within some toleranced range.
- Parameters:
v_in (
Toleranced) – Input Voltage Range This parameter encodes the typical DC voltage range for the input.v_out (
Toleranced) – Desired Voltage Output Range Construct a voltage divider such that the specified input voltage results in a output voltage in this range.current (
float) – Max current in amps allowed through the dividerprec_series (
List[float]) – Set of precision series to search By default, we search the following series: [0.20, 0.10, 0.05, 0.02, 0.01, 0.005, 0.0025, 0.001] The user can customize this series by pass an overriding series.search_range (
float) – Set the search range for components to select This algorithm does a pre-screening of resistor values based on the v-in, v-out, and current parameters. Then this parameter limits how far from these pre-screen values we’re willing to search to find an acceptable solution.min_sources (
int) – Set the minimum number of sources When pulling resistors from the database, this algorithm will limit the selection of resistors to only those components for which there are at least min-sources number of manufacturers for comparable parts. By default this value is 3.query_limit (
int) – Query Limiter for Results. For many resistors, there may be 1000’s of parts that match a particular query. This parameter limits the number of returned results to some max so as not to overload the parts database. The default value is 50. This value must be greater than the min-sources parameter.temp_range (
Toleranced) – Temperature Range for TCR evaluation. Default is 0.0 to 25.0 C.base_query (
ResistorQuery) – Base ResistorQuery This object allows the user to further fine tune the selected resistors as part of the solver. The global design level defaults will still apply but this can be used to override or add to the query parameters. The resistance, tolerance, or precision keys will be overridden by the solvers so any value in the base query will be ignored for those keys.
-
v_in:
Toleranced#
-
v_out:
Toleranced#
-
temp_range:
Toleranced= Toleranced(12.5, 12.5, 12.5)#
-
base_query:
ResistorQuery#
- compute_objective(rh, rl, hi_dr=Toleranced(1, 0, 0), lo_dr=Toleranced(1, 0, 0))[source]#
This function computes the objective as the forward voltage of the voltage divider. Meaning the middle node of the divider is the output.
` Vobj = V-in * (R-L / (R-H + R-L)) `- Parameters:
rh (
Toleranced) – The top resistor in the divider.rl (
Toleranced) – The bottom resistor in the divider.hi_dr (
Toleranced) – Delta-Resistance as a Toleranced with a nominal value of 1.0. This value when multiplied against the nominal hi resistance value gives the range of resistances expected for the operating temperature range.lo_dr (
Toleranced) – Delta-Resistance as a Toleranced with a nominal value of 1.0. This value when multiplied against the nominal lo resistance value gives the range of resistances expected for the operating temperature range.
- Return type:
- is_compliant(v_obj)[source]#
Check if the computed objective voltage is within the user-defined constraints.
- Return type:
- Parameters:
v_obj (Toleranced | float)