633:ec4601ab3ed2 | 634:903f4247f62b |
---|---|
2774 x = C1 * (pHZ - row.f_di_ph); // AcidRequired(ZpH) | 2774 x = C1 * (pHZ - row.f_di_ph); // AcidRequired(ZpH) |
2775 Result += x * row.f_amount; | 2775 Result += x * row.f_amount; |
2776 } | 2776 } |
2777 } | 2777 } |
2778 } else { | 2778 } else { |
2779 console.log('ProtonDeficit(' + pHZ + ') invalid grist'); | 2779 console.log('ProtonDeficit(' + pHZ + ') invalid grist, return ' + Result); |
2780 } | 2780 } |
2781 return Result; | 2781 return Result; |
2782 } | 2782 } |
2783 | 2783 |
2784 function MashpH() { | 2784 function MashpH() { |
2790 else if (pd > deltapd) | 2790 else if (pd > deltapd) |
2791 pH += deltapH; | 2791 pH += deltapH; |
2792 pd = ProtonDeficit(pH); | 2792 pd = ProtonDeficit(pH); |
2793 } | 2793 } |
2794 pH = Round(pH, 2); | 2794 pH = Round(pH, 2); |
2795 //console.log('MashpH() n: ' + n + ' pH: ' + pH); | 2795 console.log('MashpH() n: ' + n + ' pH: ' + pH); |
2796 return pH; | 2796 return pH; |
2797 } | 2797 } |
2798 | 2798 |
2799 function GetAcidSpecs(AT) { | 2799 function GetAcidSpecs(AT) { |
2800 switch (AT) { | 2800 switch (AT) { |
2928 AcidPrc = result.AcidPrc; | 2928 AcidPrc = result.AcidPrc; |
2929 | 2929 |
2930 if (dataRecord.calc_acid) { | 2930 if (dataRecord.calc_acid) { |
2931 TpH = parseFloat(dataRecord.mash_ph); | 2931 TpH = parseFloat(dataRecord.mash_ph); |
2932 protonDeficit = ProtonDeficit(TpH); | 2932 protonDeficit = ProtonDeficit(TpH); |
2933 //console.log('calc_acid tgt: ' + TpH + ' protonDeficit: ' + protonDeficit); | 2933 console.log('calc_acid tgt: ' + TpH + ' protonDeficit: ' + protonDeficit); |
2934 if (protonDeficit > 0) { // Add acid | 2934 if (protonDeficit > 0) { // Add acid |
2935 $('#wa_base').val(0); | 2935 $('#wa_base').val(0); |
2936 setWaterAgent(last_base, 0); | 2936 setWaterAgent(last_base, 0); |
2937 frac = CalcFrac(TpH, pK1, pK2, pK3); | 2937 frac = CalcFrac(TpH, pK1, pK2, pK3); |
2938 Acid = protonDeficit / frac; | 2938 Acid = protonDeficit / frac; |