www/js/prod_edit.js

changeset 342
3ac81572bb28
parent 341
9c4bc199be9e
child 347
e6e7ec9e33e0
equal deleted inserted replaced
341:9c4bc199be9e 342:3ac81572bb28
370 } 370 }
371 371
372 function hopAromaContribution(bt, vol, use, amount) { 372 function hopAromaContribution(bt, vol, use, amount) {
373 var result = 0; 373 var result = 0;
374 374
375 if (bt > 20) { 375 if (use == 5) { // Dry hop
376 result = 1.33;
377 } else if (bt > 20) {
376 result = 0; 378 result = 0;
377 } else if (bt > 7.5) { 379 } else if (bt > 7.5) {
378 result = 10.03 / (4 * Math.sqrt(2 * Math.PI)) * Math.exp(-0.5 * Math.pow((bt - 7.5) /4, 2)); 380 result = 10.03 / (4 * Math.sqrt(2 * Math.PI)) * Math.exp(-0.5 * Math.pow((bt - 7.5) /4, 2));
379 } else if (use == 2) { // Boil 381 } else if (use == 2) { // Boil
380 result = 1; 382 result = 1;
381 } else if (use == 3) { // Aroma 383 } else if (use == 3) { // Aroma
382 result = 1.2; 384 result = 1.2;
383 } else if (use == 4) { // Whirlpool 385 } else if (use == 4) { // Whirlpool
384 result = 1.2; 386 result = 1.2;
385 } else if (use == 5) { // Dry hop
386 result = 1.33;
387 } 387 }
388 return (result * amount * 1000) / vol; 388 return (result * amount * 1000) / vol;
389 } 389 }
390 390
391 function calcIBUs() { 391 function calcIBUs() {

mercurial