SlideShare a Scribd company logo
1 of 31
Download to read offline
Numerical Methods I
Solving Nonlinear Equations
Aleksandar Donev
Courant Institute, NYU1
donev@courant.nyu.edu
1Course G63.2010.001 / G22.2420-001, Fall 2010
October 14th, 2010
A. Donev (Courant Institute) Lecture VI 10/14/2010 1 / 31
Outline
1 Basics of Nonlinear Solvers
2 One Dimensional Root Finding
3 Systems of Non-Linear Equations
4 Intro to Unconstrained Optimization
5 Conclusions
A. Donev (Courant Institute) Lecture VI 10/14/2010 2 / 31
Final Presentations
The final project writeup will be due Sunday Dec. 26th by midnight (I
have to start grading by 12/27 due to University deadlines).
You will also need to give a 15 minute presentation in front of me and
other students.
Our last class is officially scheduled for Tuesday 12/14, 5-7pm, and
the final exam Thursday 12/23, 5-7pm. Neither of these are good!
By the end of next week, October 23rd, please let me know the
following:
Are you willing to present early Thursday December 16th during usual
class time?
Do you want to present during the official scheduled last class,
Thursday 12/23, 5-7pm.
If neither of the above, tell me when you cannot present Monday Dec.
20th to Thursday Dec. 23rd (finals week).
A. Donev (Courant Institute) Lecture VI 10/14/2010 3 / 31
Basics of Nonlinear Solvers
Fundamentals
Simplest problem: Root finding in one dimension:
f (x) = 0 with x ∈ [a, b]
Or more generally, solving a square system of nonlinear equations
f(x) = 0 ⇒ fi (x1, x2, . . . , xn) = 0 for i = 1, . . . , n.
There can be no closed-form answer, so just as for eigenvalues, we
need iterative methods.
Most generally, starting from m ≥ 1 initial guesses x0, x1, . . . , xm,
iterate:
xk+1
= φ(xk
, xk−1
, . . . , xk−m
).
A. Donev (Courant Institute) Lecture VI 10/14/2010 4 / 31
Basics of Nonlinear Solvers
Order of convergence
Consider one dimensional root finding and let the actual root be α,
f (α) = 0.
A sequence of iterates xk that converges to α has order of
convergence p > 1 if as k → ∞
xk+1 − α
|xk − α|
p =
ek+1
|ek|
p → C = const,
where the constant 0 < C < 1 is the convergence factor.
A method should at least converge linearly, that is, the error should
at least be reduced by a constant factor every iteration, for example,
the number of accurate digits increases by 1 every iteration.
A good method for root finding coverges quadratically, that is, the
number of accurate digits doubles every iteration!
A. Donev (Courant Institute) Lecture VI 10/14/2010 5 / 31
Basics of Nonlinear Solvers
Local vs. global convergence
A good initial guess is extremely important in nonlinear solvers!
Assume we are looking for a unique root a ≤ α ≤ b starting with an
initial guess a ≤ x0 ≤ b.
A method has local convergence if it converges to a given root α for
any initial guess that is sufficiently close to α (in the neighborhood
of a root).
A method has global convergence if it converges to the root for any
initial guess.
General rule: Global convergence requires a slower (careful) method
but is safer.
It is best to combine a global method to first find a good initial guess
close to α and then use a faster local method.
A. Donev (Courant Institute) Lecture VI 10/14/2010 6 / 31
Basics of Nonlinear Solvers
Conditioning of root finding
f (α + δα) ≈ f (α) + f (α)δα = δf
|δα| ≈
|δf |
|f (α)|
⇒ κabs = f (α)
−1
.
The problem of finding a simple root is well-conditioned when |f (α)|
is far from zero.
Finding roots with multiplicity m > 1 is ill-conditioned:
f (α) = · · · = f (m−1)
(α) = 0 ⇒ |δα| ≈
|δf |
|f m(α)|
1/m
Note that finding roots of algebraic equations (polynomials) is a
separate subject of its own that we skip.
A. Donev (Courant Institute) Lecture VI 10/14/2010 7 / 31
One Dimensional Root Finding
The bisection and Newton algorithms
A. Donev (Courant Institute) Lecture VI 10/14/2010 8 / 31
One Dimensional Root Finding
Bisection
First step is to locate a root by searching for a sign change, i.e.,
finding a0 and b0 such that
f (a0
)f (b0
) < 0.
The simply bisect the interval,
xx
=
ak + bk
2
and choose the half in which the function changes sign by looking at
the sign of f (xk).
Observe that each step we need one function evaluation, f (xk), but
only the sign matters.
The convergence is essentially linear because
xk
− α ≤
bk
2k+1
⇒
xk+1 − α
|xk − α|
≤ 2.
A. Donev (Courant Institute) Lecture VI 10/14/2010 9 / 31
One Dimensional Root Finding
Newton’s Method
Bisection is a slow but sure method. It uses no information about the
value of the function or its derivatives.
Better convergence, of order p = (1 +
√
5)/2 ≈ 1.63 (the golden
ratio), can be achieved by using the value of the function at two
points, as in the secant method.
Achieving second-order convergence requires also evaluating the
function derivative.
Linearize the function around the current guess using Taylor series:
f (xk+1
) ≈ f (xk
) + (xk+1
− xk
)f (xk
) = 0
xk+1
= xk
−
f (xk)
f (xk)
A. Donev (Courant Institute) Lecture VI 10/14/2010 10 / 31
One Dimensional Root Finding
Convergence of Newton’s method
Taylor series with remainder:
f (α) = 0 = f (xk
)+(α−xk
)f (xk
)+
1
2
(α−xk
)2
f (ξ) = 0, for some ξ ∈ [xn, α]
After dividing by f (xk) = 0 we get
xk
−
f (xk)
f (xk)
− α = −
1
2
(α − xk
)2 f (ξ)
f (xk)
xk+1
− α = ek+1
= −
1
2
ek 2 f (ξ)
f (xk)
which shows second-order convergence
xk+1 − α
|xk − α|
2
=
ek+1
|ek|
2
=
f (ξ)
2f (xk)
→
f (α)
2f (α)
A. Donev (Courant Institute) Lecture VI 10/14/2010 11 / 31
One Dimensional Root Finding
Proof of Local Convergence
xk+1 − α
|xk − α|
2
=
f (ξ)
2f (xk)
≤ M = sup
α−|e0|≤x,y≤α+|e0|
f (x)
2f (y)
M xk+1
− α = Ek+1
≤ M xk
− α
2
= Ek 2
which will converge if E0 < 1, i.e., if
x0
− α = e0
< M−1
Newton’s method thus always converges quadratically if we start
sufficiently close to a simple root.
A. Donev (Courant Institute) Lecture VI 10/14/2010 12 / 31
One Dimensional Root Finding
Fixed-Point Iteration
Another way to devise iterative root finding is to rewrite f (x) in an
equivalent form
x = φ(x)
Then we can use fixed-point iteration
xk+1
= φ(xk
)
whose fixed point (limit), if it converges, is x → α.
For example, recall from first lecture solving x2 = c via the
Babylonian method for square roots
xn+1 = φ(xn) =
1
2
c
x
+ x ,
which converges (quadratically) for any non-zero initial guess.
A. Donev (Courant Institute) Lecture VI 10/14/2010 13 / 31
One Dimensional Root Finding
Convergence theory
It can be proven that the fixed-point iteration xk+1 = φ(xk)
converges if φ(x) is a contraction mapping:
φ (x) ≤ K < 1 ∀x ∈ [a, b]
xk+1
−α = φ(xk
)−φ(α) = φ (ξ) xk
− α by the mean value theorem
xk+1
− α < K xk
− α
If φ (α) = 0 near the root we have linear convergence
xk+1 − α
|xk − α|
→ φ (α).
If φ (α) = 0 we have second-order convergence if φ (α) = 0, etc.
A. Donev (Courant Institute) Lecture VI 10/14/2010 14 / 31
One Dimensional Root Finding
Applications of general convergence theory
Think of Newton’s method
xk+1
= xk
−
f (xk)
f (xk)
as a fixed-point iteration method xk+1 = φ(xk) with iteration
function:
φ(x) = x −
f (x)
f (x)
.
We can directly show quadratic convergence because (also see
homework)
φ (x) =
f (x)f (x)
[f (x)]2
⇒ φ (α) = 0
φ (α) =
f (α)
f (α)
= 0
A. Donev (Courant Institute) Lecture VI 10/14/2010 15 / 31
One Dimensional Root Finding
Stopping Criteria
A good library function for root finding has to implement careful
termination criteria.
An obvious option is to terminate when the residual becomes small
f (xk
) < ε,
which is only good for very well-conditioned problems, |f (α)| ∼ 1.
Another option is to terminate when the increment becomes small
xk+1
− xk
< ε.
For fixed-point iteration
xk+1
− xk
= ek+1
− ek
≈ 1 − φ (α) ek
⇒ ek
≈
ε
[1 − φ (α)]
,
so we see that the increment test works for rapidly converging
iterations (φ (α) 1).
A. Donev (Courant Institute) Lecture VI 10/14/2010 16 / 31
One Dimensional Root Finding
In practice
A robust but fast algorithm for root finding would combine bisection
with Newton’s method.
Specifically, a method like Newton’s that can easily take huge steps in
the wrong direction and lead far from the current point must be
safeguarded by a method that ensures one does not leave the search
interval and that the zero is not missed.
Once xk is close to α, the safeguard will not be used and quadratic or
faster convergence will be achieved.
Newton’s method requires first-order derivatives so often other
methods are preferred that require function evaluation only.
Matlab’s function fzero combines bisection, secant and inverse
quadratic interpolation and is“fail-safe”.
A. Donev (Courant Institute) Lecture VI 10/14/2010 17 / 31
One Dimensional Root Finding
Find zeros of a sin(x) + b exp(−x2
/2) in MATLAB
% f=@mfile uses a f u n c t i o n in an m−f i l e
% Parameterized f u n c t i o n s are created with :
a = 1; b = 2;
f = @( x ) a∗ sin ( x ) + b∗exp(−x ˆ2/2) ; % Handle
figure (1)
e z p l o t ( f , [ − 5 , 5 ] ) ; grid
x1=fzero ( f , [ −2 ,0])
[ x2 , f2 ]= fzero ( f , 2.0)
x1 = −1.227430849357917
x2 = 3.155366415494801
f2 = −2.116362640691705e−16
A. Donev (Courant Institute) Lecture VI 10/14/2010 18 / 31
One Dimensional Root Finding
Figure of f (x)
−5 −4 −3 −2 −1 0 1 2 3 4 5
−1
−0.5
0
0.5
1
1.5
2
2.5
x
a sin(x)+b exp(−x
2
/2)
A. Donev (Courant Institute) Lecture VI 10/14/2010 19 / 31
Systems of Non-Linear Equations
Multi-Variable Taylor Expansion
We are after solving a square system of nonlinear equations for
some variables x:
f(x) = 0 ⇒ fi (x1, x2, . . . , xn) = 0 for i = 1, . . . , n.
It is convenient to focus on one of the equations, i.e., consider a
scalar function f (x).
The usual Taylor series is replaced by
f (x + ∆x) = f (x) + gT
(∆x) +
1
2
(∆x)T
H (∆x)
where the gradient vector is
g = xf =
∂f
∂x1
,
∂f
∂x2
, · · · ,
∂f
∂xn
T
and the Hessian matrix is
H = 2
xf =
∂2f
∂xi ∂xj ij
A. Donev (Courant Institute) Lecture VI 10/14/2010 20 / 31
Systems of Non-Linear Equations
Newton’s Method for Systems of Equations
It is much harder if not impossible to do globally convergent methods
like bisection in higher dimensions!
A good initial guess is therefore a must when solving systems, and
Newton’s method can be used to refine the guess.
The first-order Taylor series is
f xk
+ ∆x ≈ f xk
+ J xk
∆x = 0
where the Jacobian J has the gradients of fi (x) as rows:
[J (x)]ij =
∂fi
∂xj
So taking a Newton step requires solving a linear system:
J xk
∆x = −f xk
but denote J ≡ J xk
xk+1
= xk
+ ∆x = xk
− J−1
f xk
.
A. Donev (Courant Institute) Lecture VI 10/14/2010 21 / 31
Systems of Non-Linear Equations
Convergence of Newton’s method
Newton’s method converges quadratically if started sufficiently close
to a root x at which the Jacobian is not singular.
xk+1
− x = ek+1
= xk
− J−1
f xk
− x = ek
− J−1
f xk
but using second-order Taylor series
J−1
f xk
≈ J−1
f (x ) + Jek
+
1
2
ek T
H ek
= ek
+
J−1
2
ek T
H ek
ek+1
=
J−1
2
ek T
H ek
≤
J−1
H
2
ek 2
Fixed point iteration theory generalizes to multiple variables, e.g.,
replace f (α) < 1 with ρ (J(x )) < 1.
A. Donev (Courant Institute) Lecture VI 10/14/2010 22 / 31
Systems of Non-Linear Equations
Problems with Newton’s method
Newton’s method requires solving many linear systems, which can
become complicated when there are many variables.
It also requires computing a whole matrix of derivatives, which can
be expensive or hard to do (differentiation by hand?)
Newton’s method converges fast if the Jacobian J (x ) is
well-conditioned, otherwise it can“blow up”.
For large systems one can use so called quasi-Newton methods:
Approximate the Jacobian with another matrix J and solve
J∆x = f(xk
).
Damp the step by a step length αk 1,
xk+1
= xk
+ αk ∆x.
Update J by a simple update, e.g., a rank-1 update (recall homework
2).
A. Donev (Courant Institute) Lecture VI 10/14/2010 23 / 31
Systems of Non-Linear Equations
In practice
It is much harder to construct general robust solvers in higher
dimensions and some problem-specific knowledge is required.
There is no built-in function for solving nonlinear systems in
MATLAB, but the Optimization Toolbox has fsolve.
In many practical situations there is some continuity of the problem
so that a previous solution can be used as an initial guess.
For example, implicit methods for differential equations have a
time-dependent Jacobian J(t) and in many cases the solution x(t)
evolves smootly in time.
For large problems specialized sparse-matrix solvers need to be used.
In many cases derivatives are not provided but there are some
techniques for automatic differentiation.
A. Donev (Courant Institute) Lecture VI 10/14/2010 24 / 31
Intro to Unconstrained Optimization
Formulation
Optimization problems are among the most important in engineering
and finance, e.g., minimizing production cost, maximizing profits,
etc.
min
x∈Rn
f (x)
where x are some variable parameters and f : Rn → R is a scalar
objective function.
Observe that one only need to consider minimization as
max
x∈Rn
f (x) = − min
x∈Rn
[−f (x)]
A local minimum x is optimal in some neighborhood,
f (x ) ≤ f (x) ∀x s.t. x − x ≤ R > 0.
(think of finding the bottom of a valley)
Finding the global minimum is generally not possible for arbitrary
functions
(think of finding Mt. Everest without a satelite)
A. Donev (Courant Institute) Lecture VI 10/14/2010 25 / 31
Intro to Unconstrained Optimization
Connection to nonlinear systems
Assume that the objective function is differentiable (i.e., first-order
Taylor series converges or gradient exists).
Then a necessary condition for a local minimizer is that x be a
critical point
g (x ) = xf (x ) =
∂f
∂xi
(x )
i
= 0
which is a system of non-linear equations!
In fact similar methods, such as Newton or quasi-Newton, apply to
both problems.
Vice versa, observe that solving f (x) = 0 is equivalent to an
optimization problem
min
x
f (x)T
f (x)
although this is only recommended under special circumstances.
A. Donev (Courant Institute) Lecture VI 10/14/2010 26 / 31
Intro to Unconstrained Optimization
Sufficient Conditions
Assume now that the objective function is twice-differentiable (i.e.,
Hessian exists).
A critical point x is a local minimum if the Hessian is positive
definite
H (x ) = 2
xf (x ) 0
which means that the minimum really looks like a valley or a convex
bowl.
At any local minimum the Hessian is positive semi-definite,
2
xf (x ) 0.
Methods that require Hessian information converge fast but are
expensive (next class).
A. Donev (Courant Institute) Lecture VI 10/14/2010 27 / 31
Intro to Unconstrained Optimization
Direct-Search Methods
A direct search method only requires f (x) to be continuous but
not necessarily differentiable, and requires only function evaluations.
Methods that do a search similar to that in bisection can be devised
in higher dimensions also, but they may fail to converge and are
usually slow.
The MATLAB function fminsearch uses the Nelder-Mead or
simplex-search method, which can be thought of as rolling a simplex
downhill to find the bottom of a valley. But there are many others
and this is an active research area.
Curse of dimensionality: As the number of variables
(dimensionality) n becomes larger, direct search becomes hopeless
since the number of samples needed grows as 2n!
A. Donev (Courant Institute) Lecture VI 10/14/2010 28 / 31
Intro to Unconstrained Optimization
Minimum of 100(x2 − x2
1 )2
+ (a − x1)2
in MATLAB
% Rosenbrock or ’ banana ’ f u n c t i o n :
a = 1;
banana = @( x ) 100∗( x(2)−x (1)ˆ2)ˆ2+(a−x ( 1 ) ) ˆ 2 ;
% This f u n c t i o n must accept a r r a y arguments !
banana xy = @( x1 , x2 ) 100∗( x2−x1 .ˆ2).ˆ2+( a−x1 ) . ˆ 2 ;
f i g u r e ( 1 ) ; e z s u r f ( banana xy , [ 0 , 2 , 0 , 2 ] )
[ x , y ] = meshgrid ( lin spa ce ( 0 , 2 , 1 0 0 ) ) ;
f i g u r e ( 2 ) ; contourf ( x , y , banana xy ( x , y ) ,100)
% Correct answers are x =[1 ,1] and f ( x)=0
[ x , f v a l ] = fminsearch ( banana , [ −1.2 , 1] , optimset ( ’ TolX ’ ,1 e −8))
x = 0.999999999187814 0.999999998441919
f v a l = 1.099088951919573 e−18
A. Donev (Courant Institute) Lecture VI 10/14/2010 29 / 31
Intro to Unconstrained Optimization
Figure of Rosenbrock f (x)
−1
−0.5
0
0.5
1
−2
−1
0
1
2
0
200
400
600
800
x1
100 (x2
−x1
2
)
2
+(a−x1
)
2
x
2
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
A. Donev (Courant Institute) Lecture VI 10/14/2010 30 / 31
Conclusions
Conclusions/Summary
Root finding is well-conditioned for simple roots (unit multiplicity),
ill-conditioned otherwise.
Methods for solving nonlinear equations are always iterative and the
order of convergence matters: second order is usually good enough.
A good method uses a higher-order unsafe method such as Newton
method near the root, but safeguards it with something like the
bisection method.
Newton’s method is second-order but requires derivative/Jacobian
evaluation. In higher dimensions having a good initial guess for
Newton’s method becomes very important.
Quasi-Newton methods can aleviate the complexity of solving the
Jacobian linear system.
A. Donev (Courant Institute) Lecture VI 10/14/2010 31 / 31

More Related Content

What's hot

Maximum likelihood estimation of regularisation parameters in inverse problem...
Maximum likelihood estimation of regularisation parameters in inverse problem...Maximum likelihood estimation of regularisation parameters in inverse problem...
Maximum likelihood estimation of regularisation parameters in inverse problem...Valentin De Bortoli
 
Nature-Inspired Metaheuristic Algorithms for Optimization and Computational I...
Nature-Inspired Metaheuristic Algorithms for Optimization and Computational I...Nature-Inspired Metaheuristic Algorithms for Optimization and Computational I...
Nature-Inspired Metaheuristic Algorithms for Optimization and Computational I...Xin-She Yang
 
Testing for mixtures by seeking components
Testing for mixtures by seeking componentsTesting for mixtures by seeking components
Testing for mixtures by seeking componentsChristian Robert
 
Approximate Bayesian Computation with Quasi-Likelihoods
Approximate Bayesian Computation with Quasi-LikelihoodsApproximate Bayesian Computation with Quasi-Likelihoods
Approximate Bayesian Computation with Quasi-LikelihoodsStefano Cabras
 
PRML Reading Chapter 11 - Sampling Method
PRML Reading Chapter 11 - Sampling MethodPRML Reading Chapter 11 - Sampling Method
PRML Reading Chapter 11 - Sampling MethodHa Phuong
 
Mark Girolami's Read Paper 2010
Mark Girolami's Read Paper 2010Mark Girolami's Read Paper 2010
Mark Girolami's Read Paper 2010Christian Robert
 
Delayed acceptance for Metropolis-Hastings algorithms
Delayed acceptance for Metropolis-Hastings algorithmsDelayed acceptance for Metropolis-Hastings algorithms
Delayed acceptance for Metropolis-Hastings algorithmsChristian Robert
 
Bayesian hybrid variable selection under generalized linear models
Bayesian hybrid variable selection under generalized linear modelsBayesian hybrid variable selection under generalized linear models
Bayesian hybrid variable selection under generalized linear modelsCaleb (Shiqiang) Jin
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
Interpolation with Finite differences
Interpolation with Finite differencesInterpolation with Finite differences
Interpolation with Finite differencesDr. Nirav Vyas
 
Multiple estimators for Monte Carlo approximations
Multiple estimators for Monte Carlo approximationsMultiple estimators for Monte Carlo approximations
Multiple estimators for Monte Carlo approximationsChristian Robert
 
Lecture 04 newton-raphson, secant method etc
Lecture 04 newton-raphson, secant method etcLecture 04 newton-raphson, secant method etc
Lecture 04 newton-raphson, secant method etcRiyandika Jastin
 

What's hot (20)

Maximum likelihood estimation of regularisation parameters in inverse problem...
Maximum likelihood estimation of regularisation parameters in inverse problem...Maximum likelihood estimation of regularisation parameters in inverse problem...
Maximum likelihood estimation of regularisation parameters in inverse problem...
 
Nature-Inspired Metaheuristic Algorithms for Optimization and Computational I...
Nature-Inspired Metaheuristic Algorithms for Optimization and Computational I...Nature-Inspired Metaheuristic Algorithms for Optimization and Computational I...
Nature-Inspired Metaheuristic Algorithms for Optimization and Computational I...
 
Testing for mixtures by seeking components
Testing for mixtures by seeking componentsTesting for mixtures by seeking components
Testing for mixtures by seeking components
 
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
 
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
 
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
 
Numerical method (curve fitting)
Numerical method (curve fitting)Numerical method (curve fitting)
Numerical method (curve fitting)
 
Approximate Bayesian Computation with Quasi-Likelihoods
Approximate Bayesian Computation with Quasi-LikelihoodsApproximate Bayesian Computation with Quasi-Likelihoods
Approximate Bayesian Computation with Quasi-Likelihoods
 
PRML Reading Chapter 11 - Sampling Method
PRML Reading Chapter 11 - Sampling MethodPRML Reading Chapter 11 - Sampling Method
PRML Reading Chapter 11 - Sampling Method
 
Mark Girolami's Read Paper 2010
Mark Girolami's Read Paper 2010Mark Girolami's Read Paper 2010
Mark Girolami's Read Paper 2010
 
QMC: Operator Splitting Workshop, Compactness Estimates for Nonlinear PDEs - ...
QMC: Operator Splitting Workshop, Compactness Estimates for Nonlinear PDEs - ...QMC: Operator Splitting Workshop, Compactness Estimates for Nonlinear PDEs - ...
QMC: Operator Splitting Workshop, Compactness Estimates for Nonlinear PDEs - ...
 
Delayed acceptance for Metropolis-Hastings algorithms
Delayed acceptance for Metropolis-Hastings algorithmsDelayed acceptance for Metropolis-Hastings algorithms
Delayed acceptance for Metropolis-Hastings algorithms
 
Bayesian hybrid variable selection under generalized linear models
Bayesian hybrid variable selection under generalized linear modelsBayesian hybrid variable selection under generalized linear models
Bayesian hybrid variable selection under generalized linear models
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
 
ABC in Venezia
ABC in VeneziaABC in Venezia
ABC in Venezia
 
QMC: Operator Splitting Workshop, Stochastic Block-Coordinate Fixed Point Alg...
QMC: Operator Splitting Workshop, Stochastic Block-Coordinate Fixed Point Alg...QMC: Operator Splitting Workshop, Stochastic Block-Coordinate Fixed Point Alg...
QMC: Operator Splitting Workshop, Stochastic Block-Coordinate Fixed Point Alg...
 
QMC Opening Workshop, High Accuracy Algorithms for Interpolating and Integrat...
QMC Opening Workshop, High Accuracy Algorithms for Interpolating and Integrat...QMC Opening Workshop, High Accuracy Algorithms for Interpolating and Integrat...
QMC Opening Workshop, High Accuracy Algorithms for Interpolating and Integrat...
 
Interpolation with Finite differences
Interpolation with Finite differencesInterpolation with Finite differences
Interpolation with Finite differences
 
Multiple estimators for Monte Carlo approximations
Multiple estimators for Monte Carlo approximationsMultiple estimators for Monte Carlo approximations
Multiple estimators for Monte Carlo approximations
 
Lecture 04 newton-raphson, secant method etc
Lecture 04 newton-raphson, secant method etcLecture 04 newton-raphson, secant method etc
Lecture 04 newton-raphson, secant method etc
 

Similar to Solving Nonlinear Equations and Systems with Numerical Methods

Mit18 330 s12_chapter4
Mit18 330 s12_chapter4Mit18 330 s12_chapter4
Mit18 330 s12_chapter4CAALAAA
 
Approximation Methods Of Solutions For Equilibrium Problem In Hilbert Spaces
Approximation Methods Of Solutions For Equilibrium Problem In Hilbert SpacesApproximation Methods Of Solutions For Equilibrium Problem In Hilbert Spaces
Approximation Methods Of Solutions For Equilibrium Problem In Hilbert SpacesLisa Garcia
 
Newton's Raphson method
Newton's Raphson methodNewton's Raphson method
Newton's Raphson methodSaloni Singhal
 
Newton raphson halley_householder_simpleexplanation
Newton raphson halley_householder_simpleexplanationNewton raphson halley_householder_simpleexplanation
Newton raphson halley_householder_simpleexplanationmuyuubyou
 
Numarical values
Numarical valuesNumarical values
Numarical valuesAmanSaeed11
 
Numarical values highlighted
Numarical values highlightedNumarical values highlighted
Numarical values highlightedAmanSaeed11
 
Numerical_PDE_Paper
Numerical_PDE_PaperNumerical_PDE_Paper
Numerical_PDE_PaperWilliam Ruys
 
On The Generalized Topological Set Extension Results Using The Cluster Point ...
On The Generalized Topological Set Extension Results Using The Cluster Point ...On The Generalized Topological Set Extension Results Using The Cluster Point ...
On The Generalized Topological Set Extension Results Using The Cluster Point ...BRNSS Publication Hub
 
Lesson 5: Continuity (Section 41 slides)
Lesson 5: Continuity (Section 41 slides)Lesson 5: Continuity (Section 41 slides)
Lesson 5: Continuity (Section 41 slides)Mel Anthony Pepito
 
Lesson 5: Continuity (Section 41 slides)
Lesson 5: Continuity (Section 41 slides)Lesson 5: Continuity (Section 41 slides)
Lesson 5: Continuity (Section 41 slides)Matthew Leingang
 
Functionalanalysis ejemplos infinitos
Functionalanalysis ejemplos infinitosFunctionalanalysis ejemplos infinitos
Functionalanalysis ejemplos infinitosSualín Rojas
 
Pinning and facetting in multiphase LBMs
Pinning and facetting in multiphase LBMsPinning and facetting in multiphase LBMs
Pinning and facetting in multiphase LBMsTim Reis
 
Lesson 5: Continuity (Section 21 slides)
Lesson 5: Continuity (Section 21 slides)Lesson 5: Continuity (Section 21 slides)
Lesson 5: Continuity (Section 21 slides)Matthew Leingang
 

Similar to Solving Nonlinear Equations and Systems with Numerical Methods (20)

Mit18 330 s12_chapter4
Mit18 330 s12_chapter4Mit18 330 s12_chapter4
Mit18 330 s12_chapter4
 
Approximation Methods Of Solutions For Equilibrium Problem In Hilbert Spaces
Approximation Methods Of Solutions For Equilibrium Problem In Hilbert SpacesApproximation Methods Of Solutions For Equilibrium Problem In Hilbert Spaces
Approximation Methods Of Solutions For Equilibrium Problem In Hilbert Spaces
 
Newton's Raphson method
Newton's Raphson methodNewton's Raphson method
Newton's Raphson method
 
Unit iv
Unit ivUnit iv
Unit iv
 
Newton raphson halley_householder_simpleexplanation
Newton raphson halley_householder_simpleexplanationNewton raphson halley_householder_simpleexplanation
Newton raphson halley_householder_simpleexplanation
 
Numarical values
Numarical valuesNumarical values
Numarical values
 
Numarical values highlighted
Numarical values highlightedNumarical values highlighted
Numarical values highlighted
 
Diffusion Homework Help
Diffusion Homework HelpDiffusion Homework Help
Diffusion Homework Help
 
Numerical_PDE_Paper
Numerical_PDE_PaperNumerical_PDE_Paper
Numerical_PDE_Paper
 
On The Generalized Topological Set Extension Results Using The Cluster Point ...
On The Generalized Topological Set Extension Results Using The Cluster Point ...On The Generalized Topological Set Extension Results Using The Cluster Point ...
On The Generalized Topological Set Extension Results Using The Cluster Point ...
 
Evaluating definite integrals
Evaluating definite integralsEvaluating definite integrals
Evaluating definite integrals
 
Boyd chap10
Boyd chap10Boyd chap10
Boyd chap10
 
S3-3.pdf
S3-3.pdfS3-3.pdf
S3-3.pdf
 
02_AJMS_278_20.pdf
02_AJMS_278_20.pdf02_AJMS_278_20.pdf
02_AJMS_278_20.pdf
 
Lesson 5: Continuity (Section 41 slides)
Lesson 5: Continuity (Section 41 slides)Lesson 5: Continuity (Section 41 slides)
Lesson 5: Continuity (Section 41 slides)
 
Lesson 5: Continuity (Section 41 slides)
Lesson 5: Continuity (Section 41 slides)Lesson 5: Continuity (Section 41 slides)
Lesson 5: Continuity (Section 41 slides)
 
Es272 ch5b
Es272 ch5bEs272 ch5b
Es272 ch5b
 
Functionalanalysis ejemplos infinitos
Functionalanalysis ejemplos infinitosFunctionalanalysis ejemplos infinitos
Functionalanalysis ejemplos infinitos
 
Pinning and facetting in multiphase LBMs
Pinning and facetting in multiphase LBMsPinning and facetting in multiphase LBMs
Pinning and facetting in multiphase LBMs
 
Lesson 5: Continuity (Section 21 slides)
Lesson 5: Continuity (Section 21 slides)Lesson 5: Continuity (Section 21 slides)
Lesson 5: Continuity (Section 21 slides)
 

More from sheetslibrary

Organizationandmanagement 101113012453-phpapp01
Organizationandmanagement 101113012453-phpapp01Organizationandmanagement 101113012453-phpapp01
Organizationandmanagement 101113012453-phpapp01sheetslibrary
 
Griffin11ech01 150122062422-conversion-gate01
Griffin11ech01 150122062422-conversion-gate01Griffin11ech01 150122062422-conversion-gate01
Griffin11ech01 150122062422-conversion-gate01sheetslibrary
 
Chapter7foundationsofplanningppt07 100224000005-phpapp01
Chapter7foundationsofplanningppt07 100224000005-phpapp01Chapter7foundationsofplanningppt07 100224000005-phpapp01
Chapter7foundationsofplanningppt07 100224000005-phpapp01sheetslibrary
 
Chapter6decisionmakingtheessenceofthemanagersjobppt06 100223215436-phpapp01
Chapter6decisionmakingtheessenceofthemanagersjobppt06 100223215436-phpapp01Chapter6decisionmakingtheessenceofthemanagersjobppt06 100223215436-phpapp01
Chapter6decisionmakingtheessenceofthemanagersjobppt06 100223215436-phpapp01sheetslibrary
 
Chapter02 130706024358-phpapp02
Chapter02 130706024358-phpapp02Chapter02 130706024358-phpapp02
Chapter02 130706024358-phpapp02sheetslibrary
 
Ch2managementhistory 130304100224-phpapp02
Ch2managementhistory 130304100224-phpapp02Ch2managementhistory 130304100224-phpapp02
Ch2managementhistory 130304100224-phpapp02sheetslibrary
 
Ch1introductiontomanagementandorganizations 130304095937-phpapp01
Ch1introductiontomanagementandorganizations 130304095937-phpapp01Ch1introductiontomanagementandorganizations 130304095937-phpapp01
Ch1introductiontomanagementandorganizations 130304095937-phpapp01sheetslibrary
 
Opt simple single_000
Opt simple single_000Opt simple single_000
Opt simple single_000sheetslibrary
 
Introduction to calculus
Introduction to calculusIntroduction to calculus
Introduction to calculussheetslibrary
 
Business math by md aziz
Business math by md azizBusiness math by md aziz
Business math by md azizsheetslibrary
 
Business math by mahmud
Business math by mahmudBusiness math by mahmud
Business math by mahmudsheetslibrary
 
Real number-classification
Real number-classificationReal number-classification
Real number-classificationsheetslibrary
 
Properties of-logarithms
Properties of-logarithmsProperties of-logarithms
Properties of-logarithmssheetslibrary
 
Non linearequationsmatlab
Non linearequationsmatlabNon linearequationsmatlab
Non linearequationsmatlabsheetslibrary
 

More from sheetslibrary (20)

Organizationandmanagement 101113012453-phpapp01
Organizationandmanagement 101113012453-phpapp01Organizationandmanagement 101113012453-phpapp01
Organizationandmanagement 101113012453-phpapp01
 
Griffin11ech01 150122062422-conversion-gate01
Griffin11ech01 150122062422-conversion-gate01Griffin11ech01 150122062422-conversion-gate01
Griffin11ech01 150122062422-conversion-gate01
 
Chapter7foundationsofplanningppt07 100224000005-phpapp01
Chapter7foundationsofplanningppt07 100224000005-phpapp01Chapter7foundationsofplanningppt07 100224000005-phpapp01
Chapter7foundationsofplanningppt07 100224000005-phpapp01
 
Chapter6decisionmakingtheessenceofthemanagersjobppt06 100223215436-phpapp01
Chapter6decisionmakingtheessenceofthemanagersjobppt06 100223215436-phpapp01Chapter6decisionmakingtheessenceofthemanagersjobppt06 100223215436-phpapp01
Chapter6decisionmakingtheessenceofthemanagersjobppt06 100223215436-phpapp01
 
Chapter02 130706024358-phpapp02
Chapter02 130706024358-phpapp02Chapter02 130706024358-phpapp02
Chapter02 130706024358-phpapp02
 
Ch2managementhistory 130304100224-phpapp02
Ch2managementhistory 130304100224-phpapp02Ch2managementhistory 130304100224-phpapp02
Ch2managementhistory 130304100224-phpapp02
 
Ch1introductiontomanagementandorganizations 130304095937-phpapp01
Ch1introductiontomanagementandorganizations 130304095937-phpapp01Ch1introductiontomanagementandorganizations 130304095937-phpapp01
Ch1introductiontomanagementandorganizations 130304095937-phpapp01
 
Singlevaropt
SinglevaroptSinglevaropt
Singlevaropt
 
Opt simple single_000
Opt simple single_000Opt simple single_000
Opt simple single_000
 
Introduction to calculus
Introduction to calculusIntroduction to calculus
Introduction to calculus
 
Intro diffcall3b
Intro diffcall3bIntro diffcall3b
Intro diffcall3b
 
Chap07
Chap07Chap07
Chap07
 
Business math by md aziz
Business math by md azizBusiness math by md aziz
Business math by md aziz
 
Business math by mahmud
Business math by mahmudBusiness math by mahmud
Business math by mahmud
 
02 basics i-handout
02 basics i-handout02 basics i-handout
02 basics i-handout
 
Sets
SetsSets
Sets
 
Real number-classification
Real number-classificationReal number-classification
Real number-classification
 
Properties of-logarithms
Properties of-logarithmsProperties of-logarithms
Properties of-logarithms
 
Non linearequationsmatlab
Non linearequationsmatlabNon linearequationsmatlab
Non linearequationsmatlab
 
New doc 11
New doc 11New doc 11
New doc 11
 

Recently uploaded

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 

Recently uploaded (20)

Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 

Solving Nonlinear Equations and Systems with Numerical Methods

  • 1. Numerical Methods I Solving Nonlinear Equations Aleksandar Donev Courant Institute, NYU1 donev@courant.nyu.edu 1Course G63.2010.001 / G22.2420-001, Fall 2010 October 14th, 2010 A. Donev (Courant Institute) Lecture VI 10/14/2010 1 / 31
  • 2. Outline 1 Basics of Nonlinear Solvers 2 One Dimensional Root Finding 3 Systems of Non-Linear Equations 4 Intro to Unconstrained Optimization 5 Conclusions A. Donev (Courant Institute) Lecture VI 10/14/2010 2 / 31
  • 3. Final Presentations The final project writeup will be due Sunday Dec. 26th by midnight (I have to start grading by 12/27 due to University deadlines). You will also need to give a 15 minute presentation in front of me and other students. Our last class is officially scheduled for Tuesday 12/14, 5-7pm, and the final exam Thursday 12/23, 5-7pm. Neither of these are good! By the end of next week, October 23rd, please let me know the following: Are you willing to present early Thursday December 16th during usual class time? Do you want to present during the official scheduled last class, Thursday 12/23, 5-7pm. If neither of the above, tell me when you cannot present Monday Dec. 20th to Thursday Dec. 23rd (finals week). A. Donev (Courant Institute) Lecture VI 10/14/2010 3 / 31
  • 4. Basics of Nonlinear Solvers Fundamentals Simplest problem: Root finding in one dimension: f (x) = 0 with x ∈ [a, b] Or more generally, solving a square system of nonlinear equations f(x) = 0 ⇒ fi (x1, x2, . . . , xn) = 0 for i = 1, . . . , n. There can be no closed-form answer, so just as for eigenvalues, we need iterative methods. Most generally, starting from m ≥ 1 initial guesses x0, x1, . . . , xm, iterate: xk+1 = φ(xk , xk−1 , . . . , xk−m ). A. Donev (Courant Institute) Lecture VI 10/14/2010 4 / 31
  • 5. Basics of Nonlinear Solvers Order of convergence Consider one dimensional root finding and let the actual root be α, f (α) = 0. A sequence of iterates xk that converges to α has order of convergence p > 1 if as k → ∞ xk+1 − α |xk − α| p = ek+1 |ek| p → C = const, where the constant 0 < C < 1 is the convergence factor. A method should at least converge linearly, that is, the error should at least be reduced by a constant factor every iteration, for example, the number of accurate digits increases by 1 every iteration. A good method for root finding coverges quadratically, that is, the number of accurate digits doubles every iteration! A. Donev (Courant Institute) Lecture VI 10/14/2010 5 / 31
  • 6. Basics of Nonlinear Solvers Local vs. global convergence A good initial guess is extremely important in nonlinear solvers! Assume we are looking for a unique root a ≤ α ≤ b starting with an initial guess a ≤ x0 ≤ b. A method has local convergence if it converges to a given root α for any initial guess that is sufficiently close to α (in the neighborhood of a root). A method has global convergence if it converges to the root for any initial guess. General rule: Global convergence requires a slower (careful) method but is safer. It is best to combine a global method to first find a good initial guess close to α and then use a faster local method. A. Donev (Courant Institute) Lecture VI 10/14/2010 6 / 31
  • 7. Basics of Nonlinear Solvers Conditioning of root finding f (α + δα) ≈ f (α) + f (α)δα = δf |δα| ≈ |δf | |f (α)| ⇒ κabs = f (α) −1 . The problem of finding a simple root is well-conditioned when |f (α)| is far from zero. Finding roots with multiplicity m > 1 is ill-conditioned: f (α) = · · · = f (m−1) (α) = 0 ⇒ |δα| ≈ |δf | |f m(α)| 1/m Note that finding roots of algebraic equations (polynomials) is a separate subject of its own that we skip. A. Donev (Courant Institute) Lecture VI 10/14/2010 7 / 31
  • 8. One Dimensional Root Finding The bisection and Newton algorithms A. Donev (Courant Institute) Lecture VI 10/14/2010 8 / 31
  • 9. One Dimensional Root Finding Bisection First step is to locate a root by searching for a sign change, i.e., finding a0 and b0 such that f (a0 )f (b0 ) < 0. The simply bisect the interval, xx = ak + bk 2 and choose the half in which the function changes sign by looking at the sign of f (xk). Observe that each step we need one function evaluation, f (xk), but only the sign matters. The convergence is essentially linear because xk − α ≤ bk 2k+1 ⇒ xk+1 − α |xk − α| ≤ 2. A. Donev (Courant Institute) Lecture VI 10/14/2010 9 / 31
  • 10. One Dimensional Root Finding Newton’s Method Bisection is a slow but sure method. It uses no information about the value of the function or its derivatives. Better convergence, of order p = (1 + √ 5)/2 ≈ 1.63 (the golden ratio), can be achieved by using the value of the function at two points, as in the secant method. Achieving second-order convergence requires also evaluating the function derivative. Linearize the function around the current guess using Taylor series: f (xk+1 ) ≈ f (xk ) + (xk+1 − xk )f (xk ) = 0 xk+1 = xk − f (xk) f (xk) A. Donev (Courant Institute) Lecture VI 10/14/2010 10 / 31
  • 11. One Dimensional Root Finding Convergence of Newton’s method Taylor series with remainder: f (α) = 0 = f (xk )+(α−xk )f (xk )+ 1 2 (α−xk )2 f (ξ) = 0, for some ξ ∈ [xn, α] After dividing by f (xk) = 0 we get xk − f (xk) f (xk) − α = − 1 2 (α − xk )2 f (ξ) f (xk) xk+1 − α = ek+1 = − 1 2 ek 2 f (ξ) f (xk) which shows second-order convergence xk+1 − α |xk − α| 2 = ek+1 |ek| 2 = f (ξ) 2f (xk) → f (α) 2f (α) A. Donev (Courant Institute) Lecture VI 10/14/2010 11 / 31
  • 12. One Dimensional Root Finding Proof of Local Convergence xk+1 − α |xk − α| 2 = f (ξ) 2f (xk) ≤ M = sup α−|e0|≤x,y≤α+|e0| f (x) 2f (y) M xk+1 − α = Ek+1 ≤ M xk − α 2 = Ek 2 which will converge if E0 < 1, i.e., if x0 − α = e0 < M−1 Newton’s method thus always converges quadratically if we start sufficiently close to a simple root. A. Donev (Courant Institute) Lecture VI 10/14/2010 12 / 31
  • 13. One Dimensional Root Finding Fixed-Point Iteration Another way to devise iterative root finding is to rewrite f (x) in an equivalent form x = φ(x) Then we can use fixed-point iteration xk+1 = φ(xk ) whose fixed point (limit), if it converges, is x → α. For example, recall from first lecture solving x2 = c via the Babylonian method for square roots xn+1 = φ(xn) = 1 2 c x + x , which converges (quadratically) for any non-zero initial guess. A. Donev (Courant Institute) Lecture VI 10/14/2010 13 / 31
  • 14. One Dimensional Root Finding Convergence theory It can be proven that the fixed-point iteration xk+1 = φ(xk) converges if φ(x) is a contraction mapping: φ (x) ≤ K < 1 ∀x ∈ [a, b] xk+1 −α = φ(xk )−φ(α) = φ (ξ) xk − α by the mean value theorem xk+1 − α < K xk − α If φ (α) = 0 near the root we have linear convergence xk+1 − α |xk − α| → φ (α). If φ (α) = 0 we have second-order convergence if φ (α) = 0, etc. A. Donev (Courant Institute) Lecture VI 10/14/2010 14 / 31
  • 15. One Dimensional Root Finding Applications of general convergence theory Think of Newton’s method xk+1 = xk − f (xk) f (xk) as a fixed-point iteration method xk+1 = φ(xk) with iteration function: φ(x) = x − f (x) f (x) . We can directly show quadratic convergence because (also see homework) φ (x) = f (x)f (x) [f (x)]2 ⇒ φ (α) = 0 φ (α) = f (α) f (α) = 0 A. Donev (Courant Institute) Lecture VI 10/14/2010 15 / 31
  • 16. One Dimensional Root Finding Stopping Criteria A good library function for root finding has to implement careful termination criteria. An obvious option is to terminate when the residual becomes small f (xk ) < ε, which is only good for very well-conditioned problems, |f (α)| ∼ 1. Another option is to terminate when the increment becomes small xk+1 − xk < ε. For fixed-point iteration xk+1 − xk = ek+1 − ek ≈ 1 − φ (α) ek ⇒ ek ≈ ε [1 − φ (α)] , so we see that the increment test works for rapidly converging iterations (φ (α) 1). A. Donev (Courant Institute) Lecture VI 10/14/2010 16 / 31
  • 17. One Dimensional Root Finding In practice A robust but fast algorithm for root finding would combine bisection with Newton’s method. Specifically, a method like Newton’s that can easily take huge steps in the wrong direction and lead far from the current point must be safeguarded by a method that ensures one does not leave the search interval and that the zero is not missed. Once xk is close to α, the safeguard will not be used and quadratic or faster convergence will be achieved. Newton’s method requires first-order derivatives so often other methods are preferred that require function evaluation only. Matlab’s function fzero combines bisection, secant and inverse quadratic interpolation and is“fail-safe”. A. Donev (Courant Institute) Lecture VI 10/14/2010 17 / 31
  • 18. One Dimensional Root Finding Find zeros of a sin(x) + b exp(−x2 /2) in MATLAB % f=@mfile uses a f u n c t i o n in an m−f i l e % Parameterized f u n c t i o n s are created with : a = 1; b = 2; f = @( x ) a∗ sin ( x ) + b∗exp(−x ˆ2/2) ; % Handle figure (1) e z p l o t ( f , [ − 5 , 5 ] ) ; grid x1=fzero ( f , [ −2 ,0]) [ x2 , f2 ]= fzero ( f , 2.0) x1 = −1.227430849357917 x2 = 3.155366415494801 f2 = −2.116362640691705e−16 A. Donev (Courant Institute) Lecture VI 10/14/2010 18 / 31
  • 19. One Dimensional Root Finding Figure of f (x) −5 −4 −3 −2 −1 0 1 2 3 4 5 −1 −0.5 0 0.5 1 1.5 2 2.5 x a sin(x)+b exp(−x 2 /2) A. Donev (Courant Institute) Lecture VI 10/14/2010 19 / 31
  • 20. Systems of Non-Linear Equations Multi-Variable Taylor Expansion We are after solving a square system of nonlinear equations for some variables x: f(x) = 0 ⇒ fi (x1, x2, . . . , xn) = 0 for i = 1, . . . , n. It is convenient to focus on one of the equations, i.e., consider a scalar function f (x). The usual Taylor series is replaced by f (x + ∆x) = f (x) + gT (∆x) + 1 2 (∆x)T H (∆x) where the gradient vector is g = xf = ∂f ∂x1 , ∂f ∂x2 , · · · , ∂f ∂xn T and the Hessian matrix is H = 2 xf = ∂2f ∂xi ∂xj ij A. Donev (Courant Institute) Lecture VI 10/14/2010 20 / 31
  • 21. Systems of Non-Linear Equations Newton’s Method for Systems of Equations It is much harder if not impossible to do globally convergent methods like bisection in higher dimensions! A good initial guess is therefore a must when solving systems, and Newton’s method can be used to refine the guess. The first-order Taylor series is f xk + ∆x ≈ f xk + J xk ∆x = 0 where the Jacobian J has the gradients of fi (x) as rows: [J (x)]ij = ∂fi ∂xj So taking a Newton step requires solving a linear system: J xk ∆x = −f xk but denote J ≡ J xk xk+1 = xk + ∆x = xk − J−1 f xk . A. Donev (Courant Institute) Lecture VI 10/14/2010 21 / 31
  • 22. Systems of Non-Linear Equations Convergence of Newton’s method Newton’s method converges quadratically if started sufficiently close to a root x at which the Jacobian is not singular. xk+1 − x = ek+1 = xk − J−1 f xk − x = ek − J−1 f xk but using second-order Taylor series J−1 f xk ≈ J−1 f (x ) + Jek + 1 2 ek T H ek = ek + J−1 2 ek T H ek ek+1 = J−1 2 ek T H ek ≤ J−1 H 2 ek 2 Fixed point iteration theory generalizes to multiple variables, e.g., replace f (α) < 1 with ρ (J(x )) < 1. A. Donev (Courant Institute) Lecture VI 10/14/2010 22 / 31
  • 23. Systems of Non-Linear Equations Problems with Newton’s method Newton’s method requires solving many linear systems, which can become complicated when there are many variables. It also requires computing a whole matrix of derivatives, which can be expensive or hard to do (differentiation by hand?) Newton’s method converges fast if the Jacobian J (x ) is well-conditioned, otherwise it can“blow up”. For large systems one can use so called quasi-Newton methods: Approximate the Jacobian with another matrix J and solve J∆x = f(xk ). Damp the step by a step length αk 1, xk+1 = xk + αk ∆x. Update J by a simple update, e.g., a rank-1 update (recall homework 2). A. Donev (Courant Institute) Lecture VI 10/14/2010 23 / 31
  • 24. Systems of Non-Linear Equations In practice It is much harder to construct general robust solvers in higher dimensions and some problem-specific knowledge is required. There is no built-in function for solving nonlinear systems in MATLAB, but the Optimization Toolbox has fsolve. In many practical situations there is some continuity of the problem so that a previous solution can be used as an initial guess. For example, implicit methods for differential equations have a time-dependent Jacobian J(t) and in many cases the solution x(t) evolves smootly in time. For large problems specialized sparse-matrix solvers need to be used. In many cases derivatives are not provided but there are some techniques for automatic differentiation. A. Donev (Courant Institute) Lecture VI 10/14/2010 24 / 31
  • 25. Intro to Unconstrained Optimization Formulation Optimization problems are among the most important in engineering and finance, e.g., minimizing production cost, maximizing profits, etc. min x∈Rn f (x) where x are some variable parameters and f : Rn → R is a scalar objective function. Observe that one only need to consider minimization as max x∈Rn f (x) = − min x∈Rn [−f (x)] A local minimum x is optimal in some neighborhood, f (x ) ≤ f (x) ∀x s.t. x − x ≤ R > 0. (think of finding the bottom of a valley) Finding the global minimum is generally not possible for arbitrary functions (think of finding Mt. Everest without a satelite) A. Donev (Courant Institute) Lecture VI 10/14/2010 25 / 31
  • 26. Intro to Unconstrained Optimization Connection to nonlinear systems Assume that the objective function is differentiable (i.e., first-order Taylor series converges or gradient exists). Then a necessary condition for a local minimizer is that x be a critical point g (x ) = xf (x ) = ∂f ∂xi (x ) i = 0 which is a system of non-linear equations! In fact similar methods, such as Newton or quasi-Newton, apply to both problems. Vice versa, observe that solving f (x) = 0 is equivalent to an optimization problem min x f (x)T f (x) although this is only recommended under special circumstances. A. Donev (Courant Institute) Lecture VI 10/14/2010 26 / 31
  • 27. Intro to Unconstrained Optimization Sufficient Conditions Assume now that the objective function is twice-differentiable (i.e., Hessian exists). A critical point x is a local minimum if the Hessian is positive definite H (x ) = 2 xf (x ) 0 which means that the minimum really looks like a valley or a convex bowl. At any local minimum the Hessian is positive semi-definite, 2 xf (x ) 0. Methods that require Hessian information converge fast but are expensive (next class). A. Donev (Courant Institute) Lecture VI 10/14/2010 27 / 31
  • 28. Intro to Unconstrained Optimization Direct-Search Methods A direct search method only requires f (x) to be continuous but not necessarily differentiable, and requires only function evaluations. Methods that do a search similar to that in bisection can be devised in higher dimensions also, but they may fail to converge and are usually slow. The MATLAB function fminsearch uses the Nelder-Mead or simplex-search method, which can be thought of as rolling a simplex downhill to find the bottom of a valley. But there are many others and this is an active research area. Curse of dimensionality: As the number of variables (dimensionality) n becomes larger, direct search becomes hopeless since the number of samples needed grows as 2n! A. Donev (Courant Institute) Lecture VI 10/14/2010 28 / 31
  • 29. Intro to Unconstrained Optimization Minimum of 100(x2 − x2 1 )2 + (a − x1)2 in MATLAB % Rosenbrock or ’ banana ’ f u n c t i o n : a = 1; banana = @( x ) 100∗( x(2)−x (1)ˆ2)ˆ2+(a−x ( 1 ) ) ˆ 2 ; % This f u n c t i o n must accept a r r a y arguments ! banana xy = @( x1 , x2 ) 100∗( x2−x1 .ˆ2).ˆ2+( a−x1 ) . ˆ 2 ; f i g u r e ( 1 ) ; e z s u r f ( banana xy , [ 0 , 2 , 0 , 2 ] ) [ x , y ] = meshgrid ( lin spa ce ( 0 , 2 , 1 0 0 ) ) ; f i g u r e ( 2 ) ; contourf ( x , y , banana xy ( x , y ) ,100) % Correct answers are x =[1 ,1] and f ( x)=0 [ x , f v a l ] = fminsearch ( banana , [ −1.2 , 1] , optimset ( ’ TolX ’ ,1 e −8)) x = 0.999999999187814 0.999999998441919 f v a l = 1.099088951919573 e−18 A. Donev (Courant Institute) Lecture VI 10/14/2010 29 / 31
  • 30. Intro to Unconstrained Optimization Figure of Rosenbrock f (x) −1 −0.5 0 0.5 1 −2 −1 0 1 2 0 200 400 600 800 x1 100 (x2 −x1 2 ) 2 +(a−x1 ) 2 x 2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 A. Donev (Courant Institute) Lecture VI 10/14/2010 30 / 31
  • 31. Conclusions Conclusions/Summary Root finding is well-conditioned for simple roots (unit multiplicity), ill-conditioned otherwise. Methods for solving nonlinear equations are always iterative and the order of convergence matters: second order is usually good enough. A good method uses a higher-order unsafe method such as Newton method near the root, but safeguards it with something like the bisection method. Newton’s method is second-order but requires derivative/Jacobian evaluation. In higher dimensions having a good initial guess for Newton’s method becomes very important. Quasi-Newton methods can aleviate the complexity of solving the Jacobian linear system. A. Donev (Courant Institute) Lecture VI 10/14/2010 31 / 31