I have a function that calculates temperature that is dependent on both temperature and time. I want to be able to iterate the function to calculate a new temperature and then use that as the next temperature input of the function, and increase the time input by 1.
For example, if my function is F[T,t], I want to be able to make it go through this sequence:
F[T0,t0]
F[F[T0,t0],t1]
F[F[F[T0,t0]],t2]
etc.
I think that I can do this with a combination of Fold and a For loop, but I'm not sure how exactly.
Rest@FoldList[f, T0, {t0, t1, t2, t3}]? – kglr Jan 10 '15 at 16:08T0in the list, FWIW. – Mr.Wizard Jan 10 '15 at 16:09Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
– Jan 10 '15 at 16:18FoldList[]– Dr. belisarius Jan 10 '15 at 16:58F[F[F[T0,t0]],t2]is not a mistake the question requires additional clarification. – Mr.Wizard Jan 10 '15 at 17:17FoldList[]it is so much lean now. Thanks again. – Dr. belisarius Jan 10 '15 at 17:22