Numerical methods. Note 8
[ Home ]
|
Nonlinear Equations and Function Optimization (Minimization). |
Numerical Methods. Note
« 8
»
|
System of n nonlinear equations
can be solved numerically by Newtons method.
Suppose that the point x is close to the root. Let us try to find the step
Δx which brings us to the solution fi(x+Δx)=0. The first
order Taylor expansion gives a system of linear equations
fi(x)+∑k ∂fi/∂xkΔxk = 0
⇒
A⋅Δx = -F ,
Aik ≡ [[∂fi/∂xk]],
F ≡ [Fi]
|
The solution Δx to this equation gives the approximate direction
and the step-size towards the root. The modified Newton's
method instead of the full step uses a more conservative approach, fx:
λ = 1; do {
z = x + λΔx;
λ = λ/2;
} while( |f(z)|>(1-λ/2)*|f(x)| && λ>0.01)
Optimization is the problem of finding minimum (or maximum) of a
given function, often with some constraints. The Nelder-Mead method or
downhill simplex method is a commonly used nonlinear optimization
algorithm in n-dimensional space.
The method finds a minimum by transforming a simplex (a polytope of n+1
vertices) according to the function values at the vertices, moving it
downhill until it converges towards the minimum (maximum).
- Definitions:
-
simplex: a figure (polytope) represented by n+1 points pk,
k=1..(n+1), where each point pk is an n-dimensional vector.
highest point, phi : f(phi) = max(k) f(pk);
lowest point, plo : f(plo) = min(k) f(pk);
centroid, pce : pce = 1/n ∑(k ≠ hi)
pk
- Operations on the simplex:
-
Reflection: phi → pre
= pce + (pce - phi),
Reflection-and-Expansion:
phi → pex = pce +
2(pce - phi),
Contraction: phi → pco = pce +
½(phi - pce),
Reduction: pk≠lo =
1/2(pk+plo), k=1..(n+1)
- Algorithm:
-
do{ try Reflection
if( f(pre)<f(plo) ){ do Reflection-and-Expansion }
elseif( f(pre)<f(phi) ){ do Reflection }
else { try Contraction
if( f(pco)<f(phi) ){do Contraction}
else{ do Reduction }
} until converged
Problems
- Implement the Modified Newton's method and the downhill simplex method
- Solve the system of two equations (1-x)=0, 10(x-y²)=0.
- Find the minimum of a paraboloid f(x,y)=10(x-1)²+20(y-2)².
"Copyleft"
© 2004-2006
D.V.Fedorov
(fedorov at phys dot au dot dk)