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.
Calculations
-
Push/pull distance
The distance a face is pushed, in the open group's own scale, and the distance reported back.
kernel distance = d × k; reported d = returned distance ÷ k; k = |normal taken into the group's axes|
3D drawing and editing tools m3d/tools.js64-bit- CadCraft
- ModelCraft
-
Move and copy
The translation applied to the selection, in the open group's own coordinates.
local delta = M⁻¹ × delta (direction only); transform = T(local delta)
3D drawing and editing tools m3d/tools.js64-bit- CadCraft
- ModelCraft
-
Rows and rings of copies
The transform of each copy when a copy is repeated (3x) or divided (/3).
copy k: T(k × delta) or R(k × angle); divided: k ÷ n of the delta or angle
3D drawing and editing tools m3d/tools.js64-bit- CadCraft
- ModelCraft
-
Rotation angle
The angle the selection is turned by, from the reference direction to the pointer.
a = atan2((ref × v)·n, ref·v); snapped to k × π ÷ 12 when within 2.5°
3D drawing and editing tools m3d/tools.js64-bit- CadCraft
- ModelCraft
-
Uniform scale factor
The factor the selection is scaled by about a fixed point, from a reference point to the pointer.
f = max(0.001, ((p − base)·u) ÷ (u·u)), u = ref − base
3D drawing and editing tools m3d/tools.js64-bit- CadCraft
- ModelCraft
-
Stretch by a grip
The matrix that scales the selection by separate factors along the group's three axes about an anchor.
M = T(a) × diag(fx, fy, fz) × T(−a)
3D drawing and editing tools m3d/tools.js64-bit- CadCraft
- ModelCraft
-
Guide line offset from an edge
The perpendicular offset of a new guide line from the edge or guide it was measured from.
w = w₀ − dir × (w₀·dir), w₀ = pointer − start
3D drawing and editing tools m3d/tools.js64-bit- CadCraft
- ModelCraft
-
Guide direction at an angle
The direction of a guide line at a given angle from the protractor's zero direction.
d = normalize(u × cos a + (n × u) × sin a)
3D drawing and editing tools m3d/tools.js64-bit- CadCraft
- ModelCraft
-
Dimension line offset
Where the dimension line sits: the pointer's offset square to the measured line.
off = q − ab × (q·ab), q = pointer on the plane − first point, ab = unit direction of the measured line
3D drawing and editing tools m3d/tools.js64-bit- CadCraft
- ModelCraft
-
Terrain brush weights
How much each terrain point under the round brush is raised or lowered.
w = 0.5 × (1 + cos(π × d ÷ R)) for d < R; new z = z + w × Δz
3D drawing and editing tools m3d/tools.js64-bit- CadCraft
- ModelCraft
-
Selection bounding box
The box around the selection in world coordinates; its middle is the center for turning and scaling from the keyboard.
min and max per axis over the transformed points; center = (min + max) × 0.5
3D drawing and editing tools m3d/tools.js64-bit- CadCraft
- ModelCraft
-
Frame of a placed component
The three axis directions a component gets when it is laid on a face.
z = face normal toward the eye; x = red axis less its part along z (or blue × z); y = z × x
3D drawing and editing tools m3d/tools.js64-bit- CadCraft
- ModelCraft
-
Mesh buffers for the graphics card
The vertex positions, normals and colors of a definition's faces as the arrays the graphics card draws.
3D view drawing m3d/view3d.js32-bit, display only- CadCraft
- ModelCraft
-
Box of a placement as drawn
The world-space box of one placed definition, used to frame the view and place the lights.
3D view drawing m3d/view3d.js32-bit, display only- CadCraft
- ModelCraft
-
Overlay line clipped to the near plane
A 3D line cut at the camera's near plane and projected to screen points for the 2D overlay.
cut at depth 1.01 × near: a′ = a + (b − a) × (near′ − da) ÷ (db − da)
3D view drawing m3d/view3d.js32-bit, display only- CadCraft
- ModelCraft
-
Unit constants
The Boltzmann constant, Coulomb constant, acceleration factor and pressure factor for reduced and real units.
real: kB = 0.0019872041 kcal/mol/K; ke = 332.0637; accel = 418.4; pressure = 68568.4 atm per kcal/mol/ų
Molecular dynamics molecular/md.js64-bit- CadCraft
- BimCraft
-
Complementary error function
erfc(x), used for the real-space part of the Ewald sum.
erfc(x) ≈ t × exp(−x² + P₉(t)), t = 1 ÷ (1 + |x| ÷ 2); 2 − that for x < 0
Molecular dynamics molecular/md.js64-bit- CadCraft
- BimCraft
-
Pair parameters and the cutoff shift
σ and ε for each pair of atom types and the energy subtracted so the pair energy is zero at the cutoff.
σᵢⱼ = (σᵢ + σⱼ) ÷ 2; εᵢⱼ = √(εᵢ εⱼ); shift = 4 εᵢⱼ (s² − s), s = (σᵢⱼ ÷ r_c)⁶
Molecular dynamics molecular/md.js64-bit- CadCraft
- BimCraft
-
Kinetic energy
The kinetic energy of the system in its energy unit.
KE = ½ Σ mᵢ (vx² + vy² + vz²) ÷ accel
Molecular dynamics molecular/md.js64-bit- CadCraft
- BimCraft
-
Temperature
The instantaneous temperature from the kinetic energy.
T = 2 KE ÷ (dof × kB), dof = max(1, 3N − 3 − constraints)
Molecular dynamics molecular/md.js64-bit- CadCraft
- BimCraft
-
Pair forces and energies
The Lennard-Jones and real-space Coulomb force, energy and virial of one pair of atoms.
U = 4ε(s⁶² − s⁶) − shift, s⁶ = (σ² ÷ r²)³; Coulomb: ke qᵢqⱼ erfc(αr) ÷ r; excluded pairs: −ke qᵢqⱼ erf(αr) ÷ r
Molecular dynamics molecular/md.js64-bit- CadCraft
- BimCraft
-
Bond stretch
The energy, force and virial of each harmonic bond.
U = ½ k (r − r₀)²; F = −k (r − r₀) ÷ r along the bond
Molecular dynamics molecular/md.js64-bit- CadCraft
- BimCraft
-
Bond angles
The energy, forces and virial of each harmonic angle.
θ = acos(a·b ÷ (|a||b|)); U = ½ k (θ − θ₀)²; dU/dcos = −k (θ − θ₀) ÷ sin θ
Molecular dynamics molecular/md.js64-bit- CadCraft
- BimCraft
-
Dihedral angles
The energy and forces of each periodic dihedral.
φ = atan2(|b₂| b₁·n₂, n₁·n₂); U = k_d (1 + cos(nφ − δ))
Molecular dynamics molecular/md.js64-bit- CadCraft
- BimCraft
-
Ewald reciprocal sum and self term
The long-range part of the Coulomb energy and force.
E = (2π ke ÷ V) Σ_k exp(−k² ÷ 4α²) ÷ k² × |S(k)|², |n|² ≤ kmax²; self = −ke α ÷ √π × Σ q²
Molecular dynamics molecular/md.js64-bit- CadCraft
- BimCraft
-
Pressure
The virial pressure of the box.
P = (2 KE + W) ÷ (3V) × unit factor
Molecular dynamics molecular/md.js64-bit- CadCraft
- BimCraft
-
Time stepping, thermostats and barostat
Advances the system by velocity Verlet, with optional temperature and pressure coupling.
v += ½ dt a; x += dt v; forces; v += ½ dt a; Berendsen λ = √(1 + dt÷τ (T₀÷T − 1)); μ = ∛(max(0.5, 1 − dt÷τ_p κ (P₀ − P)))
Molecular dynamics molecular/md.js64-bit- CadCraft
- BimCraft
-
Radial distribution function
g(r): how many atoms sit at each distance, relative to an ideal gas of the same density.
g(b) = count(b) ÷ (frames × shell × N_A × (N_B, or N_A − 1 for one type) ÷ V), shell = 4⁄3 π ((b+1)³ − b³) dr³
Molecular dynamics molecular/md.js64-bit- CadCraft
- BimCraft
-
Mean-square displacement and diffusion
The mean-square displacement over time and the diffusion coefficient from its slope.
D = (n Σtm − Σt Σm) ÷ (n Σt² − (Σt)²) ÷ 6 over the chosen part of the samples
Molecular dynamics molecular/md.js64-bit- CadCraft
- BimCraft
-
Mass density
The density of the box in g/cm³ (real units).
ρ = Σm ÷ 0.602214076 ÷ V (amu per ų to g/cm³)
Molecular dynamics molecular/md.js64-bit- CadCraft
- BimCraft
-
Fast Fourier transform
The in-place radix-2 transform used on each axis of the charge mesh.
Molecular dynamics molecular/pme.js64-bit- CadCraft
- BimCraft
-
Cardinal B-spline
The weight of a charge on a mesh point.
M₂(u) = 1 − |u − 1|; Mₙ(u) = u ÷ (n−1) × Mₙ₋₁(u) + (n−u) ÷ (n−1) × Mₙ₋₁(u−1)
Molecular dynamics molecular/pme.js64-bit- CadCraft
- BimCraft
-
B-spline moduli
The correction 1 ÷ |b(m)|² applied to each mesh wave vector.
Molecular dynamics molecular/pme.js64-bit- CadCraft
- BimCraft
-
Particle-mesh Ewald energy and forces
The reciprocal Coulomb energy and the force on every charge from a mesh instead of the plain sum.
E = ½ Σ_m G(m) |Q̂(m)|², G = ke ÷ (πV) × exp(−π² m² ÷ α²) ÷ m² × B(m)
Molecular dynamics molecular/pme.js64-bit- CadCraft
- BimCraft
-
Rigid bonds
Moves atoms after a step so each constrained bond has its set length, and corrects the velocities.
g = (d² − r²) ÷ (2 (1÷mᵢ + 1÷mⱼ) r·s); stop when |d² − r²| ≤ 2 × tol × d²
Molecular dynamics molecular/pme.js64-bit- CadCraft
- BimCraft
-
Mean and standard error of a run
The mean of the samples and its standard error by block averaging.
mean = Σx ÷ n; error = √(Σ(blockᵢ − m)² ÷ (nb − 1) ÷ nb), nb = min(5, n) blocks of ⌊n ÷ nb⌋ samples
Molecular dynamics molecular/props.js64-bit- CadCraft
- BimCraft
-
Run results as component properties
The liquid density and diffusion coefficient of a run in SI units for a process component.
ρ (kg/m³) = ρ (g/cm³) × 1000; D (m²/s) = D (Ų/ps) × 1e-8
Molecular dynamics molecular/props.js64-bit- CadCraft
- BimCraft
-
Linear solve
x from A x = b for a small dense system.
Gaussian elimination with row exchange on the largest pivot, then back substitution
Solvers shared by the process engine process/numeric.js64-bit- CadCraft
- BimCraft
-
Newton iteration
The solution of a set of nonlinear equations F(x) = 0.
J Δx = −F, Jᵢⱼ ≈ (Fᵢ(x + h eⱼ) − Fᵢ(x)) ÷ h, h = 1e-7 × max(|xⱼ|, 1e-6); x ← x + λ Δx, λ halved until |F| falls
Solvers shared by the process engine process/numeric.js64-bit- CadCraft
- BimCraft
-
Adaptive Runge–Kutta integration
y(x₁) for a system of ordinary differential equations, with the accepted points along the way.
Dormand–Prince 5(4): error = max |h Σ(b₅ − b₄)k| ÷ (atol + rtol × max(|y|, |y_new|)) ≤ 1; h ← h × clamp(0.9 × error^(−0.2), 0.2, 5)
Solvers shared by the process engine process/numeric.js64-bit- CadCraft
- BimCraft
-
Bracketed root
A root of one equation between two points where the function changes sign.
c = (f_a b − f_b a) ÷ (f_a − f_b); the retained end's value is halved when the same side is kept twice
Solvers shared by the process engine process/numeric.js64-bit- CadCraft
- BimCraft
-
Temperature form of the parameters
The interaction parameter of each pair at a temperature.
pᵢⱼ = aᵢⱼ + bᵢⱼ ÷ T; 0 on the diagonal
Activity coefficients and Henry's law process/activity.js64-bit- CadCraft
- BimCraft
-
NRTL
ln γ of every component by the NRTL model.
ln γᵢ = Cᵢ ÷ Sᵢ + Σⱼ xⱼ Gᵢⱼ ÷ Sⱼ × (τᵢⱼ − Cⱼ ÷ Sⱼ), Gᵢⱼ = exp(−αᵢⱼ τᵢⱼ), Sⱼ = Σ xₖ Gₖⱼ, Cⱼ = Σ xₘ τₘⱼ Gₘⱼ
Activity coefficients and Henry's law process/activity.js64-bit- CadCraft
- BimCraft
-
Wilson
ln γ of every component by the Wilson model.
ln γᵢ = 1 − ln(Σⱼ xⱼ Λᵢⱼ) − Σₖ xₖ Λₖᵢ ÷ Σⱼ xⱼ Λₖⱼ
Activity coefficients and Henry's law process/activity.js64-bit- CadCraft
- BimCraft
-
UNIQUAC
ln γ of every component by the UNIQUAC model.
ln γᵢ = ln(φᵢ÷xᵢ) + z⁄2 qᵢ ln(θᵢ÷φᵢ) + lᵢ − φᵢ÷xᵢ Σ xⱼlⱼ + qᵢ (1 − ln Σ θⱼτⱼᵢ − Σ θⱼτᵢⱼ ÷ Σ θₖτₖⱼ)
Activity coefficients and Henry's law process/activity.js64-bit- CadCraft
- BimCraft
-
Infinite-dilution limits
The closed-form ln γ of each component of a binary when it is infinitely dilute.
NRTL: ln γ₁^∞ = τ₂₁ + τ₁₂ exp(−α τ₁₂); Wilson: ln γ₁^∞ = 1 − ln Λ₁₂ − Λ₂₁
Activity coefficients and Henry's law process/activity.js64-bit- CadCraft
- BimCraft
-
Henry's constant at temperature
Henry's constant of a dissolved gas in pascals at a temperature.
H(T) = H₂₉₈ (bar) × 1e5 × exp(slope × (1 ÷ T − 1 ÷ 298.15))
Activity coefficients and Henry's law process/activity.js64-bit- CadCraft
- BimCraft
-
Model constants
The constants of the two equations of state and the correlation for κ(ω).
PR: Ω_a = 0.45724, Ω_b = 0.07780, σ = 1 + √2, ε = 1 − √2; SRK: Ω_a = 0.42748, Ω_b = 0.08664
Cubic equations of state process/eos.js64-bit- CadCraft
- BimCraft
-
Real roots of a cubic
The real roots of z³ + c₂z² + c₁z + c₀ = 0 in ascending order.
p = c₁ − c₂² ÷ 3; q = 2c₂³ ÷ 27 − c₂c₁ ÷ 3 + c₀; disc = q² ÷ 4 + p³ ÷ 27; one root: ∛(−q⁄2 + √disc) + ∛(−q⁄2 − √disc) − c₂⁄3; three: 2√(−p⁄3) cos((acos(arg) − 2πk) ÷ 3) − c₂⁄3
Cubic equations of state process/eos.js64-bit- CadCraft
- BimCraft
-
Attraction parameter of each component
a(T) and its temperature derivative for every pure component.
aᵢ = a_c,ᵢ (1 + κᵢ (1 − √(T ÷ T_c,ᵢ)))²; daᵢ/dT = −a_c,ᵢ κᵢ (1 + κᵢ(1 − √(T÷T_c))) ÷ √(T T_c,ᵢ)
Cubic equations of state process/eos.js64-bit- CadCraft
- BimCraft
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.