From 091ac61034decb07703299608a4c60abb46854b7 Mon Sep 17 00:00:00 2001 From: Scott Mobley Date: Mon, 11 Nov 2013 01:20:58 -0800 Subject: [PATCH] Transient Formula looks to be in good working order. That is, the roots appear correct compared to matlab generated results from a published paper. The thermal conductivity and other turkey identifiers may need adjustment, but the model works ok as long as the times we input are not too low. Better for longer DeltaTs --- js/CookingFormula.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/js/CookingFormula.js b/js/CookingFormula.js index 8cf2361..4f099da 100644 --- a/js/CookingFormula.js +++ b/js/CookingFormula.js @@ -5,7 +5,7 @@ //Global Variables for Turkey density = 996; // kg/m3 Assuming Density of Water 1000 kg/m3 cp = 2810 // J/kg K for Turkey -heatConvection = 12; // W/m2 K Some Reasonable estimate for natural Convection. Change as needed. 5-25 +heatConvection = 5; // W/m2 K Some Reasonable estimate for natural Convection. Change as needed. 5-25 thermalConduct = 0.412 // W/m K function celsiusToFarenheit(celsius) { @@ -179,12 +179,12 @@ for (var i = 0; i < length; ++i ) } function bisectionMethod(min,max,Biot) { -errorTolerance = (1/Math.pow(10,9)) +errorTolerance = (1/Math.pow(10,10)) result = Infinity // some large value to ensure the calculation goes through. negativeTest =lambdaFormula(min, Biot)*lambdaFormula(max, Biot) if (negativeTest <=0 ) { var antiFreeze=0; - while (Math.abs(result) > errorTolerance && antiFreeze<=10000) { + while (Math.abs(result) > errorTolerance && antiFreeze<=100000) { lambdaN = (min+max)/2 result=lambdaFormula(lambdaN, Biot) if (Math.abs(result) <= errorTolerance && result<=errorTolerance) { @@ -217,7 +217,10 @@ console.log("Fourier is " + Fourier) biotNum = heatConvection * rTotal/thermalConduct console.log("The Biot Value is " + biotNum) -lambdaTerms = findAllRoots(biotNum) +min = 0; +max = 250; + +lambdaTerms=findAllRootsAlternative (min,max,max*1000,biotNum) for (var i = 0; i