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
-
Obstacle map
Which grid points a track or a via of another net may not use.
blocked when distance to copper < clearance + track width ÷ 2 + 0.25 × pitch
Board placement and routing route.js Every app64-bit -
Path search
The cheapest path on the grid from a pad to the copper already routed for its net.
step cost 1, diagonal 1.4142, against the layer's direction × 1.4, via 14 per layer
Board placement and routing route.js Every app64-bit -
Track points
The corner points of a routed track.
drop a point when |(b − a) × (c − b)| ≤ 1e-9
Board placement and routing route.js Every app64-bit -
Wrap into an integer type
A number brought into the range of SINT, INT, DINT and the other integer types.
v mod 2ⁿ, moved into the signed range
Controller standard functions and integer types std.js Every appExact -
On-delay timer
The elapsed time and output of a TON block.
ET = min(now − t₀, PT); Q = ET ≥ PT
Controller standard functions and integer types std.js Every app64-bit -
Up counter
The count and output of a CTU block.
CV ← CV + 1 on a rising edge while CV < 32767; Q = CV ≥ PV
Controller standard functions and integer types std.js Every appExact -
Round to nearest, ties to even
The rounding used when a real is converted to an integer.
nearest whole number; a tie goes to the even neighbor
Controller standard functions and integer types std.js Every appExact -
Arithmetic functions
ABS, SQRT, LN, LOG, EXP, the trigonometric functions, MIN, MAX, LIMIT, TRUNC, SHL and SHR.
SQRT, LN, LOG, EXP, SIN and the rest from Math; SHL: x × 2ⁿ; SHR: ⌊x ÷ 2ⁿ⌋; TRUNC toward zero
Controller standard functions and integer types std.js Every app64-bit -
Type conversions
REAL_TO_INT, INT_TO_REAL, BOOL_TO_INT, TIME_TO_REAL and the other A_TO_B functions.
to an integer type: round to nearest (ties to even), then wrap; to a real type: unchanged
Controller standard functions and integer types std.js Every app64-bit -
Probability of a basic event
The probability of an event from a fixed value, a failure rate and time, a test interval, or repair data.
failed by t: 1 − e^(−λt); tested every τ: 1 − (1 − e^(−λτ)) ÷ (λτ), or λτ ÷ 2 below 1e-9; repairable: MTTR ÷ (MTTF + MTTR)
Fault trees and reliability block diagrams logic.js Every app64-bit -
At least k of n events
The probability that k or more of a set of independent events occur.
the distribution of the count, built one event at a time, summed from k up
Fault trees and reliability block diagrams logic.js Every app64-bit -
AND, OR and voting gates
The probability of a gate from its inputs when no event is repeated.
AND: Π pᵢ; OR: 1 − Π (1 − pᵢ)
Fault trees and reliability block diagrams logic.js Every app64-bit -
Top event with repeated events
The probability of the top event when the same event appears in several places.
P = p_x × P(tree | x occurs) + (1 − p_x) × P(tree | x does not)
Fault trees and reliability block diagrams logic.js Every app64-bit -
Cut set probabilities and bounds
The probability of each minimal cut set and two bounds on the top event.
rare event: min(1, Σ P(cut set)); upper bound: 1 − Π (1 − P(cut set))
Fault trees and reliability block diagrams logic.js Every app64-bit -
Importance measures
How much each event matters to the top event.
Birnbaum = P(top | p = 1) − P(top | p = 0); Fussell–Vesely = (P − P₀) ÷ P; RAW = P₁ ÷ P; RRW = P ÷ P₀
Fault trees and reliability block diagrams logic.js Every app64-bit -
Reliability of a component
The chance a block still works at the mission time.
R = e^(−λt); Weibull: R = e^(−(t ÷ η)^β)
Fault trees and reliability block diagrams logic.js Every app64-bit -
Block diagram reliability
The reliability of series, parallel and k-of-n arrangements.
series = OR of failures; parallel = AND; reliability = 1 − P(failure)
Fault trees and reliability block diagrams logic.js Every app64-bit -
Mean time to failure
The mean life of a system that is not repaired.
MTTF = ∫ R(t) dt by Simpson's rule, 4000 steps, to the time R ≤ 1e-9
Fault trees and reliability block diagrams logic.js Every app64-bit -
Common-cause split
The independent and the shared part of a failure rate.
independent = λ (1 − β); common = λ β
Fault trees and reliability block diagrams logic.js Every app64-bit -
Gamma function
Γ(x), used for the mean life.
Lanczos approximation, g = 7, 9 coefficients; reflection below 0.5
Weibull life data weibull.js Every app64-bit -
Weibull distribution functions
Failure probability, reliability, density, hazard, quantile, mean and B-life.
F = 1 − e^(−(t ÷ η)^β); quantile = η (−ln(1 − F))^(1 ÷ β); mean = η Γ(1 + 1 ÷ β)
Weibull life data weibull.js Every app64-bit -
Log-likelihood
How well a shape and scale explain the failure and suspension times.
Σ failures ln f(t) + Σ suspended ln R(t)
Weibull life data weibull.js Every app64-bit -
Maximum-likelihood fit
Shape, scale and their confidence bounds from failure times, with suspensions.
g(β) = Σ tᵝ ln t ÷ Σ tᵝ − 1 ÷ β − mean ln t = 0; η = (Σ tᵝ ÷ r)^(1 ÷ β)
Weibull life data weibull.js Every app64-bit -
Median ranks
The plotting position of each failure, adjusted for suspended units.
F = (rank − 0.3) ÷ (n + 0.4); rank increment = (n + 1 − previous rank) ÷ (1 + units at or after this one)
Weibull life data weibull.js Every app64-bit -
Rank regression fit
Shape and scale from a straight line on the Weibull plot.
β = S_xy ÷ S_xx on (ln t, ln(−ln(1 − F))); η = e^(−a ÷ β)
Weibull life data weibull.js Every app64-bit -
Duration drawn for a task
One trial's duration of a task given as minimum, most likely and maximum.
u < f: min + √(u (max − min)(mode − min)); else max − √((1 − u)(max − min)(max − mode)); duration = round(v)
Schedule risk (Monte Carlo) simulate.js Every app64-bit -
Finish percentiles, mean and spread
The finish day at each confidence level over all trials.
P = sorted[⌈p × n⌉ − 1]; mean = Σ ÷ n; sd = √(Σ (x − mean)² ÷ n)
Schedule risk (Monte Carlo) simulate.js Every app64-bit -
Criticality and sensitivity
The share of trials in which a task was critical, and the correlation of its duration with the finish.
criticality = times critical ÷ n; sensitivity = Σ (d − d̄)(F − F̄) ÷ √(Σ (d − d̄)² × n × sd²)
Schedule risk (Monte Carlo) simulate.js Every app64-bit -
Source signals
Step, ramp, sine and pulse sources as functions of time.
sine: offset + amp × sin(2π f t + phase); ramp: v₀ + (v₁ − v₀)(t − t₀) ÷ (t₁ − t₀)
Lumped system models model.js Every app64-bit -
Resistive element laws
The flow through a resistor, damper, orifice, diode or user law for a given difference across it.
resistor: i = v ÷ R; orifice: i = v ÷ √(K √(v² + ε²)); diode: i = Is (e^(v ÷ nVt) − 1), a straight line above 40 nVt
Lumped system models model.js Every app64-bit -
Storage elements
Capacitors, masses, tanks, inductors and springs: what they store and how it enters the equations.
capacitive: i + d(C v)/dt = 0; inductive: v + d(L i)/dt = 0; spring: L = 1 ÷ k
Lumped system models model.js Every app64-bit -
Reported flow through an element
The current, heat flow, flow or force reported for an element.
the element's law at the solved state; diode: Is (e^(min(v, 40 nVt) ÷ nVt) − 1)
Lumped system models model.js Every app64-bit -
Dense linear solve
Solves the Newton step.
Gaussian elimination with partial pivoting
Lumped system models solve.js Every app64-bit -
Newton iteration
Finds the state that satisfies the equations at one time.
J_ij = (F_i(x + h e_j) − F_i(x − h e_j)) ÷ 2h, h = 1e-7 × max(|x_j|, 1); stop when |Δxᵢ| ≤ rtol |xᵢ| + atol + 1e-11 × max(1, largest |x|)
Lumped system models solve.js Every app64-bit -
Operating point
The steady state, or the state set by the given initial values.
one Newton solve from zero
Lumped system models solve.js Every app64-bit -
One time step
The state one step later.
trapezoid: (2 ÷ h)(S − S₀) − Ṡ₀ + g = 0; backward Euler: (1 ÷ h)(S − S₀) + g = 0
Lumped system models solve.js Every app64-bit -
Step-size control
Chooses the time step from an estimate of the error, when adaptive stepping is on.
err = max |x(two half steps) − x(one step)| ÷ (rtol |x| + atol), ÷ 3 for the trapezoid; h ← h × clamp(0.9 err^(−1/3), 0.2, 5)
Lumped system models solve.js Every app64-bit -
Value between stored times
A node value at a time between two computed points.
y = y₀ + (y₁ − y₀)(t − t₀) ÷ (t₁ − t₀)
Lumped system models solve.js Every app64-bit -
Parameter expressions
The value of a parameter written as an expression, such as 2*3.3e3.
numbers, parameters, + − × ÷ ^, brackets, pi
Lumped system models modelica.js Every app64-bit -
Thermal conductance to resistance
A thermal conductor from a model file as the engine's thermal resistance.
R = 1 ÷ G
Lumped system models modelica.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.