745 { name: 'name', type: 'string' }, |
745 { name: 'name', type: 'string' }, |
746 { name: 'steps', type: 'array' } |
746 { name: 'steps', type: 'array' } |
747 ], |
747 ], |
748 url: 'includes/db_profile_mash.php' |
748 url: 'includes/db_profile_mash.php' |
749 }, |
749 }, |
750 mashlist = new $.jqx.dataAdapter(mashProfileSource), |
750 mashlist = new $.jqx.dataAdapter(mashProfileSource); |
751 |
|
752 |
|
753 |
|
754 /* |
|
755 * From "Rekenen aan bier" by Hans Halberstadt. |
|
756 */ |
|
757 K1s = 0.384, K1a = -0.177, K1e = 0.241, K1g = 0.247, Ks = 0.1415, Ka1 = 0.058, Ka2 = 0.078, Ke = 0.174, Kg = 0.109; |
|
758 |
|
759 // =E2/E6+(E3/E6)*$B$24/$B$23+(E3/E6)*(E3/E6)*$B$25/$B$23+E4/E6*$B$26/$B$23+E5/E6*$B$27/$B$23 |
|
760 // For Brix |
|
761 function A(sugar, volume, alc, eiwit, glycerol) { |
|
762 |
|
763 var vol, A; |
|
764 |
|
765 vol = volume * 1000; |
|
766 A = sugar / vol + (alc / vol) * Ka1 / Ks + (alc / vol) * (alc / vol) * Ka2 / Ks + eiwit / vol * Ke / Ks + glycerol / vol * Kg / Ks; |
|
767 console.log('A(' + sugar + ',' + volume + ',' + alc + ',' + eiwit + ',' + glycerol + '):' + A); |
|
768 return A; |
|
769 } |
|
770 |
|
771 // =E2/E6+(E3/E6)*$B$20/$B$19+E4/E6*$B$21/$B$19+E5/E6*$B$22/$B$19 |
|
772 // for Plato |
|
773 function B(sugar, volume, alc, eiwit, glycerol) { |
|
774 |
|
775 var vol, B; |
|
776 |
|
777 vol = volume * 1000; |
|
778 B = sugar / vol + (alc / vol) * K1a / K1s + eiwit / vol * K1e / K1s + glycerol / vol * K1g / K1s; |
|
779 console.log('B(' + sugar + ',' + volume + ',' + alc + ',' + eiwit + ',' + glycerol + '):' + B); |
|
780 return B; |
|
781 } |
|
782 |
751 |
783 |
752 |
784 |
753 |
785 $(document).ready(function() { |
754 $(document).ready(function() { |
786 |
755 |