//Global Variables for Turkey density = 996; // kg/m3 Assuming Density of Water 1000 kg/m3 cp = 2810 // J/kg K for Turkey function celsiusToFarenheit(celsius) { farenheit = (celsius*(9/5)) + 32; return(farenheit) } function poundsToKilograms(pounds) { kilograms = (pounds * 0.453592); return(kilograms) } function findClosest(value,array) { closestDiff = null; closestPosition = null; for (var i=0;i errorTolerance) { lambdaN = (min+max)/2 result=lambdaFormula(lambdaN, Biot) if (Math.abs(result) <= errorTolerance) { return (lambdaN); //At Root } else if ((lambdaFormula(min, Biot)*lambdaFormula(lambdaN, Biot))>=0) { min=lambdaN; } else if ((lambdaFormula(max, Biot)*lambdaFormula(lambdaN, Biot))>=0) { max=lambdaN; } } return (lambdaN); } else { //console.log("No Bracketed Root " + negativeTest) } } function lambdaFormula(lambdaN, Biot) { result = 1-lambdaN*(1/Math.tan(lambdaN))-Biot; return(result) } function transientSphereSeries (rPosition,rTotal,tempInitial,tempInfini,t) { heatConvection = 6000; // W/m2 K Some Reasonable estimate for natural Convection. Change as needed. 5-25 thermalConduct = 20 // W/m K //alpha = thermalConduct/(density*cp) alpha = 6.66 * (1/Math.pow(10,6)) console.log("Alpha is " + alpha) sum=0; Fourier = (alpha*t)/Math.pow(rTotal,2) console.log("Fourier is " + Fourier) biotNum = heatConvection * rTotal/thermalConduct console.log("The Biot Value is " + biotNum) lambdaTerms = findAllRoots(biotNum) for (var i = 0; i