def calc_tcl_OLD(ta,Icl,M,fcl,hc): # calculate initial value of clothing temperature(tcl) for iterations tcl_previous=kelvin(ta)+((35.5-ta)/(3.5*Icl+0.1)) #tcl=(35.7-0.028*(M-Icl)*((3.96e-8)*(fcl))*((tcl_previous+273.15)**4-(ta+273.15)**4) # +(fcl*hc*(tcl_previous-ta))) #calculate final value of clothing temperature from scipy.optimize.nonlin import broyden1 def rootfn(tcl) : return (35.7-0.028*M-Icl*((3.96e-8)*fcl*((tcl+273.15)**4-(ta+273.15)**4) +(fcl*hc*(tcl-ta))) ) - tcl tcl = broyden1(rootfn, tcl_previous, f_tol=1e-10) tcl = float(tcl) print (tcl, rootfn(tcl))
def test_broyden1(self): x = nonlin.broyden1(F,F.xin,iter=12,alpha=1) assert_(nonlin.norm(x) < 1e-9) assert_(nonlin.norm(F(x)) < 1e-9)
def test_broyden1(self): x= nonlin.broyden1(F,self.xin,iter=11,alpha=1) assert nonlin.norm(x)<1e-9 assert nonlin.norm(F(x))<1e-9
def test_broyden1(self): x = nonlin.broyden1(F, F.xin, iter=12, alpha=1) assert_(nonlin.norm(x) < 1e-9) assert_(nonlin.norm(F(x)) < 1e-9)
def test_broyden1(self): x = nonlin.broyden1(F, self.xin, iter=11, alpha=1) assert nonlin.norm(x) < 1e-9 assert nonlin.norm(F(x)) < 1e-9