Question

In: Advanced Math

Use the golden Section search method to find the minimum of f(x)= x/5−sin(x) . Start with...

Use the golden Section search method to find the minimum of f(x)= x/5−sin(x) . Start with the range of 0 to 3, i.e., xl=0, xu=3 . Show two iterations of the Golden Section Search Method by populating the following Table. Again please do all calculations in MATLAB and make sure you have included it in your submission.

i xl f(xl) x2 f(x2) x1 f(x1) xu f(xu) d

Solutions

Expert Solution

%matlab programe

clear all
close all
f=@(x) x/5-sin(x);
xl=0;
xu=3;
tol = 0.00000001; % tolarance   
N = 10; % iterations
tau = 0.618; %golden number
k=0;
x1=xl+(1-tau)*(xu-xl);
x2=xl+tau*(xu-xl);
f1=f(x1);   
f2=f(x2);


while ((abs(xu-xl)>tol) && (k<N))
k=k+1
xl
xu
if(f1<f2)
xu=x2;
x2=x1;
x1=xl+(1-tau)*(xu-xl);
  
f1=f(x1);
f2=f(x2);
  
  
else
xl=x1;
x1=x2;
x2=xl+tau*(xu-xl);
  
f1=f(x1);
f2=f(x2);

end
  

if(f1<f2)
  
minimum_at_point_x1 = x1
minimumValu = f1
  
else
minimum_at_point_x2 = x2
minimumValue = f2
  
end

  
end

output

k =  1
xl = 0
xu =  3
minimum_at_point_x2 =  1.1460
minimumValue = -0.68192
k =  2
xl = 0
xu =  1.8540
minimum_at_point_x2 =  1.4163
minimumValue = -0.70483
k =  3
xl =  0.70823
xu =  1.8540
minimum_at_point_x1 =  1.4163
minimumValu = -0.70483
k =  4
xl =  1.1460
xu =  1.8540
minimum_at_point_x2 =  1.4163
minimumValue = -0.70483
k =  5
xl =  1.1460
xu =  1.5835
minimum_at_point_x1 =  1.4163
minimumValu = -0.70483
k =  6
xl =  1.3131
xu =  1.5835
minimum_at_point_x1 =  1.3770
minimumValu = -0.70588
k =  7
xl =  1.3131
xu =  1.4803
minimum_at_point_x2 =  1.3770
minimumValue = -0.70588
k =  8
xl =  1.3131
xu =  1.4163
minimum_at_point_x1 =  1.3770
minimumValu = -0.70588
k =  9
xl =  1.3526
xu =  1.4163
minimum_at_point_x1 =  1.3676
minimumValu = -0.70591
k =  10
xl =  1.3526
xu =  1.3920
minimum_at_point_x2 =  1.3676
minimumValue = -0.70591

Related Solutions

use muller's method to find the roots of the equation f(x) = sin x - x/2...
use muller's method to find the roots of the equation f(x) = sin x - x/2 =0 near x=2
On Matlab use BFGS Method to find the minimum of the following function: f(x) = x13...
On Matlab use BFGS Method to find the minimum of the following function: f(x) = x13 - 2x2x12 + x12 - x1using initial point (x0, y0) = (1, 2)T to start, and stop when f changes less than 0.0001
Use false position method to find the root of ?(?) = −sin(? − 5) + ?...
Use false position method to find the root of ?(?) = −sin(? − 5) + ? with initial guesses of 0.2 and 1. Show up to three iterations and calculate the relative percent error ?? for each iteration possible? Show full details for at least one iteration to get full points. Also, if three significant figure accuracy is required, show if the value after third iteration is acceptable or not.
Give me a working MATLAB code for the Golden section search method . It should be...
Give me a working MATLAB code for the Golden section search method . It should be working Dont answer if you do not know, the code must work for the golden section method
Find the absolute maximum and absolute minimum values of f(x) = cos(2x)+2 sin(x) in the interval...
Find the absolute maximum and absolute minimum values of f(x) = cos(2x)+2 sin(x) in the interval [0; pi]
Q1. The normal distribution is a bell-shaped curve defined by: y=e^(〖-x〗^2 ) Use the golden-section search...
Q1. The normal distribution is a bell-shaped curve defined by: y=e^(〖-x〗^2 ) Use the golden-section search to determine the location of the inflection point of this curve for positive x. PLEASE do the iterations on excel and show the written text in the cells. Thank you!
Find the root of the function f(x) = 8 - 4.5 ( x - sin x...
Find the root of the function f(x) = 8 - 4.5 ( x - sin x ) in the interval [2,3]. Exhibit a numerical solution using Newton method.
Find the linearization at x=a. f(x)=sin^7(x), a=π/4, (Use symbolic notation and fractions where needed.) Find the...
Find the linearization at x=a. f(x)=sin^7(x), a=π/4, (Use symbolic notation and fractions where needed.) Find the linearization of y=e^(√7x) at x=36. (Use symbolic notation and fractions where needed.)
Use the Fixed-Point Iteration Method to find the root of f ( x ) = x...
Use the Fixed-Point Iteration Method to find the root of f ( x ) = x e^x/2 + 1.2 x - 5 in the interval [1,2].
In Sciland code, use the Newton Method to find the root of f(x)=10-x^2 and tol =10^-5
In Sciland code, use the Newton Method to find the root of f(x)=10-x^2 and tol =10^-5
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT