Skip to content

The maths behind every number

Fourteen KPIs with the same definition used by the app engine: formula, unit, reading, trap and reference range. No number appears without being recalculable by hand.

Canonical formulas from the domain manual. TGC uses weight in grams and degree-days (ΣT) — the convention that avoids the 10× error of the kilogram variant. Ranges marked as reference are calibratable estimates, not standards.

Standing biomass

kg
B = N × W / 1000

Total mass of live fish at an instant, per batch or unit. It is the basis for density, feed, stock value and harvest planning.

How to read it
Checked example: 120,000 fish at 1,250 g = 150,000 kg = 150 t. Always use the current count and the latest weight corrected for growth.
Common trap
Using the last sample weight without correcting growth since then; forgetting accumulated mortality.
Reference
No absolute range: it depends on species, system and phase. Compare against the batch plan.

Stocking density

kg/m³ · kg/m² · kg/ha
D_v = B / V · D_a = B / A · D_ind = N / V

How much biomass fits per volume, area or number of fish. Higher density increases output per cubic metre but worsens oxygen, ammonia, growth and welfare.

How to read it
150,000 kg in 12,000 m³ = 12.5 kg/m³. The same biomass in a 2,000 m² cage = 75 kg/m². Never compare kg/m³ in cages with kg/ha in ponds.
Common trap
Confusing instantaneous density with the cycle average; using the theoretical cylinder volume instead of the usable volume.
Reference
Calibratable estimates: tilapia in cages 50–150 kg/m³; ponds 5,000–15,000 kg/ha/cycle; shrimp 10–40 PL/m² (semi-intensive).

Average weight from sampling

g
W̄ = (1/n) Σ w_i · B̂ = N × W̄ / 1000

Mean of individual weights in a sample, extrapolated to the population. It is the number that connects field sampling to batch biomass.

How to read it
A sample of 10 fish totalling 12,330 g → W̄ = 1,233 g. With 120,000 fish, B̂ = 147,960 kg. The example itself shows a 1.4% difference from the batch biomass: sampling uncertainty exists and must be reported.
Common trap
Weighing only the fish that rise for feed; a small sample without a declared error; mixing tanks in the same average.
Reference
Sample size depends on CV: with CV 3.2% and a 2% target error, 11 fish are enough; with CV 15%, it would take 216.

FCR — feed conversion ratio

kg feed / kg gain
FCR = F / (B_f − B_i)

Kilos of feed consumed per kilo of biomass gained. It is the indicator that moves cost the most, because feed is the largest share of production cost.

How to read it
F = 143,000 kg and 90,000 kg gain → FCR = 1.589. Below 1.2 is excellent for carnivores; 1.2–1.8 is typical for tilapia; above 2.0 calls for investigation.
Common trap
Using estimated biomass without propagating error; ignoring mortality; measuring offered feed instead of consumed feed.
Reference
Tilapia: 1.24–1.50 in 2010 data (Embrapa CNPASA). Estimates: ponds 1.4–2.0; shrimp 1.2–1.8; tambaqui 1.5–2.2.

SGR — specific growth rate

%/day
SGR = 100 × (ln W_f − ln W_i) / d

Growth rate in percentage per day, comparable across phases and treatments. It is not linearly comparable across different temperatures.

How to read it
500 g to 1,250 g in 90 days → SGR = 1.018 %/day. The projection is valid for short windows and stable conditions.
Common trap
Taking a simple average of SGRs from different periods (the correct way is to recalculate from the logarithms of weights); comparing fish of very different sizes.
Reference
Estimates: tilapia 1.5–3.0 %/day (25–500 g) and 0.5–1.2 %/day above 700 g; tambaqui 1.0–2.5; shrimp 0.8–2.5.

TGC — thermal growth coefficient

dimensionless
TGC = 1000 × (W_f^(1/3) − W_i^(1/3)) / ΣT̄_d

Growth corrected by accumulated temperature: it allows comparing sites, seasons and different years. The cube root of weight grows roughly linearly with thermal sum.

How to read it
25 g to 412 g in 78 days at 26.8 °C (ΣT = 2,090.4 °C·day) → TGC = 2.16. The inverse projection returns 411.7 g: the maths closes.
Common trap
Using weight in kilograms (a 10× smaller result); dividing only by days; using today's temperature instead of the period's daily mean.
Reference
Engine seeds: tilapia 2.2; tambaqui 2.4; pintado and hybrids 1.6. Shrimp do not use TGC (stepwise growth through moults); salmon 2.9–3.2.

Degree-days (thermal sum)

°C·day
ΣT = Σ T̄_d

Sum of daily mean temperatures over the period. It feeds TGC, hatching forecasts and crop planning.

How to read it
A week with temperatures from 24 to 27 °C → ΣT = 178.5 °C·day, mean 25.5 °C. Without an hourly series, use the average of minimum and maximum and declare the uncertainty.
Common trap
Using a monthly mean instead of a daily one; not recording sensor failures (missing days distort the sum); adding different depths without criteria.
Reference
It has no range of its own: it is an input. The value depends on the cycle and the site's climate.

Cumulative mortality

%
M_cum = 100 × (N_i − N_f) / N_i

Percentage of fish lost since stocking. It feeds survival, biomass and the cost of the loss.

How to read it
120,000 fish and 2,478 dead → 2.065%. The equivalent daily rate is 1 − (1 − M_cum)^(1/d), never simple division by days.
Common trap
Counting carcasses only when an inspector is present (under-reporting); treating harvest as mortality; summing daily rates instead of compounding them.
Reference
Species estimates: tilapia 90–98% survival; tambaqui 85–95%; shrimp 50–85%.

Survival

%
S = 100 − M_cum

Percentage of fish alive relative to stocking. It complements mortality and feeds biomass and revenue calculations.

How to read it
97.935% survival with 120,000 fish means 117,522 alive. Use a count or a model, never a guess.
Common trap
Treating escapes as mortality (it is another event); using the initial population as the denominator when the interest is the population today.
Reference
See mortality: the ranges are the same, read from the complement.

CV — coefficient of variation of weight

%
CV = 100 × s / W̄ · s = √[ Σ(w_i − W̄)² / (n − 1) ]

Batch uniformity around the average weight. A uniform batch allows a single harvest; a heterogeneous one requires grading or splitting.

How to read it
A sample of 10 fish with mean 1,233 g and standard deviation 40.01 g → CV = 3.245%. Below 10% is uniform; 10–20% is normal; above 20% is heterogeneous.
Common trap
Using the population standard deviation (n) instead of the sample one (n−1); computing CV from a biased sample; comparing CVs of very different average weights.
Reference
Estimates: below 10% excellent; 10–20% typical; above 20% requires grading action.

Fulton condition factor (K)

dimensionless
K = 100,000 × W / L³ (W in g, L in mm)

Weight-length relationship that indicates robustness. A sudden drop in K signals loss of condition due to disease, hunger, stress or post-spawning.

How to read it
1,250 g and 418 mm → K = 1.712. The centimetre equivalent is 100 × W / L_cm³.
Common trap
Mixing total and standard length; comparing K across species or phases; using K as a welfare substitute.
Reference
Estimate: 1.0–1.9 depending on species and phase; a fat tilapia may exceed 2.0 and slender fish stay below 1.0.

Feeding rate

% of biomass/day
FR% = 100 × F_day / B · g/fish/day = 1000 × F_day / N

How much of the biomass is offered per day. It is the number the feeder uses in practice and it should fall as fish grow and as temperature changes.

How to read it
143,000 kg over 90 days → 1,588.9 kg/day; with 150,000 kg biomass, FR = 1.059%/day and 13.24 g per fish/day.
Common trap
Calculating on the initial biomass; not adjusting for temperature and oxygen; confusing offer rate with consumption rate.
Reference
The reference is the feeding table by weight class and temperature, compared with the deviation observed in the batch.

Cost per kg produced

cost/kg
C_kg = Total_cost / kg_produced

The producer's king KPI: everything else — FCR, mortality, density — is a lever on it. In Allfish, derived cost and posted cost add up within the same batch.

How to read it
Add derived and posted costs for the same batch and divide by kilos produced. Feed accounts for 57.17% of cost in the example.
Common trap
Dividing by stocked rather than sold kilos; not allocating indirect cost; mixing cycles; ignoring fish still in stock at the end of the period.
Reference
Depends on species, system and region; use the demo data as a relative reference, not a standard.

Projected margin

local currency
Margin = Projected_revenue − Total_cost

What the batch should return if harvest weight and price hold. It is the calculation that connects biology and the selling decision.

How to read it
Margin = projected revenue − total cost. In the example, margin is 20.17% of revenue.
Common trap
Using a volatile market price without stating the assumption; forgetting fish in stock and withdrawal periods; comparing margins of batches in different phases.
Reference
Margin varies with price and cost; keep the price assumption visible on screen.

Transparency is a product requirement

Every KPI in the app carries a window, a universe and provenance (manual, sensor, sample or model). The “show the maths” button opens formula, inputs and uncertainty.

  • Same formula in the domain manual and in the code, with numeric tests
  • Window and baseline stated in every variation (“vs. previous cycle”, “vs. target 1.5”)
  • Ranges marked as estimates when there is no primary source