RUFAS.biophysical.animal.ration.animal_requirements module#
- class RUFAS.biophysical.animal.ration.animal_requirements.AnimalRequirements#
Bases:
object
Stores the information for the calculated requirements of animals to be used in the ration formulation.
- __init__() None #
Initializes a requirements object with default values of specific requirements at 0.
Notes#
NEmaint_requirement = Net energy for maintenance requirement (Mcal)
NEa_requirement = Net energy for activity requirement (Mcal)
NEg_requirement = Net energy for growth requirement (Mcal)
NEpreg_requirement = Net energy requirement for pregnancy (Mcal)
NEl_requirement = Net energy requirement for lactation (Mcal)
MP_requirement = Metabolizable protein requirement for growth (g)
Ca_requirement = Calcium requirement (g)
P_requirement = Phosphorus requirement (g)
DMIest_requirement = dry matter intake estimation (kg)
avg_BW = average body weight in pen (kg)
avg_milk = average milk production per animal (kg/day)
avg_CP_milk = average crude protein content of milk (%)
- calc_pen_requirements(NEmaint_requirement_list: List[float], NEa_requirement_list: List[float], NEg_requirement_list: List[float], NEpreg_requirement_list: List[float], NEl_requirement_list: List[float], MP_requirement_list: List[float], Ca_requirement_list: List[float], P_requirement_list: List[float], P_requirement_process_list: List[float], DMIest_requirement_list: List[float], BW: List[float], milk: List[float], CP_milk: List[float], milk_production_reduction: List[float], essential_amino_acid_requirement_list: List[EssentialAminoAcidRequirements], calc_method: str = 'mean') None #
This functions sets the average (or median or #th percentile) pen requirements. Each input parameter is a list of floats generated in ration_driver.set_requirements
Parameters#
- NEmaint_requirement_list: List[float]
List of net energy for maintenance requirement (Mcal) for all animals in pen
- NEa_requirement_list: List[float]
List of Net energy for activity requirement (Mcal) for all animals in pen
- NEg_requirement_list: List[float]
List of Net energy for growth requirement (Mcal) for all animals in pen
- NEpreg_requirement_list: List[float]
List of Net energy requirement for pregnancy (Mcal) for all animals in pen
- NEl_requirement_list: List[float]
List of Net energy requirement for lactation (Mcal) for all animals in pen
- MP_requirement_list: List[float]
List of Metabolizable protein requirement for growth (g) for all animals in pen
- Ca_requirement_list: List[float]
List of Calcium requirement (g) for all animals in pen
- P_requirement_list: List[float]
List of Phosphorus requirement (g) for all animals in pen, as calculated using NASEM or NRC equations
- P_requirement_process_list: List[float]
List of Phosphorus requirement (g) for all animals in pen, as calculated in phosphorus_rqmts
- DMIest_requirement_list: List[float]
List of dry matter intake estimation (kg) for all animals in pen
- BW: List[float]
List of body weight (kg) for all animals in the pen for all animals in pen
- milk: List[float]
List of milk production of the animals in the pen (kg)
- CP_milk: List[float]
List of milk crude protein content of the animals in the pen (%)
- milk_production_reduction: List[float]
list of milk_production_reduction values for all animals in the pen (kg)
- calc_method: str
The summary statistic to be used (e.g. mean, median, etc)
- essential_amino_acid_requirement_list: List[EssentialAminoAcidRequirements]
List of essential amino acid requirements (g).
- set_requirements(pen, animal_grouping_scenario, recalc: bool) None #
Calculates the average requirements utilizing cow_requirements.py and an input pen to generate the average requirements across a pen. It then populates the corresponding class variables.
Parameters#
- penPen
Instance of an object of class Pen
- animal_grouping_scenarioAnimalGroupingScenario
a grouping scenario fixed for current simulation, specified in AnimalManager
- recalcboolean
True if requirements need to be recalculated since grouping
- recalculate_requirements(pen, animal_grouping_scenario, requirements_lists: Dict[str, List[float | EssentialAminoAcidRequirements]]) Dict[str, List[float | EssentialAminoAcidRequirements]] #
- Calculates requirements for every animal in a pen and appends each value to a list in a dictionary
of requirements.
Parameters#
- penPen
Instance of an object of class Pen
- animal_grouping_scenarioAnimalGroupingScenario
the valid animal combinations inside the pen, an instance of the AnimalCombination Enum
- requirements_listsDict[str, List[float]]
Dictionary of requirements for each animal
Returns#
- requirements_listDict[str, List[float]]
Dictionary of lists of animal requirements for all animals
- use_existing_requirements(pen, animal_grouping_scenario, requirements_lists: Dict[str, List[float | EssentialAminoAcidRequirements]]) Dict[str, List[float | EssentialAminoAcidRequirements]] #
- Finds previous set of requirements for every animal in a pen and appends each value to a list in a dictionary
of requirements.
In the case of net energy for activity, this must be recalculated for lactating animals.
Parameters#
- penPen
Instance of an object of class Pen
- animal_grouping_scenarioAnimalGroupingScenario
the valid animal combinations inside the pen, an instance of the AnimalCombination Enum
- requirements_listsDict[str, List[float]]
Dictionary of requirements for each animal
Returns#
- requirements_listDict[str, List[float]]
Dictionary of lists of animal requirements for all animals in pen
- calc_rqmts(body_weight: float, mature_body_weight: float, day_of_pregnancy: int, animal_type: AnimalType, parity: int | None = 0, calving_interval: int | None = None, milk_true_protein: float | None = 0.0, milk_fat: float | None = 0.0, milk_lactose: float | None = 0.0, milk_production: float | None = 0.0, days_in_milk: int | None = None, lactating: bool | None = False, body_condition_score_5: int | None = 3, previous_temperature: float | None = None, average_daily_gain_heifer: float | None = None, NDF_conc: float | None = 0.3, TDN_conc: float | None = 0.7, net_energy_diet_concentration: float | None = 1.0, days_born: float | None = None) Dict[str, float | EssentialAminoAcidRequirements] #
Calculates the dietary requirements of a single animal.
The energy requirements calculated according to NRC (2001) or NASEM (2021) are values that are used to generate the constraints or RHS of the nonlinear program for diet optimization. Each calculation has a reference to the respective calculation in the pseudocode (both Cow and Heifer). (Note that arguments that are only for a single animal class are instantiated at None however the respective parameters must be set when calling said animal class) Parameters ———- body_weight: float
Body weight (kg)
- mature_body_weight: float
Mature body weight(kg)
- animal_type: AnimalType
A type or subtype of animal specified in AnimalType enum
- day_of_pregnancy: str, optional
Day of pregnancy (d) (except Heifer Is)
# parameters for just cow requirements) parity: int, optional
Number of parity
- calving_interval: int, optional
Calving interval (d)
- milk_true_protein: float, optional
Milk true protein content (% of milk)
- milk_fat: float, optional
Milk fat content (% of milk)
- milk_lactose: float, optional
Milk lactose content (% of milk)
- milk_production: float, optional
Milk production (kg)
- days_in_milk: int, optional
Days in milk
- lactating: bool, optional
Boolean value which is true for lactating cows and false for dry cows
# parameters for just heifer requirements body_condition_score_5: int, optional
Body Condition Score (1-5 basis)
- previous_temperature: float, optional
Average daily temperature of last month, °C
- average_daily_gain_heifer: float, optional
Average daily gain of a heifer
- NDF_conc:
Concentration (percent value) of Neutral Detergent Fiber in previously fed ration.
- TDN_conc:
Concentration (percent value) of Total Digestible Nutrients in previously fed ration.
- net_energy_diet_concentrationfloat
Metabolizable energy density of formulated ration
- days_bornfloat
number of days since birth
Returns#
- Dict[str, float]
dictionary of requirement values, see individual functions for each key value pair
- calculate_NRC_energy_maintenance_requirements(body_weight: float, mature_body_weight: float, day_of_pregnancy: int | None, body_condition_score_5: int, previous_temperature: float | None, animal_type: AnimalType) tuple[float, float, float] #
Calculates energy requirement for maintenance, conceptus weight, and calf birth weight
Calculates the estimated energy requirements for maintenance in megacalories per day, as well as conceptus weight (kg) and calf birth weight (kg), according to NRC (2001).
Parameters#
- body_weightfloat
Body weight (kg)
- mature_body_weightfloat
Mature body weight (kg)
- day_of_pregnancyint
Day of pregnancy (days)
- body_condition_score_5int
Body condition score (score from 1 to 5)
- previous_temperaturefloat
Adjustment for previous temperature
- animal_typeAnimalType
A type or subtype of animal specified in the AnimalType enum
Returns#
- net_energy_maintenancefloat
Net energy requirement for maintenance (mcal/day)
- conceptus_weightfloat
Conceptus weight (kg)
- calf_birth_weightfloat
Calf birth weight (kg)
Notes#
Energy requirements for activity are not included within calculations for maintenance.
References#
Chapter 2 “Energy”,pp. 18-25, 2001.
- calculate_NASEM_energy_maintenance_requirements(body_weight: float, mature_body_weight: float, day_of_pregnancy: int | None, days_in_milk: int | None) tuple[float, float, float] #
Calculates energy requirement for maintenance and two measures of uterine weight
The estimated energy requirements for maintenance are calculated in megacalories per day, as well as gravid uterine weight and uterine weight in kg, according to NASEM (2021).
Parameters#
- body_weightfloat
Body weight (kg)
- mature_body_weightfloat
Mature body weight (kg)
- day_of_pregnancyint
Day of pregnancy (days)
- days_in_milkint
Days in milk (lactation)
Returns#
- net_energy_maintenancefloat
Net energy requirement for maintenance (mcal/day)
- gravid_uterine_weightfloat
Gravid uterine weight (kg))
- uterine_weightfloat
Uterine weight (kg))
Notes#
# NASEM (2021) does not adjust energy requirements for environmental temperature as it assumes # that confinement conditions already provide comfort temperature to the animals. # This is something to consider and update for the grazing module # Instead of calculating calf_birth_weight, NASEM (2021) also contains standards calf_birth_weight and # mature_body_weight (tabulated values) for selected breeds (eg., Holstein) # Instead of estimating conceptus_weight, gain in pregnancy tissues is estimated: # (gravid_uterine_weight and uterine_weight). # day_of_pregnancy (Day of pregnancy) was kept instead of DGest (Day ofgestation) as it is in NASEM (2021) book.
References#
[1] The National Academies of Sciences, Engineering, and Medicine “Nutrient Requirements of Dairy Cattle, 8th edition.” National Academic Press, Chapter 3 “Energy”, pp. 29, 2021.
- calculate_NRC_energy_growth_requirements(body_weight: float, mature_body_weight: float, conceptus_weight: float, animal_type: AnimalType, parity: int, calving_interval: int | None, average_daily_gain_heifer: float | None) tuple[float, float, float] #
Calculates energy requirement for growth and associated weight gain parameters.
The estimated energy requirements for growth in megacalories per day, and average daily gain and estimate of shrunk body weight, in kilograms are calculated according to NRC (2001).
Parameters#
- body_weightfloat
Body weight (kg)
- mature_body_weightfloat
Mature body weight (kg)
- conceptus_weightfloat
Conceptus weight (kg)
- animal_typeAnimalType
A type or subtype of animal specified in AnimalType enum
- parityint
Parity number (lactation 1, 2.. n)
- calving_intervalint
Calving interval (days)
- average_daily_gain_heiferfloat
Average daily gain (grams per day)
Returns#
- net_energy_growthfloat
Net energy requirement for growth (Mcal/d)
- average_daily_gainfloat
Average daily gain (grams per day)
- equivalent_shrunk_body_weightfloat
Equivalent shrunk body weight (kilograms)
References#
[1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press,
Chapter 11 “Growth”, pp. 234-243, 2001.
- calculate_NASEM_energy_growth_requirements(body_weight: float, mature_body_weight: float, average_daily_gain_heifer: float | None, animal_type: AnimalType, parity: int, calving_interval: int | None) tuple[float, float, float] #
Calculates energy requirement for growth, and also growth metrics
Calculates the estimated energy requirements requirements for growth in megacalories per day, and associated growth metrics, according to NASEM (2021).
Parameters#
- body_weightfloat
Body weight (kilograms)
- mature_body_weightfloat
Mature body weight (kilograms)
- average_daily_gain_heiferfloat
Average daily gain (grams per day)
- animal_typeAnimalType
A type or subtype of animal specified in AnimalType enum
- parityint
Parity number (lactation 1, 2.. n)
- calving_intervalint
Calving interval (days)
Returns#
- net_energy_growthfloat
Net energy requirement for frame growth (Mcal/d)
- average_daily_gainfloat
Average daily gain (grams per day)
- frame_weight_gainfloat
Frame weight gain refers to the accretion of both fat and protein in carcass (grams per day)
Notes#
# In NASEM (2021), body frame gain (fat + protein) corresponds to the true growth and it is part # of the calculation which is further partitioned to body reserves or condition gain (or loss), # and pregnancy-associated gain (considered a pregnancy requirement).
References#
[1] The National Academies of Sciences, Engineering, and Medicine “Nutrient Requirements of Dairy Cattle, 8th edition.” National Academic Press, Chapter 3 “Energy”, pp. 32-35, 2021.
- calculate_NRC_energy_pregnancy_requirements(day_of_pregnancy: int | None, calf_birth_weight: float) float #
Calculates energy requirement for pregnancy according to NRC (2001).
Calculates the estimated energy requirements for pregnancy in megacalories per day
Parameters#
- day_of_pregnancyint
Day of pregnancy (days)
- calf_birth_weightfloat
Calf birth weight (kilograms)
Returns#
- net_energy_pregnancyfloat
Net energy requirement for pregnancy (Mcal/d)
Notes#
# day_of_pregnancy are counted from 190 day_of_pregnancy once pregnancy is confirmed. Otherwise, this nutritional requirement is assumed to be zero.
References#
[1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press, Chapter 2 “Energy”, pp. 21-22, 2001.
- calculate_NASEM_energy_pregnancy_requirements(lactating: bool, day_of_pregnancy: int | None, days_in_milk: int | None, gravid_uterine_weight: float, uterine_weight: float) tuple[float, float] #
Calculates energy requirement for pregnancy and gravid uterine weight gain
Calculates the estimated energy requirements requirements for pregnancy in megacalories per day, according to NASEM (2021).
Parameters#
- lactatingbool
Physiological condition
- day_of_pregnancyint
Day of pregnancy
- days_in_milkint
Days in milk (lactation, days)
- gravid_uterine_weightfloat
Gravid uterine weight (kilograms)
- uterine_weightfloat
Uterine weight (kilograms)
Returns#
- net_energy_pregnancyfloat
Net energy requirement for pregnancy (Mcal/d)
- gravid_uterine_weight_gainfloat
Daily energy Requirement associated to increased gain of reproductive tissues as pregnancy advances (Mcal/d)
Notes#
# Assumptions: tissue contains 0.882 Mcal of energy / kg; an ME to gestation energy efficiency of 0.14; # and ME to net_energy_lactation efficiency of 0.66.MEpreg = Metabolizable energy requirement for pregnancy,
Mcal net_energy_lactation/day
- # day_of_pregnancy are counted from day 12 of pregnancy once it was confirmed and goes until day 280
day_of_pregnancy.
References#
[1] The National Academies of Sciences, Engineering, and Medicine “Nutrient Requirements of Dairy Cattle, 8th edition.” National Academic Press, Chapter 3 “Energy”, pp. 31-32, 2021.
- calculate_NRC_energy_lactation_requirements(animal_type: AnimalType, milk_fat: float, milk_true_protein: float, milk_lactose: float, milk_production: float) float #
Calculates energy requirement for lactation according to NRC (2001).
Calculates the estimated energy requirements for lactation in megacalories per day
Parameters#
- animal_typeAnimalType
A type or subtype of animal specified in the AnimalType enum
- milk_fatfloat
Fat contents in milk (%)
- milk_true_proteinfloat
True protein contents in milk (%)
- milk_lactosefloat
Lactose contents in milk (%)
- milk_production: float
Milk production (kg/d)
Returns#
- net_energy_lactationfloat
Net energy requirement for lactation (Mcal/d)
References#
[1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press, Chapter 2 “Energy”, pp. 19, 2001.
- calculate_NASEM_energy_lactation_requirements(animal_type: AnimalType, milk_fat: float, milk_true_protein: float, milk_lactose: float, milk_production: float) float #
Calculates energy requirement for lactation according to NASEM (2021).
Calculates the estimated energy requirements for lactation in megacalories per day
Parameters#
- animal_typeAnimalType
A type or subtype of animal specified in the AnimalType enum
- milk_fatfloat
Fat contents in milk (%)
- milk_true_proteinfloat
True protein contents in milk (%)
- milk_lactosefloat
Lactose contents in milk (%)
- milk_production: float
Milk yield (kg/d)
Returns#
- net_energy_lactationfloat
Net energy requirement for lactation (Mcal/d)
Notes#
Same calculations as done in the NRC (2001). Requirements are based on milk yield and composition.
References#
[1] The National Academies of Sciences, Engineering, and Medicine “Nutrient Requirements of Dairy Cattle, 8th edition.” National Academic Press, Chapter 3 “Energy”, pp. 30, 2021.
- calculate_NRC_protein_requirements(body_weight: float, conceptus_weight: float, day_of_pregnancy: int | None, animal_type: AnimalType, milk_production: float, milk_true_protein: float, calf_birth_weight: float, net_energy_growth: float, average_daily_gain: float, equivalent_shrunk_body_weight: float, dry_matter_intake_estimate: float, TDN_conc: float | None = 0.7) float #
Protein requirement for maintenance according to NRC (2001).
Calculates the estimated total metabolizable protein requirement (MP) in kilograms per day
Parameters#
- body_weightfloat
Body weight (kilograms)
- conceptus_weightfloat
Conceptus weight (kilograms)
- day_of_pregnancyint
Day of pregnancy (days)
- animal_typeAnimalType
A type or subtype of animal specified in the AnimalType enum
- milk_production: float
Milk yield (kg/d)
- milk_true_proteinfloat
True protein contents in milk (%)
- calf_birth_weightfloat
Calf birth weight
- net_energy_growthfloat
Net energy requirement for growth (Mcal/d)
- average_daily_gainfloat
Average daily gain (grams per day)
- equivalent_shrunk_body_weightfloat
Equivalent shrunk body weight (kilograms)
- dry_matter_intake_estimatefloat
Estimated dry matter intake according to empirical prediction equation within NASEM (2021) (kg/d)
- TDN_conc:
Concentration (percent value) of Total Digestible Nutrients in previously fed ration.
Returns#
- metabolizable_protein_requirementfloat
Metabolizable protein requirement (grams per day)
Notes#
MP_bactria: Bacteria metabolizable protein production, g TDN: Total digestible nutrients MPm: Metabolizable protein requirement for maintenance, g NPg: Net protein requirement for growth, g EffMP_NPg: Efficiency of converting metabolizable protein to net protein MPg: Metabolizable protein requirement for growth, g MPpreg: Metabolizable protein requirement for pregnancy, g MPlact: Metabolizable protein requirement for lactation, g
References#
[1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press, Chapter 5 “Protein and Amino acids”,pp. 67-69. 2001;
- calculate_NASEM_protein_requirements(lactating: bool, body_weight: float, frame_weight_gain: float, gravid_uterine_weight_gain: float, dry_matter_intake_estimate: float, milk_true_protein: float, milk_production: float, NDF_conc: float) float #
Calculates Protein requirement for maintenance according to NASEM (2021).
Calculates the estimated total metabolizable protein requirement (MP) in kilograms per day
Parameters#
- lactatingbool
Physiological condition
- body_weightfloat
Body weight (kilograms)
- frame_weight_gainfloat
Frame weight gain refers to the accretion of both fat and protein in carcass (grams per day)
- gravid_uterine_weight_gainfloat
Daiy energy Requirement associated to increased gain of reproductive tissues as pregnancy advances (Mcal/d)
- dry_matter_intake_estimatefloat
Estimated dry matter intake according to empirical prediction equation within NASEM (2021) (kg/d)
- milk_true_proteinfloat
True protein contents in milk (%)
- milk_production: float
Milk yield (kg/d)
- NDF_conc:
Concentration (percent value) of Neutral Detergent Fiber in previously fed ration.
Returns#
- metabolizable_protein_requirementfloat
Total metabolizable protein requirement (grams per day)
Notes#
As in the NRC (2021), the protein requirement is also divided into four components: maintenance, growth, pregnancy, and lactation (all of them on a metabolizable protein basis (MP, g/d). The MP is defined as the sum of rumen undegraded protein (RUP + microbial protein (MCP). MP requirements for maintenance includes: scurf + endogenous urinary loss + metabolic fecal protein. Current versions of RuFaS code for both NRC and NASEM do not split MP into physiological functions.
NPscurf: Net protein requirement for scurf, g NPEndUrin: Net protein requirement for endogenous urinary excretion, g CPMFP: Crude protein in metabolic fecal protein, g NPMFP: Net protein requirement for metabolic fecal protein, g NPGrowth: Net protein requirement for body frame weight gain, g NPGest: Net protein requirement for pregnancy, g NPMilk: Net protein in milk, or milk true protein yield, g TargetEffMP: Proposed target efficiencies of converting metabolizable protein to export proteins and body gain.
# TODO Include equations for estimating requirement for Non-Essential Aminoacids (NEAA) GitHub Issue #1210
References#
[1] The National Academies of Sciences, Engineering, and Medicine “Nutrient Requirements of Dairy Cattle, 8th edition.” National Academic Press, Chapter 6 “Protein”, pp. 69-104, 2021.
- calculate_NRC_calcium_requirements(body_weight: float, mature_body_weight: float, day_of_pregnancy: int | None, animal_type: AnimalType, average_daily_gain: float, milk_production: float) float #
Calculates total Calcium requirement according to NRC (2001).
Calculates the estimated the total calcium requirement (Ca) in grams per day
Parameters#
- body_weightfloat
Body weight (kilograms)
- mature_body_weightfloat
Mature body weight (kilograms)
- day_of_pregnancyint
Day of pregnancy (days)
- animal_typeAnimalType
A type or subtype of animal specified in the AnimalType enum
- average_daily_gainfloat
Average daily gain (grams per day)
- milk_production: float
Milk yield (kg/d)
Returns#
- calcium_requirementfloat
Calcium requirement (grams per day)
References#
[1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press, Chapter 6 “Minerals”,pp. 106-109. 2001.
- calculate_NASEM_calcium_requirements(body_weight: float, mature_body_weight: float, day_of_pregnancy: int | None, average_daily_gain: float, dry_matter_intake_estimate: float, milk_true_protein: float, milk_production: float, parity: int) float #
Calculates total Calcium requirement according to NASEM (2021).
Calculates the estimated the total calcium requirement (Ca) in grams per day.
Parameters#
- body_weightfloat
Body weight (kilograms)
- mature_body_weightfloat
Mature body weight (kilograms)
- day_of_pregnancyint
Day of pregnancy (days)
- average_daily_gainfloat
Average daily gain (grams per day)
- dry_matter_intake_estimatefloat
Estimated dry matter intake (kg/d)
- milk_true_proteinfloat
True protein contents in milk (%)
- milk_productionfloat
Milk yield (kg/d)
- parityint
Parity number (lactation 1, 2.. n)
Returns#
- calcium_requirementfloat
Calcium requirement (grams per day)
Notes#
NASEM (2021) calculation for both Ca and P requirements consider milk production variables.
References#
[1] The National Academies of Sciences, Engineering, and Medicine “Nutrient Requirements of Dairy Cattle, 8th edition.” National Academic Press, Chapter 7 “Minerals” pp. 106-110, 2021.
- calculate_NRC_phosphorus_requirements(body_weight: float, mature_body_weight: float, day_of_pregnancy: int | None, milk_production: float, animal_type: AnimalType, average_daily_gain: float, dry_matter_intake_estimate: float) float #
Calculates total Phosphorus requirement according to NRC (2001).
Calculates the estimated the total phosphorus requirement (P) in grams per day
Parameters#
- body_weightfloat
Body weight (kilograms)
- mature_body_weightfloat
Mature body weight (kilograms)
- day_of_pregnancyint
Day of pregnancy (days)
- milk_production: float
Milk yield (kg/d)
- animal_typeAnimalType
A type or subtype of animal specified in the AnimalType enum
- average_daily_gainfloat
Average daily gain (grams per day)
- dry_matter_intake_estimatefloat
Estimated dry matter intake (kg/d)
Returns#
- phosphorus_requirementfloat
Phosphorus requirement (grams per day)
References#
[1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press, Chapter 6 “Minerals”,pp. 109-118. 2001.
- calculate_NASEM_phosphorus_requirements(body_weight: float, mature_body_weight: float, animal_type: AnimalType, day_of_pregnancy: int | None, average_daily_gain: float, dry_matter_intake_estimate: float, milk_true_protein: float | None, milk_production: float | None, parity: int) float #
Calculates total Phosphorus requirement according to NASEM (2021).
Calculates the estimated the total phosphorus requirement (P) in grams per day
Parameters#
- body_weightfloat
Body weight (kilograms)
- mature_body_weightfloat
Mature body weight (kilograms)
- animal_typeAnimalType
A type or subtype of animal specified in the AnimalType enum
- day_of_pregnancyint
Day of pregnancy (days)
- average_daily_gainfloat
Average daily gain (grams per day)
- dry_matter_intake_estimatefloat
Estimated dry matter intake (kg/d)
- milk_true_proteinfloat
True protein contents in milk (%)
- milk_production: float
Milk yield (kg/d)
- parityint
Parity number (lactation 1, 2.. n)
Returns#
- phosphorus_requirementfloat
Phosphorus requirement (grams per day)
Notes#
NASEM (2021) calculation for both Ca and P requirements consider milk production variables.
References#
[1] The National Academies of Sciences, Engineering, and Medicine “Nutrient Requirements of Dairy Cattle, 8th edition.” National Academic Press, Chapter 7 “Minerals” pp. 112, 2021.
- calculate_NRC_DMI(animal_type: AnimalType, body_weight: float, day_of_pregnancy: int, days_in_milk: int | None, milk_production: float, milk_fat: float, net_energy_diet_concentration: float, days_born: float) float #
Calculates dry matter intake according to NRC (2001).
Calculates the estimated total dry matter intake in kilograms per day
Parameters#
- animal_typeAnimalType
A type or subtype of animal specified in the AnimalType enum
- body_weightfloat
Body weight (kilograms)
- day_of_pregnancyint
Day of pregnancy (days)
- days_in_milkint
Days in milk (days)
- milk_productionfloat
Milk yield (kg/d)
- milk_fatfloat
Fat contents in milk (%)
- net_energy_diet_concentrationfloat
Metabolizable energy density of formulated ration
- days_bornfloat
number of days since birth
Returns#
- dry_matter_intake_estimatefloat
Dry matter intake (kilograms per day)
Notes#
The sum of dry matter intake of each feed is assumed to be less than dry matter intake estimation (Sum of Feed < dry_matter_intake_estimate).
References#
[1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press, Chapter 1 “Dry Matter Intake”, pp. 4; and pp. 325, 2001 (Equations 1 and 2), and pp. 326 for heifers
- calculate_NASEM_DMI(body_weight: float, mature_body_weight: float, days_in_milk: int | None, lactating: bool, net_energy_lactation: float, parity: int, body_condition_score_5: int, NDF_conc: float) float #
Calculates dry matter intake according to NASEM (2021).
Calculates the estimated total dry matter intake in kilograms per day
Parameters#
- body_weightfloat
Body weight (kilograms)
- mature_body_weightfloat
Mature body weight (kilograms)
- days_in_milkint
Days in milk (days)
- lactatingbool
Physiological condition (conditional)
- net_energy_lactationfloat
Net energy for lactation
- parityint
Parity number
- body_condition_score_5int
Body condition score (score; scale from 1 to 5)
- NDF_conc:
Concentration (percent value) of Neutral Detergent Fiber in previously fed ration.
Returns#
- dry_matter_intake_estimate: float
Dry matter intake (kilograms per day)
Notes#
The sum of dry matter intake of each feed is assumed to be less than dry matter intake estimation (Sum of Feed < DMIest). There are additional equation in NASEM (2021) book including neutral detergent concentrations in the diet for both lactating (page 12) and growing animals (page 14). [1]
References#
[1] The National Academies of Sciences, Engineering, and Medicine “Nutrient Requirements of Dairy Cattle, 8th edition.” National Academic Press, Chapter 2 “Dry matter intake” pp. 7-20, 2021.
- energy_activity_rqmts(body_weight: float, housing: str, distance: float) float #
Calculates the net energy for activity requirement portion of the energy requirements for animals. This is separate because it must be calculated after grouping due to pen input args and cannot be used individually on an animal. The estimated energy requirements
for activity in megacalories per day are calculated following either NRC or NASEM guidelines
Parameters#
- body_weightfloat
Body weight (kg)
- housingstr
Housing type (Barn or Grazing)
- distancefloat
Distance walked in meters.
Returns#
- net_energy_activityfloat
Net energy requirement for activity (mcal/day)
Notes#
- Note that both NRC and NASEM calculations use distance walked in kilometers,
hence the unit conversion in the code itself.
Activity requirement (net_energy_activity) is proportional to body weight and daily walking distance. Grazing system and hilly topography will cost additional energy.
Grazing is not implemented yet in the current version of code.
References#
[1] The National Academies of Sciences, Engineering, and Medicine “Nutrient Requirements of Dairy Cattle, 8th edition.” National Academic Press, Chapter 3 “Energy”, pp. 30-31, 2021.