I execute the FindRoot command with the same value for the starting point, i.e. 0.5, in this case, for each value of the given list. But for the problem I’m solving, I want to pass a different starting point for each element of the list, as follows: the value for the starting point will be 0.5 for the first element of the list, but for the second item of the list, I want to use as starting point the result given by FindRoot obtained for the first element, and so on. So a starting point is given for the first element, but for the following ones, the starting value must be the result obtained for the previous element. I think this is a nice approach when solving numerical equations sensitive to the starting value, specially when the value of the variable ‘step’ is small. Thank you all for your help!!!
Thank you Daniel for your response!!, but I’m afraid that it doesn’t answer what I’m asking…
I want to pass a different starting value each time that FindRoot is evaluated, and, specifically,
I want to pass the last value obtained by FindRoot.
For the first value of the list, i.e. 3, the starting value of FindRoot is 0.5. The result given by
FindRoot is 0.3819… For the next value of the list (4, in this case), the starting value should be
0.3819.. and not 0.5. The starting value to find the root of the equation x^2-5x+1 should be 0.2679…,
and so on… This starting value is a parameter of the FindRoot function.
The code you suggested uses 0.5 as the starting point for all evaluations of FindRoot.
The claim about starting points is baffling (and certainly not carefully tested). Try printing the starting point at each iteration. You will notice below that starting points in each iteration come from immediately prior results.
In[74]:= FoldList[(Print[#1];
x /. FindRoot[x^2 - #2*x + 1, {x, #1}]) &, .5, Range[3, 6]]
During evaluation of In[74]:= 0.5
During evaluation of In[74]:= 0.38196601125
During evaluation of In[74]:= 0.267949192431
During evaluation of In[74]:= 0.208712152522
Out[74]= {0.5, 0.38196601125, 0.267949192431, 0.208712152522, \
0.171572875254}
It’s a different set of equations from before. In this case each one has .5 as solution and each has .5 as starting point. Since solutions and starting points are all the same, I have no idea what conclusion might be drawn from this in regards to whether the starting point is selected from prior solutions or from the initial starting point.