Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'Problem with iteractive function' topicStudent Support Forum > General > Archives > "Problem with iteractive function"

Next Comment >Help | Reply To Topic
Author Comment/Response
Miguel Cruz
03/17/03 11:03am

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

URL: ,

Subject (listing for 'Problem with iteractive function')
Author Date Posted
Problem with iteractive function Miguel Cruz 03/17/03 11:03am
Re: Problem with iteractive function Forum Modera... 03/29/03 05:46am
Next Comment >Help | Reply To Topic