What is "Iteration"

F

famdamly

I'm no expert, for what it's worth, the way I understand it, an
iteration, is an execution of a formula or process, or one cycle. I use
it to prevent circular reference errors. I set the iteration level to
one. I can't think of another use for it unless you could apply a
variable to the iteration setting.
 
B

Bill Martin

M. Homayon said:
Please tell me about Iteration, and give an example how to use it.
thanks

----------------

If you mean as a general programming technique, iteration is to do something
over and over. As a trivial example you might add up a list of 10 array
elements as follows:

Sum = 0
for I = 1 to 10
Sum = Sum + Data(I)
next I

Programs are generally chock full of iterative loops to do things. You don't
want to write a million lines of code to do something a million times if you can
avoid it.

Bill
 
M

MrShorty

As noted, iteration is kind of a broad topic. One way it is used i
math is to find the roots of equations (ie given y=f(x) what value(s
of x cause y=0). Several different algorithms out ther
(Newton-Raphson, secant, bisection, etc. any decent numerical method
text should describe). Basically the idea is to "guess" at the root
then, from information in the function, make a second (hopefull
better) guess and continue iterating until the algorithm converges t
an answer. Such methods aren't foolproof; there are cases where
given algorithm will fail to converge, or converge to the wrong answer
or diverge. Properly understood and applied, numerical method
represent a good way of solving problems for which no analytic solutio
exists
 
Top