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
-
2D finite-element solve
The potential at every mesh node and its gradient in every triangle.
∇·(k ∇u) = −s on linear triangles; element matrix k (bᵢ · bⱼ) A
Magnetic and electric field solvers fields.js Every app64-bit -
Magnetic field, energy and saturating iron
Flux density per triangle, stored energy per meter, and the iteration for a B–H curve.
B = (∂A/∂y, −∂A/∂x); W = Σ ½ ν B² A
Magnetic and electric field solvers fields.js Every app64-bit -
Electric field and energy
Field per triangle and stored energy per meter.
E = −∇V; W = Σ ½ ε E² A
Magnetic and electric field solvers fields.js Every app64-bit -
Capacitance from energy
Capacitance per meter from the stored energy.
C = 2W ÷ ΔV²
Magnetic and electric field solvers fields.js Every app64-bit -
Force from the Maxwell stress
The force per meter on a body in the solved field.
F = Σ ((B · n) B − ½ B² n) × edge length ÷ μ
Magnetic and electric field solvers fields.js Every app64-bit -
Conjugate-gradient solve
Solves the finite-element equations.
stop when ‖r‖₂ ≤ tol × ‖b‖₂
Magnetic and electric field solvers linalg.js Every app64-bit -
Constants
The speed of light, μ0, ε0 and the impedance of free space.
c = 299792458 m/s; μ0 = 4π × 10⁻⁷; ε0 = 1 ÷ (μ0 c²); η0 = μ0 c
Wire antenna (method of moments) wire.js Every app64-bit -
Gauss–Legendre points
The sample points and weights of the integrals along segments.
2, 3 and 4 points on [0, 1]
Wire antenna (method of moments) wire.js Every app64-bit -
Segments and node merging
How wires are cut into segments and joined at shared points.
segments per leg = ⌈L ÷ maxSeg⌉, maxSeg = λ ÷ 20 by default; merge distance = 1e-6 × max(largest coordinate, λ ÷ 1000)
Wire antenna (method of moments) wire.js Every app64-bit -
Kernel integrals over a segment pair
The coupling between two segments.
∫∫ cos(kR) ÷ (4πR), R = √(|r − r′|² + a²)
Wire antenna (method of moments) wire.js Every app64-bit -
Impedance matrix
The matrix that links the currents to the source voltage.
Z_mn = jωμ (u · u′) ∫∫ f_m f_n G + (1 ÷ jωε) ∫∫ f_m′ f_n′ G
Wire antenna (method of moments) wire.js Every app64-bit -
Input impedance
The impedance seen at the feed point.
Z_in = V ÷ I at the feed
Wire antenna (method of moments) wire.js Every app64-bit -
Radiation intensity
Power per solid angle in a direction.
U = η0 k² ÷ (32π²) × (|N_θ|² + |N_φ|²)
Wire antenna (method of moments) wire.js Every app64-bit -
Radiated power and directivity
Total radiated power, the strongest direction and the directivity.
P = Σ U sin θ Δθ Δφ; D = 4π U_max ÷ P
Wire antenna (method of moments) wire.js Every app64-bit -
Rotation about an axis
The rotation matrix for an angle about an axis.
R = cos θ I + sin θ [a]× + (1 − cos θ) a aᵀ
Rotations, transforms and small linear algebra (motion) math.js Every app64-bit -
Roll, pitch and yaw from a matrix
The three angles of a rotation matrix.
pitch = asin(−R₃₁); roll = atan2(R₃₂, R₃₃); yaw = atan2(R₂₁, R₁₁)
Rotations, transforms and small linear algebra (motion) math.js Every app64-bit -
Rotation vector from a matrix
Axis times angle of a rotation, used for orientation error.
θ = acos((tr R − 1) ÷ 2); v = θ ÷ (2 sin θ) × (R₃₂ − R₂₃, R₁₃ − R₃₁, R₂₁ − R₁₂)
Rotations, transforms and small linear algebra (motion) math.js Every app64-bit -
Rigid transforms
Product, inverse and application of a rotation with a translation.
A·B = (R_A R_B, p_A + R_A p_B); A⁻¹ = (R_Aᵀ, −R_Aᵀ p_A)
Rotations, transforms and small linear algebra (motion) math.js Every app64-bit -
Dense linear solve
Solves the small systems of inverse kinematics and linkages.
Gaussian elimination with partial pivoting
Rotations, transforms and small linear algebra (motion) math.js Every app64-bit -
Positive-definite test
Whether a symmetric matrix, such as a mass matrix, is positive definite.
Cholesky factorization succeeds
Rotations, transforms and small linear algebra (motion) math.js Every app64-bit -
Singular values
The singular values of a Jacobian, used to detect singular poses and to count degrees of freedom.
σᵢ = √(eigenvalues of J Jᵀ or Jᵀ J)
Rotations, transforms and small linear algebra (motion) math.js Every app64-bit -
Pose error
How far a link is from its target in position and orientation.
e = (p_target − p, rotation vector of R_target Rᵀ)
Inverse kinematics and joint trajectories ik.js Every app64-bit -
Inverse kinematics
The joint values that bring a link to a target position, orientation or both.
Δq = Jᵀ (J Jᵀ + λ² I)⁻¹ e
Inverse kinematics and joint trajectories ik.js Every app64-bit -
Planar two-link arm, closed form
Both elbow solutions of a two-link arm for a tip position.
cos q₂ = (x² + y² − l₁² − l₂²) ÷ (2 l₁ l₂); q₁ = atan2(y, x) − atan2(l₂ sin q₂, l₁ + l₂ cos q₂)
Inverse kinematics and joint trajectories ik.js Every app64-bit -
Trapezoidal velocity profile
Position, speed and acceleration of a rest-to-rest move with a speed and an acceleration limit.
t_a = v ÷ a; T = 2 t_a + (d − v² ÷ a) ÷ v; short move: t_a = √(d ÷ a), T = 2 t_a
Inverse kinematics and joint trajectories traj.js Every app64-bit -
Cubic profile
A move with zero speed at both ends.
q = q₀ + Δ (3τ² − 2τ³)
Inverse kinematics and joint trajectories traj.js Every app64-bit -
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 app64-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 app64-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 app64-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 app64-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 app64-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 app64-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 app64-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 app64-bit -
Solved pose
The position and angle of every body for the given driver values.
Planar linkages (closed loops) loops.js Every app64-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 app64-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 app64-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 app64-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 app64-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 app64-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 app64-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 app64-bit -
Head loss of a link
The loss of a pipe, fitting, pump or gas pipe as a function of flow.
Hazen–Williams: h = 10.67 L Q^1.852 ÷ (C^1.852 D^4.871); Darcy–Weisbach: h = (f L ÷ D + K) Q|Q| ÷ (2 g A²); pump: H = ω² h₀ − a Q²
Pipe, duct and gas networks fluid.js Every app64-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 app64-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 app64-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 app64-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 app64-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 app64-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 app64-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 app64-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.