Resources Numerical accuracy

Calculations

Every calculation under our calculation policies: what it works out, its formula and the precision it runs at. Open one to see its code as it is in the released app.

  • 6,917 calculations in 1,248 source files
  • 143 exact
  • 6,286 in 64-bit
  • 335 with a 32-bit step
  • Last reviewed

Calculations

  • Number formatter

    Writes one number as macro text.

    text = toPrecision(v, 15); |v| < 1e-14 → 0

    Numbers written into the VBA macro export swmacro.js
    • PartCraft
    64-bit
  • Millimeters to meters

    Converts a length or a coordinate from millimeters to the meters the macro uses.

    m = round(mm × 10⁶) ÷ 10⁹

    Numbers written into the VBA macro export swmacro.js
    • PartCraft
    64-bit
  • Degrees to radians

    Converts an angle in degrees to the radians the macro uses.

    rad = deg × π ÷ 180

    Numbers written into the VBA macro export swmacro.js
    • PartCraft
    64-bit
  • Unit-vector component

    Writes a component of a sketch plane's normal or x direction.

    u = round(v × 10¹²) ÷ 10¹²

    Numbers written into the VBA macro export swmacro.js
    • PartCraft
    64-bit
  • Sketch dimension value and text position

    Works out the value of each sketch dimension in meters or radians and where its text sits.

    length: value ÷ 1000; angle: value × π ÷ 180; arc radius = |start − center|

    Numbers written into the VBA macro export swmacro.js
    • PartCraft
    64-bit
  • Pick point on a face

    Finds a point inside a face, used by the macro to select that face.

    centroid of the largest triangle = (a + b + c) ÷ 3, moved onto the plane: p − ((p − o)·n) n

    Numbers written into the VBA macro export swmacro.js
    • PartCraft
    64-bit
  • Countersink depth and taper

    The depth and half angle of the tapered cut that stands in for a countersink.

    depth = (D − d) ÷ 2 ÷ tan(angle × π ÷ 360); taper = angle ÷ 2 × π ÷ 180

    Numbers written into the VBA macro export swmacro.js
    • PartCraft
    64-bit
  • Expected volume and box after each step

    Writes the part's volume and bounding box after a feature, for the macro to compare with what it built.

    volume in m³ = volume in mm³ × 10⁻⁹; box corners through the millimeter-to-meter conversion

    Numbers written into the VBA macro export swmacro.js
    • PartCraft
    64-bit
  • Body check tolerances in the macro

    The comparison the macro makes between the body it built and the expected volume and box.

    |v − vol| ≤ 10⁻⁴ × |vol| + 10⁻¹⁵; |box − expected| ≤ 10⁻⁵ m + 0.02 × diagonal

    Numbers written into the VBA macro export swmacro.js
    • PartCraft
    64-bit
  • Final volume comparison

    Writes the finished part's volume into the macro and the test that reports whether the rebuilt part matches.

    |v − vol| ≤ 10⁻⁴ × vol, v = reported volume × 10⁹ (mm³)

    Numbers written into the VBA macro export swmacro.js
    • PartCraft
    64-bit
  • Numbers in equations

    Writes a parameter expression as equation text for the macro, including its numeric constants.

    constant → formatNumber(value); pow(a, b) → (a) ^ (b); log(x) → log(x) ÷ log(10)

    Numbers written into the VBA macro export swmacro.js
    • PartCraft
    64-bit
  • 64-point rule on the tetrahedron

    Builds the integration points and weights used for mass and body loads.

    x = u, y = v(1 − u), z = w(1 − u)(1 − v); weight = wₐ w_b w_c ÷ 8 × (1 − u)² (1 − v)

    Quadratic tetrahedron element matrices tetfea.js
    • PartCraft
    64-bit
  • Shape functions of the 10-node tetrahedron

    The ten shape functions and their derivatives at a point of the element.

    corner: N = L(2L − 1); midside: N = 4 LᵢLⱼ

    Quadratic tetrahedron element matrices tetfea.js
    • PartCraft
    64-bit
  • Jacobian and physical derivatives

    The element's Jacobian determinant at a point and the shape-function derivatives in x, y and z.

    J = Σ xₐ ∂Nₐ/∂ξ; det J by cofactors; ∂N/∂x = J⁻ᵀ ∂N/∂ξ

    Quadratic tetrahedron element matrices tetfea.js
    • PartCraft
    64-bit
  • Element stiffness

    The 30 × 30 stiffness matrix of one element and its volume.

    Kₑ = Σₚ wₚ det Jₚ E · Bᵀ D B; volume = Σₚ wₚ det Jₚ

    Quadratic tetrahedron element matrices tetfea.js
    • PartCraft
    64-bit
  • Element mass and shape-function integrals

    The consistent mass matrix of one element and ∫N dV for each node, used for gravity.

    Mₑ = Σₚ ρ wₚ det Jₚ NₐN_b; ∫Nₐ dV = Σₚ wₚ det Jₚ Nₐ

    Quadratic tetrahedron element matrices tetfea.js
    • PartCraft
    64-bit
  • Stress and strain at a Gauss point

    The six strains and six stresses at one Gauss point from the element's displacements.

    ε = B u; σ = E · D (ε − α ΔT [1 1 1 0 0 0])

    Quadratic tetrahedron element matrices tetfea.js
    • PartCraft
    64-bit
  • 6-point rule on a triangle face

    The points and weights used to integrate loads, areas and heat exchange over boundary faces.

    Quadratic tetrahedron element matrices tetfea.js
    • PartCraft
    64-bit
  • Shape functions of the 6-node face

    The six shape functions of a boundary face and their derivatives.

    corner: N = L(2L − 1); midside: N = 4 LᵢLⱼ

    Quadratic tetrahedron element matrices tetfea.js
    • PartCraft
    64-bit
  • Integration over a boundary face

    The area-weighted normal and position at each rule point of a curved boundary face.

    n dA = (∂x/∂L₁ × ∂x/∂L₂) × w ÷ 2

    Quadratic tetrahedron element matrices tetfea.js
    • PartCraft
    64-bit
  • Area element on a face for heat terms

    The area weight at each rule point of a 6-node face, for heat exchange and heat loads.

    dA = |∂x/∂L₁ × ∂x/∂L₂| × w ÷ 2

    Quadratic tetrahedron element matrices tet-elements.js
    • PartCraft
    64-bit
  • Element conductivity matrix

    The 10 × 10 heat conduction matrix of one element.

    Kₑ = Σₚ wₚ det Jₚ k ∇Nₐ·∇N_b

    Quadratic tetrahedron element matrices tet-elements.js
    • PartCraft
    64-bit
  • Element heat capacity

    The heat capacity matrix of one element, or its lumped diagonal for transient runs.

    M = Σₚ wₚ det Jₚ ρc NₐN_b; lumped: Mₐₐ × (ΣM ÷ Σ diagonal)

    Quadratic tetrahedron element matrices tet-elements.js
    • PartCraft
    64-bit
  • Element heat generation load

    The nodal heat input of a uniform internal heat source.

    fₐ = Σₚ wₚ det Jₚ Q Nₐ

    Quadratic tetrahedron element matrices tet-elements.js
    • PartCraft
    64-bit
  • Temperature gradient at the element center

    The temperature gradient used for the heat flux of an element.

    ∇T = Σ ∇Nₐ Tₐ at L = (¼, ¼, ¼, ¼)

    Quadratic tetrahedron element matrices tet-elements.js
    • PartCraft
    64-bit
  • Element thermal load

    The nodal forces that a temperature rise produces in one element.

    f = Σₚ wₚ det Jₚ E α ΔTₚ (D₀₀ + D₀₁ + D₀₂) ∇N

    Quadratic tetrahedron element matrices tet-elements.js
    • PartCraft
    64-bit
  • Stresses at the four Gauss points

    The stresses used to build the geometric stiffness of a buckling study.

    σ = E · D (B u − α ΔT [1 1 1 0 0 0])

    Quadratic tetrahedron element matrices tet-elements.js
    • PartCraft
    64-bit
  • Element geometric stiffness

    The stress stiffness of one element for linear buckling.

    Gₐ_b = Σₚ wₚ det Jₚ ∇Nₐᵀ σₚ ∇N_b

    Quadratic tetrahedron element matrices tet-elements.js
    • PartCraft
    64-bit
  • Face areas and volume of the tetrahedral mesh

    The area of every boundary face and the mesh volume handed to the heat and buckling routines.

    area = Σ ∫Nₐ dA; volume = Σₑ Σₚ wₚ det Jₚ

    Quadratic tetrahedron element matrices tet-elements.js
    • PartCraft
    64-bit
  • Stiffness and mass assembly

    Adds every element's stiffness (and mass) into the model's sparse matrices and totals the volume.

    K = Σₑ Kₑ; volume = Σₑ volumeₑ

    Tetrahedral stress, vibration and buckling solve tetfea.js
    • PartCraft
    64-bit
  • Matrix times vector

    Multiplies the symmetric stiffness, stored as its lower triangle, by a vector.

    y = K x

    Tetrahedral stress, vibration and buckling solve tetfea.js
    • PartCraft
    64-bit
  • Constrained stiffness

    Builds the stiffness with supports applied.

    K̃ = P K P + α (I − P)

    Tetrahedral stress, vibration and buckling solve tetfea.js
    • PartCraft
    64-bit
  • Scale of the supported directions

    The value α put on the diagonal for supported directions.

    α = Σ Kᵢᵢ ÷ N

    Tetrahedral stress, vibration and buckling solve tetfea.js
    • PartCraft
    64-bit
  • Incomplete Cholesky preconditioner

    Factors the constrained stiffness on its own sparsity pattern to speed up the iteration.

    L Lᵀ ≈ K̃ on the pattern of K̃

    Tetrahedral stress, vibration and buckling solve tetfea.js
    • PartCraft
    64-bit
  • Conjugate-gradient solve for displacements

    Solves the constrained system for the displacement of every node.

    stop when ‖r‖ ÷ ‖P f‖ < tol

    Tetrahedral stress, vibration and buckling solve tetfea.js
    • PartCraft
    64-bit
  • Loads on faces and gravity

    Turns forces, pressures and gravity into nodal loads and totals them.

    force: t = total ÷ A; pressure: t = −p n; f = Σ N t dA; gravity: f = ρ g ∫N dV

    Tetrahedral stress, vibration and buckling solve tetfea.js
    • PartCraft
    64-bit
  • Support directions on faces

    Finds which nodes of a supported face are held and the normal direction used for a sliding support.

    held when distance to the exact face ≤ 0.002 × mean edge length

    Tetrahedral stress, vibration and buckling solve tetfea.js
    • PartCraft
    64-bit
  • Is the part held

    Checks that the supports stop all six rigid-body motions.

    free when an eigenvalue of Σ rᵀr is ≤ 10⁻⁹ × the largest, or ≤ 10⁻¹²

    Tetrahedral stress, vibration and buckling solve tetfea.js
    • PartCraft
    64-bit
  • Natural frequencies

    The lowest natural frequencies and mode shapes of the supported part.

    K̃ x = λ M x; f = √max(λ, 0) ÷ 2π

    Tetrahedral stress, vibration and buckling solve tetfea.js
    • PartCraft
    64-bit
  • Temperature rise for thermal stress

    The temperature rise at every node over the stress-free temperature, and the load it adds.

    ΔT = T − T_ref (20 when not given); f += thermal load

    Tetrahedral stress, vibration and buckling solve tet-elements.js
    • PartCraft
    64-bit
  • Buckling pre-stress and geometric stiffness

    Solves the pre-stress and assembles the stress stiffness that the buckling eigen-solve uses.

    K u = f (tol 10⁻¹⁰); G = −Σₑ Gₑ; each inner solve tol 10⁻⁸

    Tetrahedral stress, vibration and buckling solve tet-elements.js
    • PartCraft
    64-bit
  • Principal stresses

    The largest, middle and smallest principal stress of a stress state.

    s₁ = m + 2q cos φ, s₃ = m + 2q cos(φ + 2π ÷ 3), s₂ = 3m − s₁ − s₃; φ = acos(det ÷ 2q³) ÷ 3

    Stress, displacement and error results on tetrahedra tetfea.js
    • PartCraft
    64-bit
  • Equivalent strain

    The von Mises equivalent strain from the six engineering strains.

    ε_eq = √(⅔ (a² + b² + c² + (γ_xy² + γ_yz² + γ_zx²) ÷ 2)), a, b, c = normal strains − mean

    Stress, displacement and error results on tetrahedra tetfea.js
    • PartCraft
    64-bit
  • Gauss points to corners

    The value at an element corner of the linear field that passes through the four Gauss-point values.

    cᵢ = (gᵢ − 0.1381966… × Σg) ÷ (0.5854101… − 0.1381966…)

    Stress, displacement and error results on tetrahedra tetfea.js
    • PartCraft
    64-bit
  • Largest von Mises stress in an element

    The unaveraged maximum von Mises stress of each element and the largest over the mesh.

    max over the 4 Gauss points and the 4 extrapolated corners

    Stress, displacement and error results on tetrahedra tetfea.js
    • PartCraft
    64-bit
  • Nodal stress, strain and displacement, and their maxima

    The values the plot colors by and the maxima the result reports.

    σ at a node = mean over its elements; |u| = √(u_x² + u_y² + u_z²); maximum over the nodes

    Stress, displacement and error results on tetrahedra tetfea.js
    • PartCraft
    32-bit in part
  • Error indicator per element

    How far the averaged stress field is from each element's own stresses, in the energy norm.

    e_K² = ∫ (σ* − σₕ)ᵀ C⁻¹ (σ* − σₕ) dV; U = ∫ σₕᵀ C⁻¹ σₕ dV

    Stress, displacement and error results on tetrahedra tetfea.js
    • PartCraft
    64-bit
  • Support reactions

    The total reaction force and the reaction of each support group.

    r = K u − f at the supported nodes, kept along the supported directions; R = Σ r

    Stress, displacement and error results on tetrahedra tetfea.js
    • PartCraft
    64-bit
  • Reported maxima, safety factor and error percentage

    The numbers the study result states: error percentage, maximum stress and displacement, principal stress range and minimum safety factor.

    η = 100 √(Σe² ÷ (U + Σe²)); safety = yield ÷ maximum von Mises

    Stress, displacement and error results on tetrahedra tetfea.js
    • PartCraft
    32-bit in part
  • Error estimate of several fields

    Combines the error indicators of mode shapes, or of a buckling pre-stress and its modes, into one estimate.

    e_K² = Σ_f e_K,f² ÷ U_f; η = 100 √(Σe² ÷ (n + Σe²))

    Stress, displacement and error results on tetrahedra tetfea.js
    • PartCraft
    64-bit

A calculation is added only after its source was read. Each statement can be checked in the code shown on its policy's page; the app repositories are public. When a release changes a calculation, its page says so until it has been read again.