Question: 2. Use MATLAB to plot the function f(x)-(5-x) exp(x)-5 for x between 0 and 5. (This function is associated with the Wien radiation law, which

2. Use MATLAB to plot the function f(x)-(5-x) exp(x)-5 for x between 0 and 5. (This function is associated with the Wien radiation law, which gives a method to estimate the surface temperature of a star.) (a) Write a bisection routine or use routine bisect available from the book's web page to find a root of f(r) in the interval [4, 5], accurate to six decimal places (i.e., find an interval of width at most 106 that contains the root, so that the midpoint of this interval is within 5 10-7 of the root). At each step, print out the endpoints of the smallest interval known to contain a root. Without running the code further, answer the following: How many steps would be required to reduce the size of this interval to 10-122 Explain your answer (b) Write a routine to use Newton's method or use routine newton available from the book's web page to find a root off(x), using initial guess x0 = 5, Print out your approximate solution X and the value of ) at each step and run until f) 108. Without running the code further, but perhaps using information from your code about the rate at which(xk] is reduced, can you estimate how many more steps would be required to make | f(x s 10-16 (assuming that your machine carried enough decimal places to do this)? Explain your answer (c) Take your routine for doing Newton's method and modify it to run the secant method. Repeat the run of part (b), using. say, Xo 4 and x1 = 5, and again predict (without running the code further) how many steps would be required to reduce() below 10-16 (assuming that your machine carried enough decimal places to do this) using the secant method. Explain your answer 2. Use MATLAB to plot the function f(x)-(5-x) exp(x)-5 for x between 0 and 5. (This function is associated with the Wien radiation law, which gives a method to estimate the surface temperature of a star.) (a) Write a bisection routine or use routine bisect available from the book's web page to find a root of f(r) in the interval [4, 5], accurate to six decimal places (i.e., find an interval of width at most 106 that contains the root, so that the midpoint of this interval is within 5 10-7 of the root). At each step, print out the endpoints of the smallest interval known to contain a root. Without running the code further, answer the following: How many steps would be required to reduce the size of this interval to 10-122 Explain your answer (b) Write a routine to use Newton's method or use routine newton available from the book's web page to find a root off(x), using initial guess x0 = 5, Print out your approximate solution X and the value of ) at each step and run until f) 108. Without running the code further, but perhaps using information from your code about the rate at which(xk] is reduced, can you estimate how many more steps would be required to make | f(x s 10-16 (assuming that your machine carried enough decimal places to do this)? Explain your answer (c) Take your routine for doing Newton's method and modify it to run the secant method. Repeat the run of part (b), using. say, Xo 4 and x1 = 5, and again predict (without running the code further) how many steps would be required to reduce() below 10-16 (assuming that your machine carried enough decimal places to do this) using the secant method. Explain your
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
