Skip to content

Gallery

This page is generated by running tools/gallery/main.cpp, which builds each formula below with the library's own operators and asks the library to render and evaluate it. Do not edit it by hand -- change the generator and regenerate instead; gallery.is-current fails CI when the two disagree.

Every formula and citation on this page is invented -- generic physics with fictional Example Standard citations, exactly as every test and example elsewhere in this repository is. See the home page.

Bulk density of a compacted specimen

m / V
\[ \frac{m}{V} \]
Symbol Description Unit
m specimen mass kg
V specimen volume m3
  • Reference: Example Standard 1:2020
  • Section: 4.2
  • Equation: (3)

Bulk density is the specimen's mass divided by its volume, both measured under standard conditions.

Circular cross-sectional area

pi * d^2 / 4
\[ \frac{\pi \cdot d^{2}}{4} \]
Symbol Description Unit
d specimen diameter mm
  • Reference: Example Standard 2:2020
  • Section: 5.1

The area of a circular cross-section computed from its diameter.

Maximum specimen diameter

require d <= 150 mm
\[ \text{require } d \leq 150 mm \]
Symbol Description Unit
d specimen diameter mm
  • Reference: Example Standard 6:2020
  • Section: 4.1

A specimen wider than the die diameter cannot be tested and is rejected outright.

Volumetric flow rate

V / t
\[ \frac{V}{t} \]
Symbol Description Unit
V volume discharged l
t elapsed time s
  • Reference: Example Standard 3:2020

Flow rate is the volume discharged divided by the time taken to discharge it.

Water/cement ratio

V_w / V_c
\[ \frac{V_w}{V_c} \]
Symbol Description Unit
V_w effective water content l
V_c cement content l
  • Reference: Example Standard 4:2020
  • Section: 6.3
  • Equation: (2)

Ratio of the effective water content to the cement content of a batch.

Compaction-adjusted bulk density

if rho_m < 1800 kg/m3 then rho_m * 11/10 else rho_m
\[ \begin{cases} rho_m \cdot 11/10 & \text{if } rho_m < 1800 kg/m3 \\ rho_m & \text{otherwise} \end{cases} \]
Symbol Description Unit
rho_m measured bulk density kg/m3
  • Reference: Example Standard 5:2020
  • Section: 4.5

A specimen compacted below the reference density is corrected upward by a fixed factor; one at or above it is reported as measured.

Size allowance by specimen diameter

lookup(d, 0 to under 100 mm gives 2 MPa, 100 to under 150 mm gives 1 MPa, 150 to under 200 mm gives 0 MPa)
\[ \operatorname{lookup}(d,\allowbreak \text{0 to under 100 mm gives 2 MPa},\allowbreak \text{100 to under 150 mm gives 1 MPa},\allowbreak \text{150 to under 200 mm gives 0 MPa}) \]
Symbol Description Unit
d specimen diameter mm
  • Reference: Example Standard 7:2020
  • Section: 8.2

The allowance deducted from a measured crushing strength, selected by the band the specimen's diameter falls in. A diameter in no band is not a value: the method defined no allowance there and this library reports that rather than inventing one.

Mould factor by specimen mould

lookup(key 7, key 3 gives 1, key 7 gives 19/20, key 11 gives 9/10)
\[ \operatorname{lookup}(\text{key 7},\allowbreak \text{key 3 gives 1},\allowbreak \text{key 7 gives 19/20},\allowbreak \text{key 11 gives 9/10}) \]
  • Reference: Example Standard 7:2020
  • Section: 8.3

A category key names a row directly. The key renders as its underlying value, not the enumerator's name, because a C++ enumerator has no name at run time -- a reader reconciling this against a published table carries the author's own enum class across.

Maturity factor by curing age

interpolate(t, at 24 h gives 3/5, at 72 h gives 17/20, at 168 h gives 1)
\[ \operatorname{interpolate}(t,\allowbreak \text{at 24 h gives 3/5},\allowbreak \text{at 72 h gives 17/20},\allowbreak \text{at 168 h gives 1}) \]
Symbol Description Unit
t curing age at test h
  • Reference: Example Standard 7:2020
  • Section: 8.4
  • Equation: (7)

A curve stated at three ages. A specimen tested between two of them gets the value those two rows imply at that age -- a number appearing in no row of the table. A specimen younger or older than the curve gets nothing at all: there is no extrapolation.

Size- and age-corrected crushing strength

(f - lookup(d, 0 to under 100 mm gives 2 MPa, 100 to under 150 mm gives 1 MPa, 150 to under 200 mm gives 0 MPa)) * lookup(key 7, key 3 gives 1, key 7 gives 19/20, key 11 gives 9/10) * interpolate(t, at 24 h gives 3/5, at 72 h gives 17/20, at 168 h gives 1)
\[ (f - \operatorname{lookup}(d,\allowbreak \text{0 to under 100 mm gives 2 MPa},\allowbreak \text{100 to under 150 mm gives 1 MPa},\allowbreak \text{150 to under 200 mm gives 0 MPa})) \cdot \operatorname{lookup}(\text{key 7},\allowbreak \text{key 3 gives 1},\allowbreak \text{key 7 gives 19/20},\allowbreak \text{key 11 gives 9/10}) \cdot \operatorname{interpolate}(t,\allowbreak \text{at 24 h gives 3/5},\allowbreak \text{at 72 h gives 17/20},\allowbreak \text{at 168 h gives 1}) \]
Symbol Description Unit
f measured crushing strength MPa
d specimen diameter mm
t curing age at test h
  • Reference: Example Standard 7:2020
  • Section: 8.5
  • Equation: (8)

The measured strength less its size allowance, scaled by the mould factor and by the maturity factor -- one banded, one exact and one interpolating table inside a single expression.

Worked evaluation: water/cement ratio

V_w = 180 l, V_c = 300 l:

V_w / V_c
with V_w = 180 l and V_c = 300 l: 3/5 = 0.6

Worked derivation: bulk density

m = 1200 kg, V = 0.5 m3, formula::explain() and formula::render_trace():

m / V
1. m = 1200 kg
2. V = 1/2 m3
3. #1 / #2 = 2400
4. #3 = 2400 [Bulk density of a compacted specimen, Example Standard 1:2020, 4.2, (3)]

Worked derivation: compaction-adjusted bulk density

rho_m = 1500 kg/m3 -- below the 1800 kg/m3 reference density, so the predicate holds and the correction factor is applied:

if rho_m < 1800 kg/m3 then rho_m * 11/10 else rho_m
1. rho_m = 1500 kg/m3
2. 1800 kg/m3
3. rho_m = 1500 kg/m3
4. 11/10
5. #3 * #4 = 1650
6. if #1 < #2 then #5 = 1650
7. #6 = 1650 [Compaction-adjusted bulk density, Example Standard 5:2020, 4.5]

Worked derivation: maximum specimen diameter, alongside the circular area it validates

d = 200 mm -- above the 150 mm tolerance, so the constraint is violated and its verdict appears in the trace, formula::check() and formula::render_trace():

require d <= 150 mm
pi * d^2 / 4
1. d = 200 mm
2. 150 mm
3. require #1 <= #2 [specimen exceeds diameter tolerance]

Worked derivation: size- and age-corrected crushing strength

f = 32 MPa, d = 120 mm, t = 48 h, mould key 7. Each table names the row it answered from: the banded one its interval, the interpolating one the two rows it drew on. The exact lookup adds nothing there -- its key is already the subject of its own line.

(f - lookup(d, 0 to under 100 mm gives 2 MPa, 100 to under 150 mm gives 1 MPa, 150 to under 200 mm gives 0 MPa)) * lookup(key 7, key 3 gives 1, key 7 gives 19/20, key 11 gives 9/10) * interpolate(t, at 24 h gives 3/5, at 72 h gives 17/20, at 168 h gives 1)
1. f = 32 MPa
2. d = 120 mm
3. lookup(#2) = 1 MPa [100 to under 150 mm]
4. #1 - #3 = 31000000
5. lookup(key 7) = 19/20
6. #4 * #5 = 29450000
7. t = 48 h
8. interpolate(#7) = 29/40 [between 24 and 72 h]
9. #6 * #8 = 21351250
10. #9 = 21351250 [Size- and age-corrected crushing strength, Example Standard 7:2020, 8.5, (8)]

Worked derivation: a lookup that found nothing

The same size-allowance table at d = 250 mm. The table's last band stops below 200 mm, so 250 mm falls in no band -- and a miss is not a value: not zero, not the nearest band, not the last one. The bracketed clause is what keeps the line from being read as a failure relayed up from somewhere below it.

lookup(d, 0 to under 100 mm gives 2 MPa, 100 to under 150 mm gives 1 MPa, 150 to under 200 mm gives 0 MPa)
1. d = 250 mm
2. lookup(#1) = argument outside the domain of the operation [in no band; the bands cover 0 to under 200 mm]
3. #2 = argument outside the domain of the operation [Size allowance by specimen diameter, Example Standard 7:2020, 8.2]