Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task is to find approximations to optimal solution, graident and hessian that minimizes the function, through steepest decent method. My working so far : function
Task is to find approximations to optimal solution, graident and hessian that minimizes the function, through steepest decent method.
My working so far :
function SteepestDMethodFinal
Initial point
x; ; ;
Function handle for the objective function
f @xx xx xxxxxxx;
Gradient of the objective function
gradf @xx x;
x xx;
xx;
steepest decent method
xopt, fopt, gradopt SteepestDMethodf gradf x;
Display results
dispApproximated Optimal point:;
dispxopt;
dispApproximated Function value at optimal point:;
dispfopt;
dispApproximated Gradient at optimal point:;
dispgradopt;
end
function xopt, fopt, gradopt SteepestDMethodf gradf x
Parameters
tol e;
maxiter ;
Initialization
x x;
g gradfx;
d g;
k ;
while normg tol && k maxiter
Line search to find optimal step size alpha
alpha fminbnd@a fx ad;
Update the point
x x alpha d;
Compute new gradient
gnew gradfx;
Update the direction
d g;
Update the gradient
g gnew;
Increment iteration counter
k k ;
end
Optimal values
xopt x;
fopt fxopt;
gradopt g;
end
Question : has my code which uses steepest decent method done approximating the optimal soultion and gradient correctly
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started