Nonlinear Opt.: Gold section search 3: Unterschied zwischen den Versionen

Aus Operations-Research-Wiki
Wechseln zu: Navigation, Suche
[unmarkierte Version][unmarkierte Version]
Zeile 1: Zeile 1:
 
== Index of contents ==
 
     
 
1. Theory
 
 
2. Mathematical formulation
 
 
3. Example for maximum
 
 
4. Sources
 
  
  
Zeile 100: Zeile 90:
  
  
λ<sub>0</sub> := 0 + (1 – 0,618) * (5 – 0) => λ<sub>0</sub> = 1,91
+
After having computed λ<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>).  
 
+
µ<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>  
 
         <math>f(\lambda _{0})= -(1,91 ^{2})+ 4 * 1,91  + 2 </math>  
Zeile 111: Zeile 97:
 
         <math>f(\mu _{0})= -(3,09 ^{2})+ 4 * 3,09  + 2</math>
 
         <math>f(\mu _{0})= -(3,09 ^{2})+ 4 * 3,09  + 2</math>
 
         f(µ<sub>0</sub>) = 4,8119
 
         f(µ<sub>0</sub>) = 4,8119
 +
 +
 +
''Step 1:''
 +
 +
We compare the difference between our interval values and our termination tolerance. If the difference is smaller, we stop our computation since the optimal output is reached, otherwise we start with the first iteration.
 +
 +
        5 – 0 > 0,8 => no stop
 +
 +
 +
''Step 2:''
 +
 +
Iteration k = 0:
 +
 +
Depending on whether f(λ<sub>0</sub>) < f(µ<sub>0</sub>) or f(λ<sub>0</sub>) > f(µ<sub>0</sub>), we use case a) or b) which are shown above in the mathematical formulation. In our example, we have f(λ<sub>0</sub>) > f(µ<sub>0</sub>), so we use case b). This means that our interval will be diminished from the right side. Our new b<sub>1</sub> :=  b<sub>0</sub> – λ<sub>0</sub>
 +
 +
        a<sub>1</sub> := 0
 +
        b<sub>1</sub> := 3,09
 +
        µ<sub>1</sub> := 1,91
 +
        λ<sub>1</sub> := 0 + (1 – 0,618) * (3,09 – 0)
 +
                        => λ<sub>1</sub> = 1,18038
 +
        f(µ<sub>1</sub>) := 5,9919
 +
        f(λ<sub>1</sub>) = 5,3282230556
 +
        go to Step 1

Version vom 26. Juni 2013, 14:18 Uhr


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:

Fehler beim Erstellen des Vorschaubildes: Die Miniaturansicht konnte nicht am vorgesehenen Ort gespeichert werden

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


After having computed λ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


Step 1:

We compare the difference between our interval values and our termination tolerance. If the difference is smaller, we stop our computation since the optimal output is reached, otherwise we start with the first iteration.

        5 – 0 > 0,8 => no stop


Step 2:

Iteration k = 0:

Depending on whether f(λ0) < f(µ0) or f(λ0) > f(µ0), we use case a) or b) which are shown above in the mathematical formulation. In our example, we have f(λ0) > f(µ0), so we use case b). This means that our interval will be diminished from the right side. Our new b1 := b0 – λ0

        a1 := 0
        b1 := 3,09
        µ1 := 1,91
        λ1 := 0 + (1 – 0,618) * (3,09 – 0) 
                       => λ1 = 1,18038
        f(µ1) := 5,9919
        f(λ1) = 5,3282230556
        go to Step 1