Zyra › Methodology
Methodology
Every number on this site is produced by the same open, tested math package that the Zyra apps use — documented here formula by formula, with worked examples computed live from that code at build time, so any figure can be checked by hand. Training and nutrition education only; never medical advice.
Energy & macro math
The macro, calorie, deficit and protein calculators run the MacroDiet onboarding algorithm (version 2), verbatim. It works in four steps: resting energy, a daily total, a goal-adjusted target with guard-rails, then macros in a fixed order — protein first, fat second, carbohydrate as the remainder.
Step 1 — BMR (Mifflin-St Jeor)
- BMR = 10 × kg + 6.25 × cm − 5 × age + 5— men
- BMR = 10 × kg + 6.25 × cm − 5 × age − 161— women
Step 2 — TDEE
- multiplier = EXERCISE_BASE[sessions per week] + NEAT_ADJUSTMENT[daily activity]
- TDEE = round(BMR × multiplier)— rounded to the kcal
| Sessions / week | Base | Daily activity (NEAT) | Adjustment |
|---|---|---|---|
| 0 | 1.2 | sedentary | -0.05 |
| 1–3 | 1.375 | moderate | 0 |
| 4–6 | 1.55 | very active | +0.1 |
| 7+ | 1.725 |
Step 3 — the goal target and its guard-rails
- target = TDEE— maintain
- weekly kg = kg × RATE_PCT[rate]— lose / gain
- daily delta = weekly kg × 7,700 ÷ 7
- delta = min(delta, TDEE × 0.35)— the 35% cap
- target = max(round(TDEE − delta), floor[sex])— lose only
| Rate | % body weight / week | Floor mode | Men | Women |
|---|---|---|---|---|
| conservative | 0.3% | standard | 1,500 | 1,200 |
| moderate | 0.5% | lower | 1,200 | 1,000 |
| aggressive | 0.75% |
When the cap or the floor changes the number, the calculator says so (the algorithm emits DELTA_CAPPED and CALORIE_FLOOR_APPLIED). The gain branch has the same rate math and the same cap, and no floor.
Step 4 — macros, in order
- protein g = round(kg × PROTEIN_G_PER_KG[tier])— +0.2 g/kg when losing; capped at 50% of kcal; warns above 3 g/kg
- remaining = target − protein × 4
- fat g = round(remaining × FAT_PCT_OF_REMAINING[style] ÷ 9)— then raised to the fat floor if below it
- fat floor = max(round(kg × 0.6), round(target × 0.2 ÷ 9))
- carbs g = round((target − protein × 4 − fat × 9) ÷ 4)
- keto: carbs = 30 g; fat g = round((target − protein × 4 − 30 × 4) ÷ 9)— keto: carbs fixed, fat is the remainder
| Protein tier | g / kg | Diet style | Fat, % of remaining |
|---|---|---|---|
| low | 1.2 | balanced | 35% |
| moderate | 1.6 | low-fat | 20% |
| high | 2.0 | low-carb | 50% |
| extra high | 2.4 | keto | remainder |
Worked example — 85 kg · 180 cm · 30 y · male · 4–6 sessions · NEAT moderate
| BMR = 10 × 85 + 6.25 × 180 − 5 × 30 + 5 | 1,830 kcal |
| multiplier = 1.55 + 0 | 1.55 |
| TDEE = round(1,830 × 1.55) | 2,837 kcal |
| Goal lose, moderate rate: weekly kg = 85 × 0.005 | 0.43 kg |
| daily delta = 0.43 × 7,700 ÷ 7 | 467.5 kcal |
| target = round(2,837 − 467.5) — above the 1,500 floor | 2,370 kcal |
| protein = round(85 × 1.8) (moderate tier + 0.2 for losing) | 153 g |
| remaining = 2,370 − 153 × 4 | 1,758 kcal |
| fat = round(1,758 × 0.35 ÷ 9); floor was 53 g | 68 g |
| carbs = round((2,370 − 153 × 4 − 68 × 9) ÷ 4) | 287 g |
In plain terms: the calculator does not know how many calories you use — it estimates a typical person of your size and schedule, then applies fixed rules to that estimate. The MacroDiet app replaces the estimate with a number derived from your own logs over time; the calculators on this site never do.
Training math
Estimated one-rep max
- e1RM = w × 36 ÷ (37 − r)— Brzycki, reps ≤ 12
- e1RM = w × (1 + r ÷ 30)— Epley, reps > 12
- % of 1RM at r reps = (37 − r) ÷ 36 (r ≤ 12), else 1 ÷ (1 + r ÷ 30)— the inverse, for rep-max tables and load charts
Worked example — 100 kg for 5 reps
| e1RM = 100 × 36 ÷ (37 − 5) | 112.5 kg |
| for comparison, 100 kg × 13 reps (Epley) = 100 × (1 + 13 ÷ 30) | 143.3 kg |
| 1RM at 100% of 112.5 | 112.5 kg |
| 3RM at 94.4% of 112.5 | 106.3 kg |
| 5RM at 88.9% of 112.5 | 100 kg |
| 8RM at 80.6% of 112.5 | 90.6 kg |
| 10RM at 75% of 112.5 | 84.4 kg |
| 12RM at 69.4% of 112.5 | 78.1 kg |
The switch at 12 reps is the Zyra Workouts rule: Brzycki is undefined at 37 reps and steepens well before it, so higher-rep sets use Epley. Both are estimates, and the estimate gets less reliable the further a set is from a single rep. Warm-up sets are excluded from the app's e1RM. Try it on the 1RM calculator.
RIR and RPE
- RIR = 10 − clamp(round(RPE), 6, 10)— RPE clamped to 6–10 first
- RPE = 10 − clamp(round(RIR), 0, 4)— RIR clamped to 0–4 first
So RPE 8 → RIR 2, and RIR 5 → RPE 6 (the clamp). The scale is deliberately coarse: it is a logging convention, not a measurement.
Plate math
- per side = (total − bar) ÷ 2
- plates = greedy(per side, inventory sorted descending)— greedy: largest available plate first, repeat while it fits
- remainder = per side − Σ plates— a non-zero remainder means the weight cannot be loaded exactly
Default inventory: 20 kg bar with 20 / 15 / 10 / 5 / 2.5 / 1.25 kg plates. 110 kg → (2×20 + 1×5) × 2 + 20 kg bar = 110 kg. 101 kg with the same plates → closest loadable 100 kg, remainder 0.5 kg per side, so the plate calculator says it cannot be loaded exactly.
Progression — the ceiling rule
- ceiling = round((repMin + repMax) ÷ 2) + RIR— failure sets (RIR 0): ceiling = repMax
- last reps > ceiling → weight + step, reps = repMin— progress
- last reps < repMin → weight − step, reps = repMin— back off
- otherwise → same weight, same reps— hold
- barbell = 2 × smallest plate (2.5 kg by default) · dumbbell / machine / cable = 2 kg · bodyweight = 0 (reps progress instead)— load step by equipment
Worked example — target 6–10 @RIR 2 on a barbell (step 2.5 kg)
| ceiling = round((6 + 10) ÷ 2) + 2 | 10 reps |
| last time 100 kg × 11 → above the ceiling | 102.5 kg × 6 (progress) |
| last time 100 kg × 8 → inside the range | 100 kg × 8 (hold) |
| last time 100 kg × 5 → under the floor | 97.5 kg × 6 (backoff) |
Rep targets, sets and cycles
| Goal | Compound | Isolation | Sets (compound / isolation) |
|---|---|---|---|
| strength | 3–5 @RIR 2 | 6–8 @RIR 2 | 4 / 3 |
| hypertrophy | 6–10 @RIR 2 | 10–15 @RIR 1 | 3 / 3 |
| general | 8–12 @RIR 2 | 8–12 @RIR 2 | 3 / 3 |
Beginners get one set fewer, advanced lifters one more on compounds, never below 2. A generated program has 6 cycles; the RIR target ramps from base + 1 in the first cycle down to base − 1 (never below 0) in the last, and an optional deload cycle takes one set off and adds 2 RIR. Exercises per session = clamp(round(minutes ÷ 12), 3, 8) — 60 minutes → 5, 30 → 3, 90 → 8.
Weekly volume, landmarks and the balance score
- sets[muscle] = Σ working sets where primary + 0.5 × Σ working sets where secondary
- coverage[muscle] = min(sets ÷ landmark, 1)
- balance = round(100 × clamp(1 − CV, 0, 1))— CV = standard deviation ÷ mean of the 11 coverages
| Muscle group | Landmark sets / week | Example week | Coverage |
|---|---|---|---|
| Chest | 12 | 12 | 100% |
| Shoulders | 14 | 6 | 43% |
| Triceps | 10 | 6 | 60% |
| Back | 14 | 21 | 100% |
| Biceps | 10 | 6 | 60% |
| Forearms | 6 | 10.5 | 100% |
| Quads | 14 | 12 | 86% |
| Hamstrings | 10 | 10.5 | 100% |
| Glutes | 10 | 10.5 | 100% |
| Calves | 10 | 0 | 0% |
| Core | 10 | 6 | 60% |
Example week: three sessions of bench press 4, bent-over row 4, back squat 4 and Romanian deadlift 3 working sets. Back reads 21: the rows (12) plus the barbell Romanian deadlift (9), which the catalog files under back as its primary muscle; hamstrings read 10.5 from secondary credit alone (squat 12 × 0.5 + RDL 9 × 0.5). Balance score for that week: 58 — the muscles it never touches pull the score down. The landmarks are the app's defaults for its coverage bars, not a prescription. See the weekly sets calculator.
Trend weight
- α = 1 − exp(−ln 2 ÷ 7) ≈ 0.09— half-life 7 days
- trend[today] = α × weight[today] + (1 − α) × trend[yesterday]
The first reading seeds the trend. Any single weigh-in moves the trend by under a tenth of its distance, and its influence halves every 7 days — which is why one unusual morning barely registers.
Sources
Two kinds of source stand behind the site. Product facts and formulas come from the apps' own code, copied into an open math package with the source file and commit recorded at the top of each module. Claims about how the body or nutrition works come from published references that a writer has opened — those are listed, deduplicated, in the research library.
| What | Where it comes from | Scope |
|---|---|---|
| Exercise catalog | Zyra Workouts src/data/exercises.json @ fe2e0b3, byte-identical copy | 61 exercises (15 barbell, 18 dumbbell, 9 cable, 10 bodyweight, 9 machine); 49 with 1RM and load-chart pages; 61 in the package |
| Rep targets, set counts, program generator | Zyra Workouts features/program/{targets,generate}.ts @ fe2e0b3 | Exercise pages, program pages, the generator |
| Progression rule and load steps | Zyra Workouts features/progression/engine.ts @ fe2e0b3 | "How progression steps" on every exercise page |
| Weekly-set landmarks, coverage, balance | Zyra Workouts features/dashboard/compute.ts @ fe2e0b3 | 11 muscle groups; weekly sets calculator |
| e1RM, RIR ↔ RPE, plate math, trend-weight EMA | Zyra Workouts src/lib/{e1rm,rir,plates,ema}.ts @ fe2e0b3 | 1RM, plate and RIR calculators; load charts |
| Energy and macro algorithm | MacroDiet zyra-algo v2 @ 28614a5 — the same code the MacroDiet backend runs | Macro, calorie, deficit and protein calculators |
| Published reference values and trials | Verified research library, built from article references | 38 deduplicated sources |
Warm-up ramps are the one place the app's design leaves percentages unspecified. The warm-up set builder therefore exposes the percentages as inputs rather than inventing defaults, and only fixes the mechanics — the exercise-type mapping and rounding each step to a loadable weight.
What the numbers are not
- Not a measurement of you. BMR and TDEE come from a population regression fitted to other people. For any one person the miss is routinely a few hundred kcal a day — as a rule of thumb, around 100–200 kcal for a typical individual and 400–500 or more for some. That is a property of every predictive equation, not a flaw in one. The estimate is a starting point to be checked against two or three weeks of logged intake and trend weight.
- Not a prescription. The targets, rates, floors and caps describe what the algorithm outputs for an input, so the number can be understood and reproduced. They are not instructions about what any person should eat or lift.
- Not a physiological law. 7,700 kcal per kg, the 35% cap, the calorie floors and the weekly-set landmarks are planning constants and app defaults. They are chosen to be sensible and stated so they can be questioned.
- Not medical. Nothing here is a diagnosis, a treatment, or advice about a health condition. The site does not offer medical, dietetic or injury guidance of any kind, and does not name or recommend supplements or drugs. Questions about health go to a qualified professional; questions about training go to a coach.
- Not the app. The calculators here are static: they never learn from your data. MacroDiet's expenditure and Zyra Workouts' progression suggestions use your own logs, which is why the same formula can give a different, better number inside the app.
Corrections policy
Every article carries an Updated date, and every formula on this page is executed from the same code that produces the calculators, so a change in the math changes the documentation with it. When a better source changes a stated value, the page updates and the change is recorded in the article — never silently. A citation that turns out not to say what we cited is removed and the sentence rebuilt from first principles, with the evidence label downgraded to match.
Found an error — a number that does not reproduce, a reference that does not resolve, a claim that goes further than its source? Write to privacy@zyra.fit. Corrections are credited with the reporter's consent.
Who builds this
The Zyra team — the people building Zyra Workouts, an offline-first iOS workout logger that is in development and not yet on the App Store, and MacroDiet, a macro and calorie tracking web app that is live and evolving. The math package behind this site is extracted from those two codebases, so the pages and the apps cannot disagree about a formula. Articles are written against the primary sources and reviewed for training-guidance framing by the team; no piece carries a medical reviewer's byline, and none claims to.
Zyra is a training and nutrition tracking tool. Nothing on this page is medical advice, a diagnosis, or an individual prescription. The numbers are estimates from published formulas and the apps' own rules — consult a qualified professional for decisions about your health, and a coach for your training.