88 theme: theme |
88 theme: theme |
89 }); |
89 }); |
90 $("#jqxWidget").css('visibility', 'visible'); |
90 $("#jqxWidget").css('visibility', 'visible'); |
91 }); |
91 }); |
92 |
92 |
|
93 |
|
94 |
|
95 /* |
|
96 * Berekeningen uit https://www.hobbybrouwen.nl/forum/index.php/topic,6079.msg69464.html#msg69464 |
|
97 */ |
|
98 function toIBU_Tinseth(Use, Form, SG, Volume, Amount, Boiltime, Alpha) { |
|
99 var gravity = parseFloat(SG); |
|
100 var liters = parseFloat(Volume); |
|
101 var alpha = parseFloat(Alpha)/100; |
|
102 var mass = parseFloat(Amount) * 1000; |
|
103 var time = parseFloat(Boiltime); |
|
104 var fmoment = 1.0; |
|
105 var pfactor = 1.0; |
|
106 |
|
107 if ((Use == "Dry Hop") || (Use == "Dry hop")) { |
|
108 fmoment = 0.0; |
|
109 } else if (Use == "Whirlpool") { |
|
110 fmoment = 0.0; |
|
111 } else if (Use == "Mash") { |
|
112 fmoment = 0.7; // Brouwhulp |
|
113 } else if ((Use == "First Wort") || (Use == "First wort")) { |
|
114 fmoment = 1.1; // Brouwhulp, Louis, Ozzie |
|
115 } else if (Use == "Aroma") { |
|
116 fmoment = 0.0; |
|
117 } |
|
118 |
|
119 if (Form == "Pellet") { |
|
120 pfactor = 1.1; |
|
121 } |
|
122 |
|
123 // TODO: sg = (postBoilGravity - 1.0) * batchSize / boilSize; |
|
124 |
|
125 /* |
|
126 * http://realbeer.com/hops/research.html |
|
127 * |
|
128 * decimal AA rating * grams hops * 1000 |
|
129 * mg/l of added alpha acids = ------------------------------------- |
|
130 * volume of finished beer in liters |
|
131 * |
|
132 * Bigness factor = 1.65 * 0.000125^(wort gravity - 1) |
|
133 * |
|
134 * 1 - e^(-0.04 * time in mins) |
|
135 * Boil Time factor = ---------------------------- |
|
136 * 4.15 |
|
137 * |
|
138 * decimal alpha acid utilization = Bigness factor * Boil Time factor |
|
139 * |
|
140 * IBUs = decimal alpha acid utilization * mg/l of added alpha acids |
|
141 */ |
|
142 var AddedAlphaAcids = (alpha * mass * 1000) / liters; |
|
143 var Bigness_factor = 1.65 * Math.pow( 0.000125, gravity - 1); |
|
144 var BoilTime_factor = ((1 - Math.exp(-0.04 * time)) / 4.15); // Glen Tinseth |
|
145 var utiisation = Bigness_factor * BoilTime_factor; |
|
146 |
|
147 console.log(" AddedAlphaAcids:"+AddedAlphaAcids+" Bigness_factor:"+Bigness_factor+" BoilTime_factor:"+BoilTime_factor+" utilisation:"+utiisation); |
|
148 console.log(" fmoment:"+fmoment+" pfactor:"+pfactor); |
|
149 |
|
150 var ibu = (Math.round(utiisation * AddedAlphaAcids * fmoment * pfactor * 10) / 10.0); |
|
151 return ibu; |
|
152 } |
|
153 |
|
154 |
|
155 |
|
156 function toIBU(Use, Form, SG, Volume, Amount, Boiltime, Alpha, Method) { |
|
157 |
|
158 console.log("toIBU_Tinseth("+Use+"," + Form + "," + SG + "," + Volume + "," + Amount + "," + Boiltime + "," + Alpha + "," + Method + ")"); |
|
159 return toIBU_Tinseth(Use, Form, SG, Volume, Amount, Boiltime, Alpha); |
|
160 } |
|
161 |
|
162 |
|
163 |