lemon1324 / tolstack

MIT License
0 stars 0 forks source link

tolstack

This readme was last updated for application version 0.8.7.

Introduction

tolstack is designed to assist with tolerance analysis for engineering design. It is more than a 1D tool, as it implements functions beyond addition and subtraction, but does not support direct analysis of geometric dimensioning and tolerancing. Geometric tolerances can still be analyzed by refactoring into equivalent mathematical expressions; see the included example files.

Features

Using the Application

Interface Layout

The left side of the user interface has three tabs:

The right side contains an output window, which will contain a plain-text version of the analysis output for evaluating the output while iterating design values. Three common options are also located here controlling various output evaluations useful for designing. See the options section for more details.

Workflow

The general workflow is as follows:

  1. Define any constants for the problem. Constants have the following properties:

    • Name: The name used to refer to this constant in expressions.
    • Value: The value of the constant.
    • Note: Arbitrary Unicode text for documentation.
  2. Define dimensions for the problem. These are the toleranced values for the problem (and may not actually be a 'dimension', just a number that has a tolerance). Dimensions have the following properties:

    • Name: The name used to refer to this dimension in expressions.
    • Nominal: The nominal value of the dimension. Will be used in calculating the nominal value of expressions.
    • Plus: The plus tolerance such that nominal+plus is the upper bound of this dimension. May be negative for unilateral bias tolerancing.
    • Minus: The minus tolerance such that nominal+minus is the lower bound of this dimension. May be positive for unilateral bias tolerancing. Note the sign convention. Minus tolerances for a bilaterally toleranced value should have a '-' sign in this field.
    • D: Distribution of this dimension. Default is uniform; other options are:
      • U: uniform distribution between nominal+minus and nominal+plus.
      • 1S, 2S, 3S: normal distribution such that μ=nominal+(plus+minus)/2—that is, the mean is the midpoint between the extremes, not the nominal value. The standard deviation is set such that σ = (plus-minus)/2k where k={1,2,3}. Note that the distribution code is the number of one-sided standard deviations.
    • PN: The part number this dimension is associated to. Should be no more than 9 characters.
    • Note: Arbitrary Unicode text for documentation.

    Dimensions must be defined such that plus is greater or equal to minus. Both tolerance values may also be expressed as percentages of the nominal value.

  3. Define expressions to evaluate. Expressions have the following properties:

    • Name: The name used to refer to this expression. Can be referenced in other expressions, but only in a strictly sequential order.
    • Value: an infix expression using names of constants, dimensions, and already-defined expressions to define a mathematical quantity. May also include bare numeric values. An example would be (D1+E2)/D3 + 5.2 Assuming E2 has already been defined. Also supports the functions listed in supported functions.
    • Lower: The lower bound that this expression must satisfy to meet requirements. Will be flagged as a failed condition in the output if not met. Leave the cell empty to not set a lower bound.
    • Upper: The upper bound that this expression must satisfy to meet requirements. Will be flagged as a failed condition in the output if not met. Leave the cell empty to not set an upper bound.
    • M: the method by which to evaluate the expression. Default is worst-case; other options are:
      • W: worst-case evaluation; the nominal value will be propagated, and each operation will be evaluated in a worst-case sense. The output tolerance will be reported as plus/minus values from the nominal output value.
      • 1S, 2S, 3S: statistical evaluation at ±1σ, ±2σ, and ±3σ. Each dimension is sampled several times from a distribution as defined in the dimension definition, and then the random samples have each operation applied element wise to simulate the final output in a Monte Carlo sense. The output is reported as the median value, with the -nσ and +nσ values defined by quantiles on the distribution such that the tails are equally weighted and have the same total weight as the tails in a normal distribution beyond ±nσ.
    • Note: Arbitrary Unicode text for documentation.
  4. Run the analysis, and review results in the right-hand text pane. Enable/disable analysis options as required to proceed with the design process.

  5. Optionally, create images to help illustrate dimension and expression definitions. See the options section for details.

  6. Export the analysis to text or PDF.

Options

The three common options are:

The options in the options tab are:

Supported Functions

In addition to the normal +, -, *, /, tolstack also supports exponentiation (e.g. x^y) and unary negation (e.g. '-x'). The following functions are also supported:

Menu Options

The top menu allows for file management, management of input data, and access to help and about information.

Note that the "Save" and "Save As" actions will always save the analysis definition file to disk. To save the outputs, "Export" should be used with either text output, which will save the contents of the right pane, or PDF output, which will render a PDF with images included if enabled.

Rename item will allow renaming a constant or dimension to a new name, and will update expressions referencing that item. Note that while this will warn on a name conflict, there is currently no undo functionality so be careful.

Sorting is also provided to ease table organization. Note that since expressions cannot have backwards references, sorting is only available on the constants and dimensions tables.

FAQ