-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlgorithmPrepNotes.txt
More file actions
60 lines (46 loc) · 2.5 KB
/
Copy pathAlgorithmPrepNotes.txt
File metadata and controls
60 lines (46 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Main Factors That Determine Daily Nutrient and Caloric Needs:
1. Age
2. Sex (Male/Female)
3. Weight
4. Height
5. Activity Level
6. Life Stage
- Pregnancy
- Lactation
7. Health Conditions
- cronic illnessess, deficiencies, etc.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Calories – Basal Metabolic Rate (BMR) + Activity Level:
- Use the Mifflin-St Jeor Equation (most common and accurate):
Step 1: Calculate BMR
- For Men: BMR = 10 × weight(kg) + 6.25 × height(cm) - 5 × age + 5
- For Women: BMR = 10 × weight(kg) + 6.25 × height(cm) - 5 × age - 161
Step 2: Adjust for Activity Level
Multiply BMR by an Activity Factor:
Activity Level Multiplier
Sedentary (little/no exercise) 1.2
Lightly active (light exercise 1–3 days/wk) 1.375
Moderately active (3–5 days/wk) 1.55
Very active (6–7 days/wk) 1.725
Extra active (hard training or physical job) 1.9
Total Calories = BMR × Activity Factor
Formula:
<If user input weight as kg - no change, if user input weight as lbs, need to do conversion to kg>
kg_conversion = weight_lbs * 0.45359237 (kg)
Total_Calories_Men = (10 × weight(kg) + 6.25 × height(cm) - 5 × age + 5) x Activity Level
Total_Calories_Women = (10 × weight(kg) + 6.25 × height(cm) - 5 × age - 161) x Activity Level
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Vitamins, Minerals, and Nutrients:
- The Recommended Daily Intake (RDI) or Daily Values (DV) for nutrients is based on:
1. Age
2. Sex
3. Life Stage (e.g., pregnancy/lactation)
Should store these as a lookup table in database with fileds like:
nutrient_name, age_range, sex, life_stage, recommended_amount, unit
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Calculating Percentage of Daily Intake:
Once you have:
- The total nutrient amount a person consumed (from the food),
- Their personalized daily recommended amount,
You calculate:
percentage = (consumed_amount / recommended_amount) × 100