diff --git a/RUFAS/biophysical/animal/animal_module_constants.py b/RUFAS/biophysical/animal/animal_module_constants.py index a62c5da2d2..da7a859201 100644 --- a/RUFAS/biophysical/animal/animal_module_constants.py +++ b/RUFAS/biophysical/animal/animal_module_constants.py @@ -82,10 +82,10 @@ class AnimalModuleConstants: MILK_LACTOSE: float = 4.85 """Milk lactose content, percentage.""" - DMI_CONSTRAINT_FRACTION: float = 0.30 + DMI_CONSTRAINT_FRACTION: float = 0.00 """The +/- fraction of DMI estimated allowed for ration formulation.""" - DMI_REQUIREMENT_BOOST: float = 1.1 + DMI_REQUIREMENT_BOOST: float = 1.0 """The fraction of the dry matter intake requirement used as the basis for the inclusion rate bounds in user defined ration formulation method.""" diff --git a/RUFAS/biophysical/animal/herd_manager.py b/RUFAS/biophysical/animal/herd_manager.py index 7a0c07a025..36c305af0c 100644 --- a/RUFAS/biophysical/animal/herd_manager.py +++ b/RUFAS/biophysical/animal/herd_manager.py @@ -134,6 +134,7 @@ def __init__( self.is_ration_defined_by_user = is_ration_defined_by_user ration_feed_config = self.im.get_data("feed") + RationManager.lac_cow_dry_matter_intake = ration_feed_config["lac_cow_dry_matter_intake"] if self.is_ration_defined_by_user: RationManager.set_user_defined_rations(ration_feed_config) RationManager.set_user_defined_ration_tolerance(ration_feed_config) diff --git a/RUFAS/biophysical/animal/nutrients/nasem_requirements_calculator.py b/RUFAS/biophysical/animal/nutrients/nasem_requirements_calculator.py index c47f77a3dc..3ee64f942f 100644 --- a/RUFAS/biophysical/animal/nutrients/nasem_requirements_calculator.py +++ b/RUFAS/biophysical/animal/nutrients/nasem_requirements_calculator.py @@ -6,6 +6,7 @@ from RUFAS.biophysical.animal.ration.amino_acid import AminoAcidCalculator from RUFAS.general_constants import GeneralConstants from RUFAS.user_constants import UserConstants +from RUFAS.biophysical.animal.ration.ration_manager import RationManager from .nutrition_requirements_calculator import NutritionRequirementsCalculator @@ -657,13 +658,16 @@ def _calculate_dry_matter_intake( """ if lactating: - parity_adjustment_factor = 1 if parity > 1 else 0 - dry_matter_intake_estimate = ( - (3.7 + parity_adjustment_factor * 5.7) - + 0.305 * net_energy_lactation - + 0.022 * body_weight - + (-0.689 - 1.87 * parity_adjustment_factor) * body_condition_score_5 - ) * (1 - (0.212 + parity_adjustment_factor * 0.136) * exp(-0.053 * days_in_milk)) + if RationManager.lac_cow_dry_matter_intake == 0: + parity_adjustment_factor = 1 if parity > 1 else 0 + dry_matter_intake_estimate = ( + (3.7 + parity_adjustment_factor * 5.7) + + 0.305 * net_energy_lactation + + 0.022 * body_weight + + (-0.689 - 1.87 * parity_adjustment_factor) * body_condition_score_5 + ) * (1 - (0.212 + parity_adjustment_factor * 0.136) * exp(-0.053 * days_in_milk)) + else: + dry_matter_intake_estimate = RationManager.lac_cow_dry_matter_intake else: dry_matter_intake_estimate = ( 0.0226 * mature_body_weight * (1 - exp(-1.47 * (body_weight / mature_body_weight))) diff --git a/RUFAS/biophysical/animal/ration/ration_manager.py b/RUFAS/biophysical/animal/ration/ration_manager.py index 4d13355e25..98a11e739f 100644 --- a/RUFAS/biophysical/animal/ration/ration_manager.py +++ b/RUFAS/biophysical/animal/ration/ration_manager.py @@ -34,6 +34,7 @@ class RationManager: user_defined_rations: dict[AnimalCombination, dict[RUFAS_ID, float]] | None tolerance: float | None = 0.0 maximum_ration_reformulation_attempts: int + lac_cow_dry_matter_intake: float @classmethod def set_ration_feeds(cls, ration_config: dict[str, list[int]]) -> None: diff --git a/input/data/feed/example_Midwest_feed.json b/input/data/feed/example_Midwest_feed.json index f0bc11ba7b..de14c207e2 100644 --- a/input/data/feed/example_Midwest_feed.json +++ b/input/data/feed/example_Midwest_feed.json @@ -186,6 +186,7 @@ ], "tolerance": 0.1 }, + "lac_cow_dry_matter_intake": 27, "max_daily_feed_recalculations_per_year": 4, "allowances": [ { diff --git a/input/metadata/properties/default.json b/input/metadata/properties/default.json index 2d52ff68de..51fe8ba071 100644 --- a/input/metadata/properties/default.json +++ b/input/metadata/properties/default.json @@ -4375,6 +4375,12 @@ "maximum": 365, "default": 4 }, + "lac_cow_dry_matter_intake": { + "type": "number", + "description": "Fixed amount of dry matter intake (kg) for lactating cows. Set to 0 to use NASEM or NRC predicted dry matter intake.", + "minimum": 0, + "default": 0 + }, "allowances": { "type": "array", "properties": {