Nonlinear Opt.: Gold section search 3: Unterschied zwischen den Versionen
[unmarkierte Version] | [unmarkierte Version] |
Tilg (Diskussion | Beiträge) |
Tilg (Diskussion | Beiträge) |
||
Zeile 35: | Zeile 35: | ||
If b<sub>k</sub> – a<sub>k</sub> < ε, then STOP. | If b<sub>k</sub> – a<sub>k</sub> < ε, then STOP. | ||
+ | |||
''Step 2:'' Compare the distance with the termination tolerance. If the distance is greater than the termination tolerance, continue with the following two cases: | ''Step 2:'' Compare the distance with the termination tolerance. If the distance is greater than the termination tolerance, continue with the following two cases: | ||
Zeile 45: | Zeile 46: | ||
µ<sub>k+1</sub> := a<sub>k+1</sub> + δ * (b<sub>k+1</sub> – a<sub>k+1</sub>), | µ<sub>k+1</sub> := a<sub>k+1</sub> + δ * (b<sub>k+1</sub> – a<sub>k+1</sub>), | ||
f(λ<sub>k+1</sub>) := f(µ<sub>k</sub>), | f(λ<sub>k+1</sub>) := f(µ<sub>k</sub>), | ||
− | and compute f(µ<sub>k+1</sub>) | + | and compute f(µ<sub>k+1</sub>) |
+ | |||
+ | the interval will be diminished from the right side | ||
Case b) | Case b) | ||
Zeile 56: | Zeile 59: | ||
compute f(λ<sub>k+1</sub>) | compute f(λ<sub>k+1</sub>) | ||
set k = k+1, go to Step 1. | set k = k+1, go to Step 1. | ||
+ | |||
+ | the interval will be diminished from the left side | ||
+ | |||
The result is: | The result is: | ||
− | [[Datei:Golden_Section_Search.png | + | |
+ | [[Datei:Golden_Section_Search.png]] | ||
+ | |||
+ | figure 1: interval demonstration of the two possibilities | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | == Example for maximum == | ||
+ | |||
+ | <math>max f(x)= -(x^{2})+ 4x + 2 </math> where x ϵ <math>\mathbb{R}</math> on interval [0, 5], termination tolerance ε = 0,8 | ||
+ | |||
+ | |||
+ | ''Step 0:'' | ||
+ | |||
+ | a<sub>0</sub> and b<sub>0</sub> are the margins of the interval | ||
+ | |||
+ | a<sub>0</sub> := 0 ; b<sub>0</sub> := 5 | ||
+ | |||
+ | k represents the iteration steps | ||
+ | |||
+ | k := 0 | ||
+ | |||
+ | Compute λ<sub>k</sub> with the formula: | ||
+ | |||
+ | λ<sub>k</sub> := a<sub>k</sub> + (1 – δ) * (b<sub>k</sub> – a<sub>k</sub>) | ||
+ | λ<sub>0</sub> := 0 + (1 – 0,618) * (5 – 0) | ||
+ | => λ<sub>0</sub> = 1,91 | ||
+ | |||
+ | and then µ<sub>0</sub> with the formula: | ||
+ | |||
+ | µ<sub>k</sub> := a<sub>k</sub> + δ * (b<sub>k</sub> – a<sub>k</sub>) | ||
+ | µ<sub>0</sub> := 0 + 0,618 * (5 – 0) | ||
+ | => µ<sub>0</sub> = 3,09 | ||
+ | |||
+ | |||
+ | λ<sub>0</sub> := 0 + (1 – 0,618) * (5 – 0) => λ<sub>0</sub> = 1,91 | ||
+ | |||
+ | µ<sub>0</sub> := 0 + 0,618 * (5 – 0) => µ<sub>0</sub> = 3,09 | ||
+ | |||
+ | Afterwards we compute λ<sub>k</sub> and µ<sub>0</sub> we insert, in succession, λ<sub>0</sub> and µ<sub>0</sub> in the start function f(x) to get a result for f(λ<sub>0</sub>) and f(µ<sub>0</sub>). | ||
+ | |||
+ | <math>f(\lambda _{0})= -(1,91 ^{2})+ 4 * 1,91 + 2 </math> | ||
+ | f(λ<sub>0</sub>) = 5,9919 | ||
+ | |||
+ | <math>f(\mu _{0})= -(3,09 ^{2})+ 4 * 3,09 + 2</math> | ||
+ | f(µ<sub>0</sub>) = 4,8119 |
Version vom 26. Juni 2013, 13:59 Uhr
Inhaltsverzeichnis
Index of contents
1. Theory
2. Mathematical formulation
3. Example for maximum
4. Sources
Theory
Golden section search is a part of unconstrained nonlinear optimization for strictly unimodal functions. This method is used to find a minimum or maximum by narrowing values in a specific interval. The extrema exists in the range. Based on the unimodal function, we assume that the local extrema is simultaneously the global extrema. In this method we do not use derivation, but rather a "step-by-step" approximation to the extrema.
Mathematical formulation (for maximum)
The method of the golden section search has the function Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): f:\mathbb{R}^{n} \supseteq X \rightarrow \mathbb{R}^{n}
based on an interval (a0,b0), where “a” is smaller than ”b”. A termination tolerance of ε is given, with the objective ε to compare the distance between “a” and “b” in each iteration. Through each iteration, the interval will be diminished by the factor λ, which is given with the value 0,618. λ will be cut from the bigger part of the interval. k = n represents the iteration steps.
Step 0: Initialization
Set a0 := a, b0:= b, k := 0
Calculate λk := ak + (1 – δ) * (bk – ak) and µk := ak + δ * (bk – ak) as well as f(λk) and f(µk)
Step1: Compare the distance with the termination tolerance. If the distance is smaller than the termination tolerance, stop the iteration, because the maximum has been reached.
If bk – ak < ε, then STOP.
Step 2: Compare the distance with the termination tolerance. If the distance is greater than the termination tolerance, continue with the following two cases:
Case a)
If f(λk) < f(µk), set ak+1 := λk, bk+1 := bk, λk+1 := µk, µk+1 := ak+1 + δ * (bk+1 – ak+1), f(λk+1) := f(µk), and compute f(µk+1)
the interval will be diminished from the right side
Case b)
If f(λk) ≥ f(µk), set ak+1 := ak, bk+1 := µk, µk+1 := λk, λk+1 := ak+1 + (1 – δ) * (bk+1 – ak+1), f(µk+1) := f(λk), compute f(λk+1) set k = k+1, go to Step 1.
the interval will be diminished from the left side
The result is:
figure 1: interval demonstration of the two possibilities
Example for maximum
Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): max f(x)= -(x^{2})+ 4x + 2
where x ϵ on interval [0, 5], termination tolerance ε = 0,8
Step 0:
a0 and b0 are the margins of the interval
a0 := 0 ; b0 := 5
k represents the iteration steps
k := 0
Compute λk with the formula:
λk := ak + (1 – δ) * (bk – ak) λ0 := 0 + (1 – 0,618) * (5 – 0) => λ0 = 1,91
and then µ0 with the formula:
µk := ak + δ * (bk – ak) µ0 := 0 + 0,618 * (5 – 0) => µ0 = 3,09
λ0 := 0 + (1 – 0,618) * (5 – 0) => λ0 = 1,91
µ0 := 0 + 0,618 * (5 – 0) => µ0 = 3,09
Afterwards we compute λk and µ0 we insert, in succession, λ0 and µ0 in the start function f(x) to get a result for f(λ0) and f(µ0).
Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): f(\lambda _{0})= -(1,91 ^{2})+ 4 * 1,91 + 2 f(λ0) = 5,9919
Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): f(\mu _{0})= -(3,09 ^{2})+ 4 * 3,09 + 2
f(µ0) = 4,8119