Trouble with an iterative function

*To*: mathgroup at smc.vnet.net*Subject*: [mg40085] Trouble with an iterative function*From*: Miguel Gomes da Cruz <mgcruz at selway.umt.edu>*Date*: Wed, 19 Mar 2003 03:23:04 -0500 (EST)*Sender*: owner-wri-mathgroup at wolfram.com

Good day everyone, I have problem trying to implement an iterative function that attempts to estimate the temperature of a wood particle subjected to variable air temperature (air temperature is function of time, e.g. Tair[t_]=600+t*5). The function is the following (hc is the heat transfer coeficient): Fignition[t_, hc_] := Block[{ Tfuel = Tini, Tini = 300, Fcp = 2100, Fd = 0.005, Fl = 0.1, ?f = 520, FMC = 0.7, Wcp = 2417, Whv = 2257000}, {While[Tfuel < 373, Print[Tfuel]; Save["test01.dat", Tfuel];{S = ?f*Fv[ Fd, Fl]*(Fcp + (Wcp*FMC)); Q = hc*Fa[Fd, Fl]*(Tair[t] - Tfuel); Xtp = Tfuel + (Q/S); Tfuel = Xtp}]} {While[Tfuel > 373, Print[Tfuel]; Save["test01.dat", Tfuel]; { S = ?f*Fv[Fd, Fl]*(Fcp); Q = hc*Fa[Fd, Fl]*(Tair[t] - Tfuel); Xtp = Tfuel + (Q/S); Tfuel = Xtp}; If[Tfuel > 600, Break[]] ] } ] My problem is that I want the Fignition[t_, hc_] function to be computed for each time step by reading the Tair at that time step. the time step should be the iterator. Currently the function does its thing but uses a fixed Tair. Hpe I was clear. Thanks Miguel ******************************************** Miguel Cruz 460 "The Bullpen" Science Complex School of Forestry University of Montana Missoula, MT 59812 Phone: (406) 329 4748 (@ FiSL) Fax: (406) 329 4825 (@ FiSL) ********************************************