RUFAS.biophysical.animal.nutrients.nutrition_supply_calculator module#
- class RUFAS.biophysical.animal.nutrients.nutrition_supply_calculator.FeedInRation(amount: float, info: Feed | NASEMFeed)#
Bases:
objectDefines the amount of feed in a ration (kg) and all the nutritive info associated with it, in a Feed instance.
- amount: float#
- class RUFAS.biophysical.animal.nutrients.nutrition_supply_calculator.NutritionSupplyCalculator#
Bases:
objectCalculates the energy and nutrients supplied by a ration.
- nutrient_standard: NutrientStandard#
- nutrients_to_calculate = ['NDF', 'EE', 'CP', 'ADF', 'TDN', 'lignin', 'ash', 'potassium', 'starch']#
- classmethod calculate_nutrient_supply(feeds_used: list[Feed], ration_formulation: dict[int, float], body_weight: float, enteric_methane: float, urinary_nitrogen: float) NutritionSupply#
Calculates the energy and nutrients supplied in a ration.
Parameters#
- feeds_usedlist[Feed]
List of feeds that were used to construct the ration formulation.
- ration_formulationdict[RUFAS_ID, float]
Maps the RuFaS ID of a feed to the amount fed in a ration (kg dry matter).
- body_weightfloat
Body weight (kg).
- enteric_methanefloat
Enteric methane emission (g/day).
- urinary_nitrogenfloat
Amount of nitrogen in urine (kg).
Returns#
- NutritionSupply
NutritionSupply instance containing the energy and nutritive content of the given ration.
- classmethod calculate_nutrient_intake_discount(feeds: list[FeedInRation], body_weight: float) float#
Calculates discount applied to Total Digestible Nutrients (TDN) and Digestible Energy (DE).
Parameters#
- feedslist[FeedInRation]
List of feeds in ration, including the amount and nutritive properties.
- body_weightfloat
Body weight of an animal (kg).
Returns#
- float
Discount used to calculate the actual TDN and DE content of feeds in the ration.
Notes#
[AN.SUP.1.1], [AN.SUP.2.1], [AN.SUP.3.1], [AN.SUP.4.1]
References#
[1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press,
- classmethod calculate_actual_metabolizable_energy(feeds: list[FeedInRation], actual_digestible_energy: dict[int, float]) dict[int, float]#
Calculates the actual metabolizable energy of feeds.
Parameters#
- feedslist[FeedInRation]
List of feeds in ration, including the amount and nutritive properties.
- actual_digestible_energydict[RUFAS_ID, float]
Mapping of RuFaS Feed IDs to the discounted digestible energy content (Mcal / kg) of the corresponding feed.
Returns#
- dict[RUFAS_ID, float]
Mapping of RuFaS Feed IDs to the actual metabolizable energy content of the corresponding feed (Mcal / kg).
Notes#
[AN.SUP.5.1] References ———-
[1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press,
- classmethod calculate_actual_maintenance_net_energy(feeds: list[FeedInRation], actual_metabolizable_energy: dict[int, float]) float#
Calculates the actual net energy of the ration available to use for maintenance.
Parameters#
- feedslist[FeedInRation]
List of feeds in ration, including the amount and nutritive properties.
- actual_metabolizable_energydict[RUFAS_ID, float]
Mapping of RuFaS Feed IDs to the actual metabolizable energy content (Mcal / kg) of the feed.
Returns#
- float
Total actual net energy available for maintenance in the ration (Mcal).
Notes#
[AN.SUP.7.1] References ———- [1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press,
- classmethod calculate_NASEM_dNDF(feed: FeedInRation, dry_matter_intake: float, body_weight: float, total_starch: float) float#
NASEM method to calculate digestible NDF.
Adjusts base NDF digestibility of a given feed to account for the effect of total dry matter and starch intake.
Parameters#
- feedFeedInRation
Feed used in ration.
- dry_matter_intakefloat
Amount of dry matter intake in given ration, kg.
- body_weightfloat
Body weight of a given animal or the average body weight of animals being fed a given ration, kg.
- total_starchfloat
Total starch provided in given ration.
References#
AN.SUP.2.2
- classmethod calculate_NASEM_dstarch(feed: FeedInRation, dry_matter_intake: float, body_weight: float) float#
NASEM methodology used to calculate starch digestibility (dstarch) of a given feed.
Adjusts base digestibility.
Parameters#
- feedFeedInRation
Feed used in ration.
- dry_matter_intakefloat
Amount of dry matter intake in given ration, kg.
- body_weightfloat
Body weight of a given animal or the average body weight of animals being fed a given ration, kg.
Returns#
- float
Digestible starch for a given feed, Mcal/kg.
References#
AN.SUP.3.2
- classmethod calculate_NASEM_digestible_energy(feeds: list[FeedInRation], dry_matter_intake: float, body_weight: float, total_starch: float) float#
NASEM methodology used to calculate digestible energy for a given ration.
Parameters#
- feedslist[FeedInRation]
Feeds used in ration.
- dry_matter_intakefloat
Amount of dry matter intake in given ration, kg.
- body_weightfloat
Body weight of a given animal or the average body weight of animals being fed a given ration, kg.
- total_starchfloat
Total starch provided in given ration.
Returns#
- float
Digestible energy for a given ration, Mcal/kg.
References#
AN.SUP.1.2, AN.SUP.4.2, AN.SUP.5.2, and AN.SUP.6.2
- classmethod calculate_NASEM_metabolizable_energy(feeds: list[FeedInRation], dry_matter_intake: float, body_weight: float, total_starch: float, enteric_methane: float, urinary_nitrogen: float) float#
Method to calculate dietary metabolizable energy for a given ration.
Dietary metabolizable energy is calculated by subtracting the energy found in gaseous losses (i.e. enteric methane) and the energy lost in urine from the total diet digestible energy.
Parameters#
- feedslist[FeedInRation]
Feeds used in ration.
- dry_matter_intake: float
Amount of dry matter intake in given ration, kg.
- body_weight: float
Body weight of a given animal or the average body weight of animals being fed a given ration, kg.
- total_starch: float
Total starch provided in given ration.
- enteric_methane: float
Enteric methane emission (g/day).
- urinary_nitrogen: float
Amount of nitrogen in urine (kg).
Returns#
- float
Metabolizable energy for a given ration, Mcal/kg.
References#
AN.SUP.7.2, AN.SUP.8.2, and AN.SUP.9.2
- classmethod calculate_NASEM_net_energy(total_metabolizable_energy: float) float#
NASEM methodology used to calculate net energy.
Simple calculation using metabolizable energy and the efficiency of use.
Parameters#
- total_metabolizable_energyfloat
Metabolizable energy, Mcal/kg.
Returns#
- float
Net energy, Mcal/kg.
References#
AN.SUP.10.2
- classmethod calculate_actual_lactation_net_energy(feeds: list[FeedInRation], actual_metabolizable_energy: dict[int, float], actual_digestible_energy: dict[int, float]) float#
Calculates the actual net energy of the ration available to use for lactation.
Parameters#
- feedslist[FeedInRation]
List of feeds in ration, including the amount and nutritive properties.
- actual_digestible_energydict[RUFAS_ID, float]
Mapping of RuFaS Feed IDs to the discounted digestible energy content (Mcal / kg) of the feed.
- actual_metabolizable_energydict[RUFAS_ID, float]
Mapping of RuFaS Feed IDs to the actual metabolizable energy content (Mcal / kg) of the feed.
Returns#
- float
Total actual net energy available for lactation in the ration (Mcal).
Notes#
[AN.SUP.6.1]
References#
[1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press,
- classmethod calculate_actual_growth_net_energy(feeds: list[FeedInRation], actual_metabolizable_energy: dict[int, float]) float#
Calculates the actual net energy of the ration available to use for growth.
Parameters#
- feedslist[FeedInRation]
List of feeds in ration, including the amount and nutritive properties.
- actual_metabolizabledict[RUFAS_ID, float]
Mapping of RuFaS Feed IDs to the actual metabolizable energy content (Mcal / kg) of the feed.
Returns#
- float
Total actual net energy available for growth in the ration (Mcal).
Notes#
[AN.SUP.8.1]
References#
[1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press,
- classmethod calculate_calcium_supply(feeds: list[FeedInRation]) float#
Calculates the calcium supply in the ration.
Parameters#
- feedslist[FeedInRation]
List of feeds in ration, including the amount and nutritive properties.
Returns#
- float
Total digestible calcium supply in the ration (g).
Notes#
[AN.SUP.15]
References#
[1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press,
- classmethod calculate_phosphorus_supply(feeds: list[FeedInRation]) float#
Calculates the phosphorus supply in the ration.
- feedslist[FeedInRation]
List of feeds in ration, including the amount and nutritive properties.
- float
Total digestible phosphorus supply in the ration (g).
[1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press,
- classmethod calculate_metabolizable_protein_supply(feeds: list[FeedInRation], dry_matter_intake: float, actual_tdn_percentages: dict[int, float], body_weight: float) float#
Calculates amount of metabolizable protein in ration.
Parameters#
- feedslist[FeedInRation]
List of feeds in ration, including the amount and nutritive properties.
- dry_matter_intakefloat
Total dry matter contained in the ration (kg).
- actual_tdn_percentagesdict[RUFAS_ID, float]
Mapping of RuFaS Feed IDs to the discounted Total Digestable Nutrition (TDN) percentage of the feed.
- body_weightfloat
The body weight of an animal (kg).
Returns#
- float
Total metabolizable protein in the ration (g).
Notes#
- [AN.SUP.9],[AN.SUP.10],[AN.SUP.11],[AN.SUP.12],[AN.SUP.13],[AN.SUP.14],
[AN.SUP.27], [AN.SUP.29], [AN.SUP.30]
References#
Notes#
Endogenous metabolizable protein is calculated from the dry matter intake, but the units of the protein are grams while the dry matter intake is in kilograms, see page 319 of [1].
- classmethod _calculate_percentage_of_concentrates(feeds: list[FeedInRation], dry_matter_intake: float) float#
Calculates percentage of dry matter in ration that is concentrate.
Parameters#
- feedslist[FeedInRation]
List of feeds in ration, including the amount and nutritive properties.
- dry_matter_intakefloat
Total dry matter contained in the ration (kg).
Returns#
- float
Percentage of the ration’s dry matter which is made up of concentrates (percent).
- classmethod _calculate_protein_passage_rates(feeds: list[FeedInRation], dry_matter_intake: float, body_weight: float, percentage_concentrates: float) dict[int, float]#
Calculates the protein passage rate of feeds in ration.
- feedslist[FeedInRation]
List of feeds in ration, including the amount and nutritive properties.
- dry_matter_intakefloat
Total dry matter contained in the ration (kg).
- body_weightfloat
The body weight of an animal (kg).
- percentage_concetratesdict[RUFAS_ID, float]
Percentage of the ration’s dry matter which is made up of concentrates.
- dict[RUFAS_ID, float]
Mapping of RuFaS Feed IDs to protein passage rates (percentage / hour).
[AN.SUP.25]
[1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press,
- classmethod _calculate_rumen_degradable_protein_percentages(feeds: list[FeedInRation], protein_passage_rates: dict[int, float]) dict[int, float]#
Calculates rumen degradable protein (RDP) percentages of feeds in ration.
- feedslist[FeedInRation]
List of feeds in ration, including the amount and nutritive properties.
- protein_passage_ratesdict[RUFAS_ID, float]
Mapping of RuFaS Feed IDs to protein passage rates (percentage / hour).
- dict[RUFAS_ID, float]
Mapping of RuFaS Feed IDs to RDP percentages (percent).
[AN.SUP.26]
[1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press,
- classmethod _calculate_rumen_undegradable_protein_percentages(feeds: list[FeedInRation], rumen_degradable_protein_percentages: dict[int, float]) dict[int, float]#
Calculates rumen undegradable protein (RUP) percentages of feeds in ration.
Parameters#
- feedslist[FeedInRation]
List of feeds in ration, including the amount and nutritive properties.
- rumen_degradable_protein_percentagesdict[RUFAS_ID, float]
Mapping of RuFaS Feed IDs to RDP percentages.
Returns#
- dict[RUFAS_ID, float]
Mapping of RuFaS Feed IDs to RUP percentages (percent).
Notes#
[AN.SUP.28]
References#
[1] National Research Council, “Nutrient Requirements of Dairy Cattle, 7th edition.” National Academic Press,
- classmethod _calculate_nutritive_content(feeds: list[FeedInRation], nutrient: str) Any#
Calculates the content of a specific nutrient in a ration.
Parameters#
- feedslist[FeedInRation]
List of feeds in ration, including the amount and nutritive properties.
- nutrientstr
Name of the nutrient.
Returns#
- float
Total supply of nutrient in a ration (kg).
- classmethod _calculate_digestible_energy(feeds: list[FeedInRation]) Any#
Calculates the amount of digestible energy in a ration.
Parameters#
- feedslist[FeedInRation]
List of feeds in ration, including the amount and nutritive properties.
Returns#
- float
Total supply of nutrient in a ration (Mcal).
Notes#
[AN.SUP.4]
- classmethod _calculate_byproducts_supply(feeds: list[FeedInRation]) float#
Calculates the amount of byproducts in a ration.
Parameters#
- feedslist[FeedInRation]
List of feeds in ration, including the amount and nutritive properties.
Returns#
- float
Total supply of byproduct in a ration (kg dry matter).
- classmethod calculate_forage_neutral_detergent_fiber_content(feeds: list[FeedInRation]) float#
Calculates the neutral detergent fiber (NDF) content supplied by forages in a ration.
Parameters#
- feedslist[FeedInRation]
List of feeds in ration, including the amount and nutritive properties.
Returns#
- float
Total supply of NDF from forages in a ration (kg).