Skip to main content

Function: calculateDose()

calculateDose(__namedParameters): Dose

Defined in: fdm-calculator/src/doses/calculate-dose.ts:17

Calculates the cumulative doses of nitrogen, phosphate (as P2O5), and potassium (as K2O) applied to a field as kg / ha

This function iterates over each fertilizer application to determine its contribution to the overall nutrient dose by matching it with a corresponding fertilizer. For each application, it calculates the nutrient dose by multiplying the application amount by the fertilizer's nutrient rate and then sums all doses into a total dose object.

Parameters

__namedParameters

applications

getFertilizerApplicationType[]

fertilizers

getFertilizerType[]

Returns

Dose

An object containing the total doses with properties: p_dose_n (nitrogen), p_dose_nw (workable nitrogen - adjusted by the p_n_wc coefficient), p_dose_p2o5 (phosphate as P2O5), and p_dose_k2o (potassium as K2O).

Throws

If any fertilizer application amount or nutrient rate is negative.