RUFAS.biophysical.animal.nutrients.nasem_requirements_calculator module#

class RUFAS.biophysical.animal.nutrients.nasem_requirements_calculator.NASEMRequirementsCalculator#

Bases: NutritionRequirementsCalculator

Animal requirements calculator class, based on NASEM’s methodology.

classmethod calculate_requirements(body_weight: float, mature_body_weight: float, day_of_pregnancy: int | None, body_condition_score_5: float, days_in_milk: int | None, average_daily_gain_heifer: float | None, animal_type: AnimalType, parity: int, calving_interval: int | None, milk_fat: float, milk_true_protein: float, milk_lactose: float, milk_production: float, housing: str, distance: float, lactating: bool, ndf_percentage: float, process_based_phosphorus_requirement: float) NutritionRequirements#

Calculates energy and nutrition requirements for an animal using the NASEM methodology.

Parameters#

body_weightfloat

Body weight (kg)

mature_body_weightfloat

Mature body weight (kg)

day_of_pregnancyint | None

Day of pregnancy. None if the animal is not pregnant.

day_of_pregnancyint | None

Day of pregnancy. None if the animal is not pregnant.

body_condition_score_5float

Body condition score (score; scale from 1 to 5)

days_in_milkint | None

Days in milk. None if the animal is not milking.

average_daily_gain_heiferfloat

Average daily gain (g).

animal_typeAnimalType

A type or subtype of animal specified in AnimalType enum.

parityint

Lactation count of the animal.

calving_intervalint | None

Calving interval (days).

milk_fatfloat

Fat content of milk (%)

milk_true_proteinfloat

True protein contents in milk (%)

milk_lactosefloat

Lactose contents in milk (%)

milk_production: float

Daily milk yield (kg).

housingstr

Housing type (Barn or Grazing)

distancefloat

Distance walked (meters).

lactatingbool

True if the animal is milking, else false.

ndf_percentagefloat

Percentage of Neutral Detergent Fiber in previously fed ration.

Returns#

NutritionRequirements

NutritionRequirements instance containing all the required amounts of energy and nutrition.

classmethod _calculate_maintenance_energy_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, gravid uterine weight, and uterine weight according to NASEM (2021).

Parameters#

body_weightfloat

Body weight (kg)

mature_body_weightfloat

Mature body weight (kg)

day_of_pregnancyint | None

Day of pregnancy. None if the animal is not pregnant.

days_in_milkint | None

Days in milk. None if the animal is not milking.

Returns#

tuple[float, float, float]

Net energy requirement for maintenance (Mcal), gravid uterine weight (kg), and uterine weight (kg).

Notes#

[AN.NSM.1], [AN.NSM.2], [AN.NSM.3], [AN.NSM.4], [AN.NSM.5]

NASEM (2021)[1] 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

classmethod _calculate_growth_energy_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 associated growth metrics according to NASEM (2021).

Parameters#

body_weightfloat

Body weight (kg).

mature_body_weightfloat

Mature body weight (kg).

average_daily_gain_heiferfloat

Average daily gain (g).

animal_typeAnimalType

A type or subtype of animal specified in AnimalType enum.

parityint

Lactation count of the animal.

calving_intervalint | None

Calving interval (days).

Returns#

tuple[float, float, float]

Net energy requirement for frame growth (Mcal), average daily gain (g), and accretion of both fat and protein in carcass (g)

Notes#

[AN.NSM.11], [AN.NSM.12], [AN.NSM.13], [AN.NSM.14], [AN.NSM.15], [AN.NSM.16], [AN.NSM.17] In NASEM (2021)[1], 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#

classmethod _calculate_pregnancy_energy_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

Parameters#

lactatingbool

True if the animal is milking, else false.

day_of_pregnancyint

Day of pregnancy

days_in_milkint

Days in milk (lactation, days)

gravid_uterine_weightfloat

Gravid uterine weight (kg)

uterine_weightfloat

Uterine weight (kg)

Returns#

tuple[float, float]

Net energy requirement for pregnancy (Mcal) and daily energy requirement associated to increased gain of reproductive tissues as pregnancy advances (Mcal)

Notes#

[AN.NSM.18], [AN.NSM.19], [AN.NSM.20] 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#

classmethod _calculate_protein_requirement(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).

Parameters#

lactatingbool

True if the animal is lactating, else false.

body_weightfloat

Body weight (kg)

frame_weight_gainfloat

Frame weight gain refers to the accretion of both fat and protein in carcass (g)

gravid_uterine_weight_gainfloat

Daily energy requirement associated with increased gain of reproductive tissues as pregnancy advances (Mcal)

dry_matter_intake_estimatefloat

Estimated dry matter intake according to empirical prediction equation within NASEM (2021) (kg)

milk_true_proteinfloat

True protein contents in milk (%)

milk_production: float

Milk yield (kg)

NDF_conc:

Concentration (percent value) of Neutral Detergent Fiber in previously fed ration.

Returns#

metabolizable_protein_requirementfloat

Total metabolizable protein requirement (g).

Notes#

[AN.NSM.23],[AN.NSM.24],[AN.NSM.25],[AN.NSM.26],[AN.NSM.27], [AN.NSM.28],[AN.NSM.29],[AN.NSM.30],[AN.NSM.31], [AN.NSM.36], [AN.NSM.37], [AN.NSM.38], [AN.NSM.39] 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). 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. - scurf_net_protein_req: Net protein requirement for scurf, g - endogenous_urine_protein_req: Net protein requirement for endogenous urinary excretion, g - metabolic_fecal_crude_protein_req: Crude protein in metabolic fecal protein, g - net_metabolic_fecal_crude_protein_req: Net protein requirement for metabolic fecal protein, g - frame_growth_net_req: Net protein requirement for body frame weight gain, g - gestation_net_protein_req: Net protein requirement for pregnancy, g - milk_net_protein_req: Net protein in milk, or milk true protein yield, g - target_efficiencies_metabolic_protein: Proposed target efficiencies of converting metabolizable protein to

export proteins and body gain.

References#

classmethod _calculate_calcium_requirement(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).

Parameters#

body_weightfloat

Body weight (kg)

mature_body_weightfloat

Mature body weight (kg)

day_of_pregnancyint | None

Day of pregnancy (days)

average_daily_gainfloat

Average daily gain (g)

dry_matter_intake_estimatefloat

Estimated dry matter intake (kg)

milk_true_proteinfloat

True protein contents in milk (%)

milk_productionfloat

Milk yield (kg)

parityint

Parity number (lactation 1, 2.. n)

Returns#

calcium_requirementfloat

Calcium requirement (g)

Notes#

[AN.NSM.40], [AN.NSM.42], [AN.NSM.44], [AN.NSM.46], [AN.NSM.48] NASEM (2021) calculation for both Ca and P requirements consider milk production variables.

References#

classmethod _calculate_phosphorus_requirement(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, milk_production: float, parity: int) float#

Calculates total Phosphorus requirement according to NASEM (2021).

Parameters#

body_weightfloat

Body weight (kg)

mature_body_weightfloat

Mature body weight (kg)

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 (g)

dry_matter_intake_estimatefloat

Estimated dry matter intake (kg)

milk_true_proteinfloat

True protein contents in milk (%)

milk_production: float

Milk yield (kg)

parityint

Parity number (lactation 1, 2.. n)

Returns#

phosphorus_requirementfloat

Phosphorus requirement (g)

Notes#

[AN.NSM.41], [AN.NSM.43], [AN.NSM.45], [AN.NSM.47], [AN.NSM.49] NASEM (2021) calculation for both Ca and P requirements consider milk production variables.

References#

classmethod _calculate_dry_matter_intake(body_weight: float, mature_body_weight: float, days_in_milk: int | None, lactating: bool, net_energy_lactation: float, parity: int, body_condition_score_5: float, NDF_conc: float) float#

Calculates estimated dry matter intake according to NASEM (2021).

Parameters#

body_weightfloat

Body weight (kg)

mature_body_weightfloat

Mature body weight (kg)

days_in_milkint | None

Days in milk (days)

lactatingbool

True if animal is lactating, else false.

net_energy_lactationfloat

Net energy for lactation

parityint

Parity number

body_condition_score_5float

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_estimatefloat

Dry matter intake (kg).

Notes#

[AN.NSM.50],[AN.NSM.51] 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#

classmethod _calculate_activity_energy_requirements(body_weight: float, housing: str, distance: float) float#

Calculates the net energy for activity requirement portion of the energy requirements for animals.

Parameters#

body_weightfloat

Body weight (kg)

housingstr

Housing type (Barn or Grazing)

distancefloat

Distance walked (meters).

Returns#

net_energy_activityfloat

Net energy requirement for activity (Mcal)

Notes#

[AN.NSM.6]. [AN.NSM.7], [AN.NSM.8], [AN.NSM.9], [AN.NSM.10]

NASEM calculations use distance walked in kilometers, hence the unit conversion. 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.

This is separate because it must be calculated after grouping due to pen input args and cannot be used individually on an animal.

References#