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

  • Stiffness matrix of a shear building

    Builds the tridiagonal floor stiffness matrix from one stiffness per story.

    K[i][i] = k[i] + k[i+1]; K[i][i+1] = K[i+1][i] = −k[i+1]

    Earthquake time-history of a building hazard.js
    • BimCraft
    64-bit
  • Periods, mode shapes and effective mass

    The natural periods, the mode shapes scaled to 1 at the top floor, the participation factor and the effective mass of each mode.

    S = K[i][j] ÷ √(mᵢ mⱼ); ω = √max(λ, 0); T = 2π ÷ ω; Γ = Σ m φ ÷ Σ m φ²; effective mass = (Σ m φ)² ÷ Σ m φ²

    Earthquake time-history of a building hazard.js
    • BimCraft
    64-bit
  • Story stiffness for a chosen first period

    The single story stiffness that gives the building the first period the person typed.

    k = (2π ÷ T₁)² ÷ ω₁², ω₁ = first frequency with k = 1

    Earthquake time-history of a building hazard.js
    • BimCraft
    64-bit
  • Made ground acceleration record

    A Ricker pulse or filtered noise record scaled to the peak ground acceleration asked for.

    Ricker: a = (1 − 2x²) × e^(−x²), x = π f (t − 1.5 ÷ f); then a × pga ÷ max|a|

    Earthquake time-history of a building hazard.js
    • BimCraft
    64-bit
  • Newmark time stepping

    The floor displacements, velocities and accelerations at every time step of the record.

    K* = K + c₁ M + c₂ C, c₁ = 1 ÷ (β Δt²), c₂ = γ ÷ (β Δt), β = 1/4, γ = 1/2; C = a₀ M + a₁ K

    Earthquake time-history of a building hazard.js
    • BimCraft
    64-bit
  • Peak drift, floor acceleration, base shear and roof displacement

    The largest values over the run that the person reads.

    drift = uᵢ − uᵢ₋₁; floor acceleration = ü + a_g; base shear = k₀ u₁ (shear building) or Σ m (ü + a_g) (full matrix)

    Earthquake time-history of a building hazard.js
    • BimCraft
    64-bit
  • Sway under static floor forces

    Floor displacements and story drifts under static sideways forces, used for the wind sway.

    shear building: driftᵢ = (Σ F above) ÷ kᵢ, u = running sum of drifts; full matrix: K u = F

    Earthquake time-history of a building hazard.js
    • BimCraft
    64-bit
  • Floor heights from the frame's nodes

    Groups the frame's nodes into floors by height and takes the lowest group as the base.

    nodes whose heights differ by ≤ tol join one group; floor height = mean of the group

    Earthquake time-history of a building hazard-frame.js
    • BimCraft
    64-bit
  • Inverse of the flexibility table

    Turns the floors' flexibility table into their stiffness matrix.

    Earthquake time-history of a building hazard-frame.js
    • BimCraft
    64-bit
  • Floor stiffness of a frame

    The stiffness the frame gives each floor sideways, and one stiffness per story for the drift check.

    F[i][j] = (mean sideways move of floor i under 1000 N on floor j) ÷ 1000 ÷ 1000; K = F⁻¹; k_story = V ÷ drift under forces ∝ height

    Earthquake time-history of a building hazard-frame.js
    • BimCraft
    64-bit
  • Floor masses from the frame

    The mass on each floor: half of each member's weight at each end, plus a load per square meter over the floor's plan box.

    member mass = ρ × A × L × 1e-9; floor area = (x extent ÷ 1000) × (y extent ÷ 1000); m = max(1, self + area × load)

    Earthquake time-history of a building hazard-frame.js
    • BimCraft
    64-bit
  • Reading a property value

    Turns an IFC property or quantity value into the number or text the index, the totals and the comparison use.

    number kept = round(x × 10⁶) ÷ 10⁶

    Quantity totals and schedules from IFC properties ifc-props.js
    • BimCraft
    64-bit
  • Rounding a total

    Cuts a sum to 12 significant digits so that binary noise such as 0.1 + 0.2 does not show.

    tidy(n) = Number(n.toPrecision(12))

    Quantity totals and schedules from IFC properties ifc-qto.js
    • BimCraft
    64-bit
  • Totals by group

    Counts elements and sums the chosen number fields for each combination of group values and for the whole selection.

    sum = Σ vᵢ over the elements with a number; counted = how many had one

    Quantity totals and schedules from IFC properties ifc-qto.js
    • BimCraft
    64-bit
  • Spaces schedule totals

    The total floor area and volume of the listed rooms.

    Quantity totals and schedules from IFC properties ifc-qto.js
    • BimCraft
    64-bit
  • Is a property value the same in both versions

    Decides whether a number or text property changed between two versions of a model.

    same when |a − b| ≤ 1e-9 × max(1, |a|, |b|)

    Quantity totals and schedules from IFC properties ifc-compare.js
    • BimCraft
    64-bit
  • Number shown in Properties

    How a property or quantity value from the file is written out in the Properties panel.

    shown = round(x × 10⁴) ÷ 10⁴

    Quantity totals and schedules from IFC properties ifc-model.js
    • BimCraft
    64-bit
  • Placement of an item relative to its story

    The location and X direction written to the file for a placed item.

    (lx, ly) = W⁻¹ × (x ÷ unit, y ÷ unit, story z); direction = W⁻¹ rotation × (cos r, sin r)

    Placing and pasting elements in an IFC model ifc-place.js
    • BimCraft
    64-bit
  • Position and rotation read back from a placement

    The x, y and rotation of each placed item as listed in the equipment schedule and used by copy and paste.

    x = W[12] × unit; y = W[13] × unit; rot = round(atan2(W[1], W[0]) in degrees × 1000) ÷ 1000

    Placing and pasting elements in an IFC model ifc-place.js
    • BimCraft
    64-bit
  • An item's body in the file's unit

    Writes a library item's mesh or box as IFC geometry in the file's length unit.

    coordinate in file units = millimeters ÷ (millimeters per file unit)

    Placing and pasting elements in an IFC model ifc-place.js
    • BimCraft
    64-bit
  • Plan outline as polylines

    Turns the lines, arcs, circles, ellipses and bulged polylines of an item's plan into the straight segments written as its footprint.

    arc: n = max(4, ⌈sweep ÷ 10°⌉) segments; bulge: θ = 4 atan(b), r = chord ÷ (2 sin(θ ÷ 2))

    Placing and pasting elements in an IFC model ifc-place.js
    • BimCraft
    64-bit
  • Viewer point to model millimeters and back

    Converts a point between the viewer's Y-up meters and the model's Z-up millimeters.

    model = (x × 1000, −z × 1000, y × 1000) of C⁻¹ × v; viewer = C × (x ÷ 1000, z ÷ 1000, −y ÷ 1000)

    Placing and pasting elements in an IFC model ifc-place.js
    • BimCraft
    64-bit
  • Move and turn of pasted elements

    The matrix that carries copied elements to where they are pasted, with a turn about a point and a change of story.

    M = T(about + d) × Rz(rot) × T(−about); dz = elevation of target story − elevation of source story

    Placing and pasting elements in an IFC model ifc-elements.js
    • BimCraft
    64-bit
  • Placement written for a pasted element

    The location, Z axis and X axis of the new placement, from its matrix.

    location = round to 6 decimals; axis = column ÷ its length, rounded to 9 decimals

    Placing and pasting elements in an IFC model ifc-elements.js
    • BimCraft
    64-bit
  • Is this mesh a straight prism

    Checks that the mesh is closed and consistently wound, and picks candidate directions for the prism's axis.

    eps = tol × bounding-box diagonal, tol = 1e-6

    Turning a face mesh back into an extrusion ifc-solids.js
    • BimCraft
    64-bit
  • Depth, frame and outline of the prism

    The prism's depth, its origin and axes, and its outline and holes in the cap's own two axes.

    h = v · n; depth = max h − min h; (u, v) = ((p − origin) · x, (p − origin) · y)

    Turning a face mesh back into an extrusion ifc-solids.js
    • BimCraft
    64-bit
  • Removing collinear outline points

    Drops outline corners that lie on the line between their neighbors.

    drop b when |(b − a) × (c − b)| ≤ tol × max(1, |c − a|)

    Turning a face mesh back into an extrusion ifc-solids.js
    • BimCraft
    64-bit
  • Volume of a closed mesh

    The signed volume of a closed triangle mesh, used to check a conversion.

    V = Σ A · (B × C) ÷ 6

    Turning a face mesh back into an extrusion ifc-solids.js
    • BimCraft
    64-bit
  • Area of the prism's outline

    The outline's area less its holes; times the depth it is the prism's volume.

    area = |shoelace(outer)| − Σ |shoelace(hole)|

    Turning a face mesh back into an extrusion ifc-solids.js
    • BimCraft
    64-bit
  • Writing the prism into the file

    The IFC lines of the outline, its placement and the extrusion depth.

    each number written as toFixed(6)

    Turning a face mesh back into an extrusion ifc-solids.js
    • BimCraft
    64-bit
  • Degrees from degrees, minutes, seconds and millionths

    Reads an IFC compound angle as decimal degrees.

    deg = d + m ÷ 60 + (s + μ ÷ 10⁶) ÷ 3600

    Where an IFC model point is on the earth ifc-geo.js
    • BimCraft
    64-bit
  • File point to map grid

    Easting, northing and height in meters of a point of the file.

    [E, N, H] = (matrix × p) × meters per map unit

    Where an IFC model point is on the earth ifc-geo.js
    • BimCraft
    64-bit
  • Longitude and latitude from the site's reference point

    An approximate WGS 84 position of a file point from its offset east and north of the site's point.

    w = √(1 − e² sin² φ); N = a ÷ w; M = a (1 − e²) ÷ w³; lon = lon₀ + east ÷ ((N + h) cos φ); lat = lat₀ + north ÷ (M + h)

    Where an IFC model point is on the earth ifc-geo.js
    • BimCraft
    64-bit
  • Degrees to degrees, minutes and seconds

    Formats a latitude or longitude with its hemisphere letter.

    d = ⌊|deg|⌋; m = ⌊(|deg| − d) × 60⌋; s = (|deg| − d − m ÷ 60) × 3600, shown with 2 decimals

    Where an IFC model point is on the earth ifc-geo.js
    • BimCraft
    64-bit
  • Viewer point to the file's own coordinates

    Takes a point picked in the viewer back to the file's Z-up coordinates in its own length unit.

    y = C⁻¹ × (place⁻¹ × p); file = (y_x, −y_z, y_y) ÷ meters per file unit

    Where an IFC model point is on the earth ifc-geo.js
    • BimCraft
    64-bit
  • Section of a run

    The outside diameter, wall and bend radius of a pipe from the size table, or the width and height of a duct, in millimeters.

    mm = inches × 25.4

    Pipe and duct runs: layout, lengths and sizing mep-model.js
    • BimCraft
    64-bit
  • Run corners with the slope applied

    The corners of a run with its fall along the horizontal length from the first point.

    z = z₀ − slope × Σ horizontal leg length

    Pipe and duct runs: layout, lengths and sizing mep-model.js
    • BimCraft
    64-bit
  • Bend radius of an elbow

    The center-line radius an elbow is built with.

    pipe: the table's radius; round duct: 1.5 × diameter; rectangular duct: its width for a turn in plan, its height for a turn up or down

    Pipe and duct runs: layout, lengths and sizing mep-model.js
    • BimCraft
    64-bit
  • Elbow geometry at a corner

    The two tangent points, center and angle of the elbow where a run turns.

    θ = acos(d₁ · d₂); T = R × tan(θ ÷ 2); center = p₀ + n × R

    Pipe and duct runs: layout, lengths and sizing mep-model.js
    • BimCraft
    64-bit
  • Where runs meet

    Finds run ends that touch another run's end or lie on another run's line, to make an elbow, reducer or tee there.

    end to end when |P − Q| ≤ max(tol_a, tol_b); tee when the foot of P on a leg is within the tolerance

    Pipe and duct runs: layout, lengths and sizing mep-model.js
    • BimCraft
    64-bit
  • Elbow, reducer and tee allowances

    How much of each leg an elbow, a reducer or a tee takes.

    reducer length (duct) = max(150, max(|Δw|, |Δh|) ÷ 2 ÷ tan 15°); tee half length = max(25, 0.5 × branch + 0.25 × host)

    Pipe and duct runs: layout, lengths and sizing mep-model.js
    • BimCraft
    64-bit
  • Straight pieces between fittings

    The start and end of every straight piece along each leg, after trims, tees, valves and weld cuts.

    Pipe and duct runs: layout, lengths and sizing mep-model.js
    • BimCraft
    64-bit
  • Saving a run's definition

    The points, sizes, slope and flow kept in the run's property set.

    point = round to 3 decimals of a millimeter

    Pipe and duct runs: layout, lengths and sizing mep-model.js
    • BimCraft
    64-bit
  • Length and surface written on each piece

    The length of a straight pipe or duct piece and a duct's outside surface, written as IFC quantities.

    L = |b − a|; perimeter = π w (round), π h + 2 (w − h) (oval), 2 (w + h) (rectangle); surface = perimeter × L

    Pipe and duct runs: layout, lengths and sizing mep-model.js
    • BimCraft
    64-bit
  • Elbow written as a revolved section

    The axis and angle of the solid of revolution that an elbow is written as.

    axis at R to the side of the section; angle = θ

    Pipe and duct runs: layout, lengths and sizing mep-model.js
    • BimCraft
    64-bit
  • Flat-oval outline

    The outline of a flat-oval duct with semicircular ends.

    r = H ÷ 2; c = W ÷ 2 − r; points at c + r cos a, r sin a

    Pipe and duct runs: layout, lengths and sizing mep-model.js
    • BimCraft
    64-bit
  • Position along a run

    How far along a run a plan point lies, and how far off the line.

    t = clamp((p − a) · d, 0, L); s = Σ earlier legs + t

    Pipe and duct runs: layout, lengths and sizing mep-model.js
    • BimCraft
    64-bit
  • Length of a run

    The length of a run's center line through its corners, with the slope applied.

    L = Σ |Vᵢ − Vᵢ₋₁|

    Pipe and duct runs: layout, lengths and sizing mep-model.js
    • BimCraft
    64-bit
  • Pipe size for a flow and a velocity limit

    The smallest pipe of a material and class whose velocity stays at or under the limit.

    V = Q ÷ (π D² ÷ 4); first size with V ≤ V_max

    Pipe and duct runs: layout, lengths and sizing mep-model.js
    • BimCraft
    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.