Optimization Toolbox Previous page   Next Page

Nonlinear Equations with Analytic Jacobian

This example demonstrates the use of the default medium-scale fsolve algorithm. It is intended for problems where

The example uses fsolve to obtain the minimum of the banana (or Rosenbrock) function by deriving and then solving an equivalent system of nonlinear equations. The Rosenbrock function, which has a minimum at , is a common test problem in optimization. It has a high degree of nonlinearity and converges extremely slowly if you try to use steepest descent type methods. It is given by

First generalize this function to an n-dimensional function, for any positive, even value of n:

This function is referred to as the generalized Rosenbrock function. It consists of n squared terms involving n unknowns.

Before you can use fsolve to find the values of such that , i.e., obtain the minimum of the generalized Rosenbrock function, you must rewrite the function as the following equivalent system of nonlinear equations:

This system is square, and you can use fsolve to solve it. As the example demonstrates, this system has a unique solution given by .

Step 1: Write an M-file bananaobj.m to compute the objective function values and the Jacobian.

Step 2: Call the solve routine for the system of equations.

Use the starting point for the odd indices, and for the even indices. Accept the fsolve default 'off' for the LargeScale parameter, and the default medium-scale nonlinear equation algorithm 'dogleg'. Then set Jacobian to 'on' to use the Jacobian defined in bananaobj.m . The fsolve function generates the following output:


Previous page  Additional Arguments: Avoiding Global Variables Nonlinear Equations with Finite-Difference Jacobian Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS