Changed the sg/plato formulas in the php scripts.

Thu, 16 Apr 2020 20:14:02 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 16 Apr 2020 20:14:02 +0200
changeset 653
aa25efa1d629
parent 652
a5d9ec7e2239
child 654
0aef416dbceb

Changed the sg/plato formulas in the php scripts.

www/includes/formulas.php file | annotate | diff | comparison | revisions
--- a/www/includes/formulas.php	Thu Apr 16 16:08:24 2020 +0200
+++ b/www/includes/formulas.php	Thu Apr 16 20:14:02 2020 +0200
@@ -115,17 +115,19 @@
 
 
 function sg_to_plato($sg) {
-	if ($sg > 0.5)
-		return 259 - 259 / $sg;
-	return 0;
+//	if ($sg > 0.5)
+//		return 259 - 259 / $sg;
+//	return 0;
+	return -668.962 + (1262.45 * $sg) - (776.43 * $sg * $sg) + (182.94 * $sg * $sg * $sg);
 }
 
 
 
 function plato_to_sg($plato) {
-	if ($plato < 259)
-		return 259 / (259 - $plato);
-	return 1.000;
+//	if ($plato < 259)
+//		return 259 / (259 - $plato);
+//	return 1.000;
+	return 1.00001 + (0.0038661 * $plato) + (1.3488e-5 * $plato * $plato) + (4.3074e-8 * $plato * $plato * $plato);
 }
 
 

mercurial