294 |
294 |
295 if (wgratio > 0 && mashtime > 0) { |
295 if (wgratio > 0 && mashtime > 0) { |
296 BD = wgratio; |
296 BD = wgratio; |
297 if (BD < 2) |
297 if (BD < 2) |
298 BD = 2; |
298 BD = 2; |
299 if (BD > 5.5) |
299 if (BD > 6) |
300 BD = 5.5; |
300 BD = 6; |
301 } else { |
301 } else { |
302 BD = 3.5; |
302 BD = 3.5; |
303 mashtemp = 67; |
303 mashtemp = 67; |
304 mashtime = 75; |
304 mashtime = 75; |
305 } |
305 } |
306 if (svg < 30) |
306 if (svg < 30) |
307 svg = 77; |
307 svg = 77; |
|
308 if (mashtime > 240) |
|
309 mashtime = 240; |
308 |
310 |
309 /* |
311 /* |
310 * Original from brouwhulp: |
312 * Original from brouwhulp: |
311 * 0.00825 Attenuation factor yeast (Real to apparant ??) |
313 * 0.00825 Attenuation factor yeast (Real to apparant ??) |
312 * 0.00817 Attenuation factor water/grain ratio |
314 * 0.00817 Attenuation factor water/grain ratio |
313 * -0.00684 Attenuation factor mash temperature |
315 * -0.00684 Attenuation factor mash temperature |
314 * 0.00026 Attenuation factor total mash time |
316 * 0.00026 Attenuation factor total mash time |
315 * -0.00356 Attenuation factor percentage crystal malt |
317 * -0.00356 Attenuation factor percentage crystal malt |
316 * 0.00553 Attenuation factor percentage simple sugars |
318 * 0.00553 Attenuation factor percentage simple sugars |
317 * 0.547 Attenuation factor constant |
319 * 0.547 Attenuation factor constant |
318 * 0.597 Attenuation factor constant when STA1 gen is true. |
320 * 0.597 Attenuation factor constant when STA1 gen is true. |
319 */ |
321 */ |
320 double top_mashtemp = 66.11; /* Highest fermentable at 151 degrees fahrenheit */ |
322 double top_mashtemp = 66.11; /* Highest fermentable at 151 degrees fahrenheit */ |
321 /* |
323 /* |
322 * Derived from Karl Troester's data and Matt Kahn. |
324 * Derived from Karl Troester's data and Matt Kahn. |
323 */ |
325 */ |
324 if (mashtemp > top_mashtemp) { |
326 if (mashtemp > top_mashtemp) { |
325 /* Above optimum mash temperature decrease attenuation */ |
327 /* Above optimum mash temperature decrease attenuation */ |
326 att_mashtemp = - 0.00684 * mashtemp; |
328 att_mashtemp = -0.00684 * mashtemp; |
327 } else { |
329 } else { |
328 /* Below optimum mash temperature decrease slowly attenuation */ |
330 /* Below optimum mash temperature decrease slowly attenuation */ |
329 att_mashtemp = - 0.00684 * (top_mashtemp + (top_mashtemp - mashtemp) / 4); |
331 att_mashtemp = -0.00684 * (top_mashtemp + (top_mashtemp - mashtemp) / 4); |
330 } |
332 } |
331 |
333 |
332 double AttBeer = 0.00825 * svg + 0.00817 * BD + att_mashtemp + 0.00026 * mashtime - 0.00356 * pcara + 0.00553 * psugar; |
334 double AttBeer = 0.00825 * svg + 0.00817 * BD + att_mashtemp + 0.00026 * mashtime - 0.00356 * pcara + 0.00553 * psugar; |
333 AttBeer += (sta1) ? 0.597:0.547; |
335 AttBeer += (sta1) ? 0.597:0.547; |
334 qDebug() << "estimate_fg(" << psugar << pcara << wgratio << mashtime << mashtemp << svg << og << sta1 << ") AttBeer:" << AttBeer; |
336 qDebug() << "estimate_fg(" << psugar << pcara << BD << mashtime << mashtemp << svg << og << sta1 << ") AttBeer:" << AttBeer; |
335 return round((1 + (1 - AttBeer) * (og -1)) * 10000) / 10000; |
337 return round((1 + (1 - AttBeer) * (og -1)) * 10000) / 10000; |
336 } |
338 } |
337 |
339 |
338 |
340 |
339 /* |
341 /* |