www/includes/formulas.php

Sun, 12 Aug 2018 21:24:33 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 12 Aug 2018 21:24:33 +0200
changeset 11
d341f0a91a91
child 83
85521c6e0022
permissions
-rw-r--r--

Added fermentable inventory

<?php


function ebc_to_srm($ebc)
{
	// Srm = -1.32303E-12*Ebc4-0.00000000291515*Ebc3+0.00000818515*Ebc2+0.372038*Ebc+0.596351
	return  -1.32303E-12 * pow($ebc, 4) - 0.00000000291515 * pow($ebc, 3) + 0.00000818515 * pow($ebc, 2) + 0.372038 * $ebc + 0.596351;
	//  return $ebc * 0.508;
}


function srm_to_ebc($srm)
{
	// EBC = 0.000000000176506*Srm4+ 0.000000154529*Srm3-0.000159428*Srm2+2.68837*Srm-1.6004
	//
	// Formule van Adrie Otten. brouwhulp.
	$ebc = 0.000000000176506 * pow($srm, 4) + 0.000000154529 * pow($srm, 3) - 0.000159428 * pow($srm, 2) + 2.68837 * $srm - 1.6004;
	return round($ebc);
}


?>

mercurial