Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Write a function M-file to solve min f(x) 1 by the exact gradient descent method, where f(2)= TAc and A is one of the
1. Write a function M-file to solve min f(x) 1 by the exact gradient descent method, where f(2)= TAc and A is one of the following SPD matrices [92] 21 8 41 18] 2 6 8 9 18 14 (This is a strictly convex problem, the minimizer is r* = 0 and the minimum is 0.) The first line of your M-file should read function (x,min, err,iter] = Exact Gradient_ (x0, tol,N,A) The sub-functions that compute the gradient descent direction and f(x + a) are as follows. function p=GD (x) p=-A*x; end function y=f(x,p, alpha) z=x+alpha*p; y=.5*Z' *A*Z; end Use the initial guess 2) x0= and set N to be 200 and the tolerance to be 10-10 in your computations. Create a diary (HW3Diary-) that records your computations. You diary should contain the results for all three choices of A. (You will get bonus points by including in the diary some brief comments on what you have observed.) Email your M-file and diary as separate attachments
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