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

  • Quintic profile

    A move with zero speed and acceleration at both ends.

    q = q₀ + Δ (10τ³ − 15τ⁴ + 6τ⁵)

    Inverse kinematics and joint trajectories traj.js Every app
    64-bit
  • Synchronized joint move

    All joints start and stop together; the slowest joint sets the time.

    qᵢ(t) = aᵢ + (bᵢ − aᵢ) × s(t) ÷ ΔS

    Inverse kinematics and joint trajectories traj.js Every app
    64-bit
  • Straight-line move

    Joint values along a straight line of the tool in space.

    p_k = p_A + (p_B − p_A) k ÷ n, each solved by inverse kinematics

    Inverse kinematics and joint trajectories traj.js Every app
    64-bit
  • Peak joint torques of a move

    The largest torque each joint needs, against its effort limit.

    peak = max |τ| over samples + 1 evenly spaced times (51 by default)

    Inverse kinematics and joint trajectories traj.js Every app
    64-bit
  • Joint and driver equations

    How far the bodies are from satisfying every joint and driver.

    revolute: world(pa) − world(pb) = 0; prismatic: angle difference − rel = 0 and offset across the slide = 0

    Planar linkages (closed loops) loops.js Every app
    64-bit
  • Jacobian by central differences

    The derivative of every equation with respect to every unknown.

    J_ik = (f_i(q + h e_k) − f_i(q − h e_k)) ÷ 2h, h = 1e-7 × max(1, |q_k|)

    Planar linkages (closed loops) loops.js Every app
    64-bit
  • Pose iteration

    Moves the bodies until the equations are met.

    (JᵀJ + λ (1 + diag)) Δq = −Jᵀ f

    Planar linkages (closed loops) loops.js Every app
    64-bit
  • Degrees of freedom

    How many drivers the linkage needs.

    dof = unknowns − rank(J); Grübler count = 3 × bodies − 2 × joints

    Planar linkages (closed loops) loops.js Every app
    64-bit
  • Solved pose

    The position and angle of every body for the given driver values.

    Planar linkages (closed loops) loops.js Every app
    64-bit
  • Sweep and velocity ratios

    Poses, point paths and rates over a range of the driver.

    value_k = from + (to − from) k ÷ n; rates from J dq = e_driver

    Planar linkages (closed loops) loops.js Every app
    64-bit
  • Grashof class

    Whether one link of a four-bar can turn fully.

    Grashof when s + l ≤ p + q + 1e-12; change point when |s + l − p − q| < 1e-12

    Planar linkages (closed loops) loops.js Every app
    64-bit
  • Four-bar starting pose

    Where the coupler and rocker meet for a given crank angle.

    k = (b² − c² + d²) ÷ 2d; h = √(b² − k²)

    Planar linkages (closed loops) loops.js Every app
    64-bit
  • Transmission angle

    The angle between coupler and rocker at their joint.

    μ = |θ_coupler − θ_rocker| folded into [0, π ÷ 2]

    Planar linkages (closed loops) loops.js Every app
    64-bit
  • Gravity and fluid properties

    Standard gravity and the built-in density and viscosity of water, air and methane.

    g = 9.80665 m/s²; water ρ = 998.2 kg/m³, μ = 1.002 × 10⁻³ Pa·s

    Pipe, duct and gas networks fluid.js Every app
    64-bit
  • Friction factor

    The Darcy friction factor from the Reynolds number and relative roughness.

    Re < 2000: f = 64 ÷ Re; Re > 4000: f = 0.25 ÷ log₁₀(ε ÷ 3.7D + 5.74 ÷ Re^0.9)²; a linear blend between

    Pipe, duct and gas networks fluid.js Every app
    64-bit
  • Colebrook–White friction factor

    The implicit friction factor, offered for comparison.

    1 ÷ √f = −2 log₁₀(ε ÷ 3.7D + 2.51 ÷ (Re √f))

    Pipe, duct and gas networks fluid.js Every app
    64-bit
  • Network iteration

    Updates every node head and link flow until they balance.

    (A₂₁ D⁻¹ A₁₂) ΔH = −A₂₁ D⁻¹ F₁ − (q − A₂₁ Q); ΔQ = −D⁻¹ (loss − ΔH)

    Pipe, duct and gas networks fluid.js Every app
    64-bit
  • Node pressure

    The pressure reported at each node.

    water: p = (H − z) × 998.2 × g; gas: p = √(max(p², 0))

    Pipe, duct and gas networks fluid.js Every app
    64-bit
  • Link flow, loss and velocity

    The results reported for each link.

    loss = H_from − H_to; v = Q ÷ (π D² ÷ 4)

    Pipe, duct and gas networks fluid.js Every app
    64-bit
  • Hardy Cross loop corrections

    A second, independent way to balance flows in loops given by hand.

    ΔQ = −Σ dir × h(Q) ÷ Σ h′(Q) per loop

    Pipe, duct and gas networks fluid.js Every app
    64-bit
  • Dense linear solve

    Solves the nodal equations of the pipe network and the load-flow Jacobian.

    Gaussian elimination with partial pivoting

    Pipe, duct and gas networks numeric.js Every app
    64-bit
  • Bus admittance matrix

    The admittances that link every pair of buses.

    y = 1 ÷ (r + jx); Yff = (y + jb ÷ 2) ÷ |a|²; Yft = −y ÷ conj(a); Ytt = y + jb ÷ 2

    Load flow and short-circuit currents power.js Every app
    64-bit
  • Power injected at each bus

    Real and reactive power from the voltages.

    Pᵢ = Σ Vᵢ Vⱼ (G cos δ + B sin δ); Qᵢ = Σ Vᵢ Vⱼ (G sin δ − B cos δ)

    Load flow and short-circuit currents power.js Every app
    64-bit
  • Load flow iteration

    Corrects angles and voltages until the power balances.

    J Δx = (P_sched − P, Q_sched − Q); stop when max |mismatch| < 1e-9 pu

    Load flow and short-circuit currents power.js Every app
    64-bit
  • Reactive limits of generator buses

    Switches a voltage-controlled bus to a fixed reactive power when it passes its limit.

    switch when Q_g > Qmax + 1e-9 or Q_g < Qmin − 1e-9

    Load flow and short-circuit currents power.js Every app
    64-bit
  • Branch flows and losses

    Power at both ends of each branch and the loss in it.

    S_f = V_f conj(I_f); loss = P_f + P_t

    Load flow and short-circuit currents power.js Every app
    64-bit
  • Per-unit base

    Ohms to per unit on a voltage and power base.

    Z_base = kV² ÷ MVA; z_pu = z ÷ Z_base

    Load flow and short-circuit currents power.js Every app
    64-bit
  • Feeder voltage drop

    The three-phase voltage drop of a feeder.

    ΔV ≈ √3 I (R cos φ + X sin φ), φ = acos(pf)

    Load flow and short-circuit currents power.js Every app
    64-bit
  • Sequence impedance matrices

    The impedance seen from every bus in the positive, negative and zero sequence.

    Z = Y⁻¹ for each sequence

    Load flow and short-circuit currents shortcircuit.js Every app
    64-bit
  • Sequence to phase values

    Phase currents and voltages from the sequence components.

    I_a = I₀ + I₁ + I₂; I_b = I₀ + a² I₁ + a I₂; I_c = I₀ + a I₁ + a² I₂, a = −½ + j√3 ÷ 2

    Load flow and short-circuit currents shortcircuit.js Every app
    64-bit
  • Fault current

    Initial and peak fault current, fault power, and the voltages and branch currents during the fault.

    3-phase: I₁ = c ÷ (Z₁ + Z_f); line to ground: I₁ = c ÷ (Z₁ + Z₂ + Z₀ + 3Z_f); i_p = κ √2 I_k, κ = 1.02 + 0.98 e^(−3R/X)

    Load flow and short-circuit currents shortcircuit.js Every app
    64-bit
  • Complex division

    a ÷ b for the impedances and currents of the fault study.

    a ÷ b = a conj(b) ÷ (b_re² + b_im²)

    Load flow and short-circuit currents numeric.js Every app
    64-bit
  • Complex matrix inverse

    Inverts a sequence admittance matrix.

    Gauss–Jordan elimination with pivoting by magnitude

    Load flow and short-circuit currents numeric.js Every app
    64-bit
  • Curve constants

    The constants of the IEC and IEEE inverse-time curves and the cable factors.

    IEC normal inverse k = 0.14, α = 0.02; IEEE very inverse A = 19.61, B = 0.491, p = 2; cable k: copper PVC 115

    Protection curves and grading protection.js Every app
    64-bit
  • Relay operating time

    How long a relay takes to trip at a current.

    IEC: t = TMS × k ÷ (M^α − 1); IEEE: t = TD ÷ divisor × (A ÷ (M^p − 1) + B), M = I ÷ pickup

    Protection curves and grading protection.js Every app
    64-bit
  • Fuse or breaker curve from points

    The operating time of a device given as a table of current and time.

    ln t = ln t₀ + (ln I − ln I₀) ÷ (ln I₁ − ln I₀) × (ln t₁ − ln t₀)

    Protection curves and grading protection.js Every app
    64-bit
  • Cable damage time

    How long a cable can carry a fault current.

    t = (k S ÷ I)²

    Protection curves and grading protection.js Every app
    64-bit
  • Grading margin

    The time between a downstream and an upstream device at each fault current.

    margin = t_up − t_down; ok when margin ≥ the grading interval (0.3 s by default)

    Protection curves and grading protection.js Every app
    64-bit
  • Pickup and cable checks

    Pickup against load and the smallest fault, and clearing time against the cable.

    pickup ≥ 1.05 × load; pickup ≤ smallest fault ÷ 1.5; clearing time ≤ (k S ÷ I)²

    Protection curves and grading protection.js Every app
    64-bit
  • Point to segment distance

    The distance from a point to a track center line or a polygon edge.

    t = clamp(((p − a) · (b − a)) ÷ |b − a|², 0, 1); d = |p − (a + t (b − a))|

    Board geometry and clearances geom.js Every app
    64-bit
  • Orientation of three points

    Which side of a line a point lies on.

    o = (b − a) × (c − a)

    Board geometry and clearances geom.js Every app
    64-bit
  • Segment crossing test

    Whether two segments cross or touch.

    cross when the orientation signs differ on both segments; touch when an orientation is 0 and the point lies in the other's box

    Board geometry and clearances geom.js Every app
    64-bit
  • Segment to segment distance

    The distance between two track center lines or edges.

    0 when they cross; else the least of four point-to-segment distances

    Board geometry and clearances geom.js Every app
    64-bit
  • Point in polygon

    Whether a point lies inside a zone, a pad or the board outline.

    even-odd rule along a ray in +x

    Board geometry and clearances geom.js Every app
    64-bit
  • Polygon area

    The signed area of a closed polygon.

    A = ½ Σ (xᵢ yᵢ₊₁ − xᵢ₊₁ yᵢ)

    Board geometry and clearances geom.js Every app
    64-bit
  • Polygon to polygon distance

    The distance between two closed shapes.

    0 when one first vertex is inside the other; else the least edge-to-edge distance

    Board geometry and clearances geom.js Every app
    64-bit
  • Gap between copper shapes

    The edge-to-edge clearance between two tracks, pads or zones.

    gap = max(0, center-line distance − r₁ − r₂)

    Board geometry and clearances geom.js Every app
    64-bit
  • Rotation of a point

    A pad or outline point turned by an angle in degrees.

    (x cos θ − y sin θ, x sin θ + y cos θ), θ = degrees × π ÷ 180

    Board geometry and clearances geom.js Every app
    64-bit
  • Pad position on the board

    Where a footprint pad sits on the board, with its shape for the clearance check.

    world = part position + R(part rotation) × (±x, y)

    Board geometry and clearances board.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.