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

  • Phase of a graded lattice

    Maps a point to the lattice's own period coordinates when the cell size changes.

    fixed cell: X = 2π·p ÷ cell; ramp: X = ∫k dp with k linear in p

    Field shapes: signed distance functions field/field.js
    • PartCraft
    64-bit
  • Gyroid, Schwarz P and diamond

    Signed distance to a triply periodic minimal surface, as a sheet or a network.

    d ≈ g ÷ |∇g|; near the surface: two projections q ← q − g∇g ÷ |∇g|², d = ±|p − q|

    Field shapes: signed distance functions field/field.js
    • PartCraft
    64-bit
  • Brick classification

    Decides whether a ball of space is wholly outside, wholly inside or near the surface.

    outside when f − L·r > band; inside when f + L·r < −band

    Field shapes: signed distance functions field/field.js
    • PartCraft
    64-bit
  • Plane of a curve

    The normal of the plane a hull line lies in.

    n = (p_mid − p₀) × (p_end − p₀), made unit

    Hull lines: fairness measures and fairing hull/fair.js
    • PartCraft
    64-bit
  • Signed curvature

    The curvature of a curve at a parameter, signed in its plane.

    κ = (C′ × C″)·n ÷ |C′|³

    Hull lines: fairness measures and fairing hull/fair.js
    • PartCraft
    64-bit
  • Fairness measures

    Inflection count, largest curvature, roughness, curvature jumps at knots and length.

    R = ∫(dκ/ds)² ds ≈ (du ÷ 3) × Σ wᵢ gᵢ, gᵢ = ((κᵢ₊₁ − κᵢ₋₁) ÷ ds)² × |C′|ᵢ

    Hull lines: fairness measures and fairing hull/fair.js
    • PartCraft
    64-bit
  • Fairing a curve

    The rebuild with the fewest control points that stays within tolerance and adds no inflection.

    Hull lines: fairness measures and fairing hull/fair.js
    • PartCraft
    64-bit
  • Fairness problems

    Reports curves that have an inflection or a curvature jump.

    Hull lines: fairness measures and fairing hull/fair.js
    • PartCraft
    64-bit
  • Sampling a patch

    The parameter values at which each surface is evaluated.

    uᵢ = u₀ + (u₁ − u₀) × i ÷ N, N from 2 to 200

    Hull surfaces to a closed solid and its volume hull/solid.js
    • PartCraft
    64-bit
  • Mirror half

    The other half of a hull drawn to the centerline.

    p′ = 2 × at − p on the mirror axis

    Hull surfaces to a closed solid and its volume hull/solid.js
    • PartCraft
    64-bit
  • Welding corners

    Merges corners of neighboring patches that lie within the weld distance.

    merge when √(Δx² + Δy² + Δz²) ≤ eps

    Hull surfaces to a closed solid and its volume hull/solid.js
    • PartCraft
    64-bit
  • Planar opening test

    Decides whether an opening lies in a plane and can be capped.

    n by Newell's sums; deviation = max |(p − centroid)·n|; cap when deviation ≤ max(4 eps, 2e-4 × size)

    Hull surfaces to a closed solid and its volume hull/solid.js
    • PartCraft
    64-bit
  • Volume of the closed mesh

    The volume enclosed by the hull mesh.

    V = Σ a·(b × c) ÷ 6

    Hull surfaces to a closed solid and its volume hull/solid.js
    • PartCraft
    64-bit
  • Unit vector

    A vector scaled to length 1.

    Illustrate: vector, matrix and rigid-fit math illustrate/m4.js
    • PartCraft
    64-bit
  • Point under a matrix

    A point moved by a 4 × 4 matrix.

    p′ = M₃ₓ₃ p + t

    Illustrate: vector, matrix and rigid-fit math illustrate/m4.js
    • PartCraft
    64-bit
  • Matrix product

    The product of two 4 × 4 matrices.

    Illustrate: vector, matrix and rigid-fit math illustrate/m4.js
    • PartCraft
    64-bit
  • Matrix inverse

    The inverse of a general 4 × 4 matrix.

    M⁻¹ = adj(M) ÷ det(M)

    Illustrate: vector, matrix and rigid-fit math illustrate/m4.js
    • PartCraft
    64-bit
  • Box of placed positions

    The axis-aligned box of a mesh's corners under a matrix.

    Illustrate: vector, matrix and rigid-fit math illustrate/m4.js
    • PartCraft
    64-bit
  • Rigid motion test

    Checks that a matrix is a rotation and a move, with no scale or shear.

    Illustrate: vector, matrix and rigid-fit math illustrate/m4.js
    • PartCraft
    64-bit
  • Best rigid move between two point sets

    The rotation and move that best take one set of points onto another, and the largest leftover distance.

    R from the unit quaternion of the largest eigenvalue; t = c_B − R c_A; err = max |M pᵢ − qᵢ|

    Illustrate: vector, matrix and rigid-fit math illustrate/m4.js
    • PartCraft
    64-bit
  • Largest eigenvector of a symmetric 4 × 4

    The eigenvector the rigid fit's rotation is read from.

    t = sign(θ) ÷ (|θ| + √(θ² + 1)), θ = (a_qq − a_pp) ÷ (2a_pq)

    Illustrate: vector, matrix and rigid-fit math illustrate/m4.js
    • PartCraft
    64-bit
  • Time-weighted average

    The average of a value that changes at events: queue length, units busy, work in process.

    average = (Σ vᵢ × Δtᵢ) ÷ (t − t₀)

    Flow simulation (discrete events) engine.js Every app
    64-bit
  • Mean, deviation and percentiles of observations

    Waiting time, service time and time in system: mean, standard deviation, minimum, maximum, P50 and P95.

    m ← m + (x − m) ÷ n; s ← s + (x − m_old)(x − m_new); sd = √(s ÷ (n − 1)); P = sorted[⌊p × k⌋]

    Flow simulation (discrete events) engine.js Every app
    64-bit
  • Event time

    When a scheduled event happens.

    t_event = t_now + delay

    Flow simulation (discrete events) engine.js Every app
    64-bit
  • Conveyor slots and timing

    How many items fit on a belt, the gap between items and the travel time.

    slots = max(1, ⌊length ÷ pitch + 1e-9⌋); headway = pitch ÷ speed; travel = length ÷ speed

    Flow simulation (discrete events) engine.js Every app
    64-bit
  • Shift edges

    When a server goes on and off shift.

    x = t − ⌊t ÷ period⌋ × period; on shift when a ≤ x < b

    Flow simulation (discrete events) engine.js Every app
    64-bit
  • Server utilization

    The share of time a server's units were busy, blocked, down and idle.

    utilization = average busy units ÷ units; idle = max(0, 1 − busy − blocked − down)

    Flow simulation (discrete events) engine.js Every app
    64-bit
  • Throughput

    Finished entities per unit of time at a sink.

    throughput = count ÷ (t − t₀)

    Flow simulation (discrete events) engine.js Every app
    64-bit
  • Resource utilization

    The share of a shared resource's capacity that was in use.

    utilization = average in use ÷ average capacity

    Flow simulation (discrete events) engine.js Every app
    64-bit
  • Vehicle trip times

    How long a vehicle takes to reach the pick station and to carry the load to the drop station.

    to pick = distance ÷ speed + load time; carry = distance ÷ speed + unload time

    Flow simulation (discrete events) engine.js Every app
    64-bit
  • Student t factor

    The factor for a 95 % confidence range.

    df ≤ 30: table value; df ≤ 60: 2.0; df ≤ 120: 1.98; above: 1.96

    Flow simulation (discrete events) engine.js Every app
    64-bit
  • Replication mean and confidence half-width

    The mean of each result over independent runs and its 95 % range.

    mean = Σx ÷ n; sd = √(Σ(x − mean)² ÷ (n − 1)); half = t × sd ÷ √n

    Flow simulation (discrete events) engine.js Every app
    64-bit
  • Uniform and normal draws

    The random numbers every arrival, service time and route choice is drawn from.

    u = (k + 0.5) ÷ 2³², k a 32-bit integer; z = √(−2 ln u) × cos(2π v)

    Flow simulation (discrete events) rng.js Every app
    64-bit
  • Draw from a distribution

    One value from an exponential, uniform, triangular, normal, lognormal, Erlang, Weibull or empirical distribution.

    exp: −mean × ln u; tri: a + √(u (b − a)(c − a)) or b − √((1 − u)(b − a)(b − c)); weibull: scale × (−ln u)^(1 ÷ shape)

    Flow simulation (discrete events) rng.js Every app
    64-bit
  • Mean of a distribution

    The mean used for load estimates and for routing to the least loaded target.

    tri: (a + m + b) ÷ 3; weibull: scale × Γ(1 + 1 ÷ shape)

    Flow simulation (discrete events) rng.js Every app
    64-bit
  • Gamma function

    Γ(x), used for the mean of a Weibull distribution.

    Lanczos approximation, g = 7, 9 coefficients

    Flow simulation (discrete events) rng.js Every app
    64-bit
  • Thermal voltage

    kT/q, the voltage scale of every diode and transistor junction.

    VT = 0.025852 V

    Circuit solver circuit.js Every app
    64-bit
  • Value with an engineering suffix

    4.7k, 100n, 1meg: a component value read from text.

    value = number × factor of the suffix (t, g, meg, k, m, u, n, p, f); mil = 25.4e-6

    Circuit solver circuit.js Every app
    64-bit
  • Source waveform value

    The value of a DC, sine or pulse source at a time.

    sin: off + amp × e^(−damp (t − delay)) × sin(2π f (t − delay) + phase); pulse: linear edges over tr and tf

    Circuit solver circuit.js Every app
    64-bit
  • Diode current and conductance

    The current through a diode and its slope at a junction voltage.

    i = Is (e^(v ÷ (n VT)) − 1); g = Is e^(v ÷ (n VT)) ÷ (n VT)

    Circuit solver circuit.js Every app
    64-bit
  • Transistor currents

    Collector and base current of a bipolar transistor.

    ic = If − Ir − Ir ÷ βr; ib = If ÷ βf + Ir ÷ βr; If = Is (e^(vbe ÷ VT) − 1)

    Circuit solver circuit.js Every app
    64-bit
  • MOSFET level 1 current

    Drain current of a MOSFET in the triode and saturation regions.

    triode: id = kp (vov vds − vds² ÷ 2)(1 + λ vds); saturation: id = kp vov² (1 + λ vds) ÷ 2

    Circuit solver circuit.js Every app
    64-bit
  • Switch conductance

    The conductance of a voltage-controlled switch.

    ln g = ln(1 ÷ roff) + a (ln(1 ÷ ron) − ln(1 ÷ roff)); a = 1 ÷ (1 + e^(−(v − vt) ÷ vh))

    Circuit solver circuit.js Every app
    64-bit
  • Circuit equations

    The matrix and right side for one Newton step, at DC or at one time step.

    capacitor: geq = C ÷ h (backward Euler) or 2C ÷ h (trapezoid); inductor: r = L ÷ h or 2L ÷ h

    Circuit solver circuit.js Every app
    64-bit
  • Newton iteration

    Repeats the linear solve until the voltages and currents stop changing.

    stop when |Δxᵢ| ≤ 1e-3 × max(|xᵢ new|, |xᵢ old|) + 1e-6 V (or 1e-12 A) for every unknown

    Circuit solver circuit.js Every app
    64-bit
  • Operating point

    The DC voltages and currents of the circuit.

    direct Newton, then gmin stepping, then source stepping

    Circuit solver circuit.js Every app
    64-bit
  • DC sweep

    The circuit solved for each value of a swept source.

    Circuit solver circuit.js Every app
    64-bit
  • AC small-signal response

    Complex node voltages and branch currents at each frequency.

    capacitor: jωC; inductor: −jωL on its branch row; ω = 2π f

    Circuit solver circuit.js Every app
    64-bit
  • Transient

    Voltages and currents over time.

    trapezoidal rule after a first backward-Euler step; output at t = k × tstep

    Circuit solver circuit.js Every app
    64-bit
  • Junction voltage limiting

    Keeps a diode or transistor voltage from jumping too far in one iteration.

    v = v_old + vt ln(1 + (v_new − v_old) ÷ vt) when the step exceeds 2 vt above vcrit

    Circuit solver circuit.js Every app
    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.