4.0

4.0 | 1 rating Rate this file 175 downloads (last 30 days) File Size: 2.29 KB File ID: #22640

Steepest Accent Method

by Siamak Faridani

 

10 Jan 2009

No BSD License  

Solves multivariant unconstrained optimization using the Steepest Accent Method

Download Now | Watch this File

File Information
Description

For more information refer to "Nonlinear Programming: Theory and Algorithms" by by Mokhtar S. Bazaraa , Hanif D. Sherali , C. M. Shetty

Here is the sample output
Steepest Accent Method
=============
Function = (3*x1+x2+6*x1*x2-2*(x1^2)+2*(x2^2))
Hessian......
 
                    [-4 6]
                    [ ]
                    [ 6 4]
Gradient......
 
                    [3 + 6 x2 - 4 x1]
                    [ ]
                    [1 + 6 x1 + 4 x2]
Eigen Values
[ 2*13^(1/2), 0]
[ 0, -2*13^(1/2)]
 
f(x0)=-5.000000
_________________________________________
Iteration = 1
Gradient of X0
     7
    -5

X0 =
    -1
     0

X0 - alpha. gradient(X0) =
 -1+7*alpha
   -5*alpha
 
f(X0 - alpha. gradient(X0)) =
-3+16*alpha-30*(-1+7*alpha)*alpha-2*(-1+7*alpha)^2+50*alpha^2
 
diff(f(X0 - alpha. gradient(X0)))/diff alpha =
74-516*alpha
 
 
alphaval =
 
37/258
 
 

alphaval2 =

   0.143410852713178

x1 =
   0.003875968992248
  -0.717054263565892

f(x2)=0.306202
_________________________________________
Iteration = 2
Gradient of X1
  -1.317829457364341
  -1.844961240310078

X1 =
   0.003875968992248
  -0.717054263565892

X1 - alpha. gradient(X1) =
    1/258-170/129*alpha
 -185/258-238/129*alpha
 
f(X1 - alpha. gradient(X1)) =
-91/129-748/129*alpha+6*(1/258-170/129*alpha)*(-185/258-238/129*alpha)-2*(1/258-170/129*alpha)^2+2*(-185/258-238/129*alpha)^2
 
diff(f(X1 - alpha. gradient(X1)))/diff alpha =
85544/16641+4624/129*alpha
 
 
alphaval =
 
-37/258
 
 

alphaval2 =

  -0.143410852713178

MATLAB release MATLAB 7.5 (R2007b)
Other requirements May need symbolic toolbox based on your Matlab version
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
01 May 2009 Duc

Run with
x01=1;
x02=2;

and

a='10*(2*x1-5)^2+2*(3*x2-6)^2';
 
then I get an error:
alphaval =
 
C_
 
??? Error using ==> evalin
Undefined function or variable 'C_'.

01 May 2009 Duc

untitle4.m
function Untitled4()
syms alpha
f='alpha'
diff(f,alpha)
%error!!

untitle4p.m
syms alpha
f='alpha'
diff(f,alpha)
%get expected result

untitle5.m
function Untitled4()
syms alpha1
f='alpha1'
diff(f,alpha1)
%get expected result

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
optimization Siamak Faridani 12 Jan 2009 16:11:29
nonlinear Siamak Faridani 12 Jan 2009 16:11:29
steepest methods Siamak Faridani 12 Jan 2009 16:11:29
accent method Siamak Faridani 12 Jan 2009 16:11:29
decent method Siamak Faridani 12 Jan 2009 16:11:29
optimization Cristina McIntire 15 Jan 2009 13:04:28
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com