Please need help 1. Problems in one variable: a. Construct MATLAB code for Newto
ID: 3197076 • Letter: P
Question
Please need help
1. Problems in one variable:
a. Construct MATLAB code for Newton’s Method to find the minimum value of the function: f(x) = x3 - 7x2 + 11x – 5, for initial points x0 = 2, 7
b. Construct MATLAB code for Line-Search Method to find the minimum value of the function: f(x) = x3 - 7x2 + 11x – 5, for initial points x0 = 2, 7.
2. Problems in several variables:
a. Construct MATLAB code for Newton Method to find a root of the function: f(z) = [x + y - 3; x2 +y22 -9] = [0;0].
b. Construct MATLAB code for Line-Search Method to find a root of the function: f(z) = [x + y - 3; x2 +y22 -9] = [0;0].
3.
a. Construct MATLAB code for Newton Method to find the minimum of the function: f(z) = 3x2 + 2xy + y2; use initial value, Xo = [1;1].
b. Construct MATLAB code for Line-Search Method to find the minimum of the function: f(z) = 3x2 + 2xy + y2; use initial value, Xo = [1;1].
Thank you.
Explanation / Answer
1(a)
1(b).figure; hold on;
end.
2(a).z = 0; %initial value x0
while (0) z(i+1) = h(z(i)); %with this program, you can find out the number of iterations it takes to get to a certain amount of sig figs. This line prints out a value of z based on i and i+1 error = abs((z(i+1)-z(i))/z(i)); %you print out a bunch of numbers with your function starting with i = 0, and you use the previous value and the current value in your absolute error equation if error < 0; break end i = i + 1; %iteration counter (if your (if error < 0;) fails the condition, then it goes straight to this line and goes back to the line right after the while loop with the new (i) value end disp (i)
2(b).
figure; hold on;
3(a).
3(b) x0 = [1,1];
.function f = objectivefcn1(x)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.