-
Notifications
You must be signed in to change notification settings - Fork 1
/
basal.prices
86 lines (73 loc) · 3.67 KB
/
basal.prices
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# vim: filetype=ledger
# Basal calorie load varies over time.
define birth_date = [1990-01-01]
define birth_time = to_int(format_date(birth_date,"%s"))
# Imperial/metric conversions.
C 1 lb_basal_weight = 0.455 kg_basal_weight
C 1 in_basal_height = 2.540 cm_basal_height
# Five different Basal Metabolic Rate formulas are documented at
# https://bmi-calories.com/bmr-calculator.html
# This file uses the Mifflin / St. Jeor BMR formula:
# Men Kcal/day = (10 * weight in kg) + (6.25 * height in cm) - (5 * age in years) + 5
# Women Kcal/day = (10 * weight in kg) + (6.25 * height in cm) - (5 * age in years) - 161
P 2000-01-01 00:00:00 kg_basal_weight 10.000 cal
P 2000-01-01 00:00:00 cm_basal_height 6.250 cal
P 2000-01-01 00:00:00 male_body 5.000 cal
P 2000-01-01 00:00:00 female_body -161.000 cal
; TODO - Budget for a diet?
; TODO - Heartrate?
; Max heart rate = 220 - age
; Resting heart rate = measured
; Heart rate reserve = max - resting
;
; heart rate targets by purpose:
; Healthy heart/fitness is 50-60% of max
; weight management is 60-70% of max
; aerobic base building = 70-80% of max
; optimal conditioning = 80-90% of max
; elite athlete = 90-100% of max
; Automatic transaction for constant factors (sex, height); and
; factors that change regularly and predictably (age).
=expr( payee =~ /Metabolism/ && account =~ /Assets/ )
Espenses:Basal:Base 1.000 male_body
Assets:Fat -1.000 male_body
Espenses:Basal:Height 185.420 cm_basal_height
Assets:Fat -185.420 cm_basal_height
Espenses:Basal:Age (-5.000 cal * (to_int(format_date(d,"%s")) - birth_time) / 86400.00 / 365.25)
Assets:Fat (5.000 cal * (to_int(format_date(d,"%s")) - birth_time) / 86400.00 / 365.25)
; Sedentary metabolism burns 1.2 times the basic Mifflin / St. Jeor
; formula, according to http://www.bmrcalculator.org/
;
; Activity Level Description Formula
; Low You get little to no exercise Calories Burned a Day = BMR x 1.2
; Light You exercise lightly (1-3 days per week) Calories Burned a Day = BMR x 1.375
; Moderate You exercise moderately (3-5 days per week) Calories Burned a Day = BMR x 1.55
; High You exercise heavily (6-7 days per week) Calories Burned a Day = BMR x 1.725
; Very High You exercise very heavily (i.e. 2x per day, extra heavy workouts) Calories Burned a Day = BMR x 1.9
=expr( payee =~ /Sedentary/ && account =~ /Assets/ )
Espenses:Basal:Weight 0.2
Assets:Fat -0.2
Espenses:Sedentary:Base (0.2 * 1.000 male_body)
Assets:Fat (0.2 * -1.000 male_body)
Espenses:Sedentary:Height (0.2 * 185.420 cm_basal_height)
Assets:Fat (0.2 * -185.420 cm_basal_height)
Espenses:Sedentary:Age (0.2 * -5.000 cal * (to_int(format_date(d,"%s")) - birth_time) / 86400.00 / 365.25)
Assets:Fat (0.2 * 5.000 cal * (to_int(format_date(d,"%s")) - birth_time) / 86400.00 / 365.25)
;=expr( payee =~ /Lightly Active/ && account =~ /Assets/ )
; Espenses:Basal:Sedentary (a * -0.375)
; Assets:Fat (a * 0.375)
;
;; 3-5 days/week of moderate activity.
;=expr( payee =~ /Moderately Active/ && account =~ /Assets/ )
; Espenses:Basal:Sedentary (a * -0.550)
; Assets:Fat (a * 0.550)
;
;; 6-7 days/week of activity.
;=expr( payee =~ /Very Active/ && account =~ /Assets/ )
; Espenses:Basal:Sedentary (a * -0.725)
; Assets:Fat (a * 0.725)
;
;; 6-7 days/week of heavy activity.
;=expr( payee =~ /Extremely Active/ && account =~ /Assets/ )
; Espenses:Basal:Sedentary (a * -0.900)
; Assets:Fat (a * 0.900)