So, if I have $[a,b] = [-1,2]$ and function $f(x) = x^2$, then on the first iteration we get: $x_1 = -1 +0.38 \cdot 3 = 0.14$ and $x_2 = -1 + 0.62 \cdot 3 = 0.86$. What is the formula for the calculation? And why is there a $3$? The second iteration is given as $x_3 = a_2 + b_2 - \bar{x_2}$ where $\bar{x_2} = x_1$ (because on the first iteration $f(x_1) < f(x_2) \Rightarrow a_2 = a_1$ and $b_2 = x_1$ ). So for the further iterations the formulas are given, but I don't get how it works for the first iteration?
Asked
Active
Viewed 79 times
0
-
What is the purpose of this iteration? – Christian Blatter May 07 '20 at 13:00
1 Answers
0
We have
$$x_1 = a + \dfrac{\sqrt{5}-1}{2}(a - b) \\ x_2 = b - \dfrac{\sqrt{5}-1}{2}(a - b)$$
Since $[a, b] = [-1, 2]$, $$a - b = 3$$
The algorithm is shown here.
Note that this switches $x_1$ and $x_2$, but that does not matter, you are just making the interval smaller and need two new values to test function values.
Moo
- 11,311