2. Use MATLAB to plot the function f(x) = (5 - x) exp(x)-5, for x between...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 tempera- ture 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(x) in the interval [4, 5], accurate to six decimal places (i.e., find an interval of width at most 10-0 that contains the root, so that the midpoint of this interval is within 5 x 10-7 of the root). At each step, print out the end- points of the smallest interval known to con- tain a root. Wwithout running the code further, answer the following: How many steps would be required to reduce the size of this interval to 1012? 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 of f(x), using initial guess Xo = 5. Print out your approximate solution x and the value of f(xp) at each step and run %3D until |f(x) s 10-8. Without running the code further, but perhaps using information from your code about the rate at which | f(xp) is re- duced, can you estimate how many more steps would be required to make | f(xpl s 10-16 (assuming that your machine carried enough decimal places to do this)? Explain your an- swer. (c) Take your routine for doing Newton's method and modify it to run the secant method. Re- peat the run of part (b), using, say, xo = 4 and %3D X1 = 5, and again predict (without running the code further) how many steps would be required to reduce |f(x) below 10 16 (assum- ing that your machine carried enough decimal places to do this) using the secant method. Ex- plain 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 tempera- ture 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(x) in the interval [4, 5], accurate to six decimal places (i.e., find an interval of width at most 10-0 that contains the root, so that the midpoint of this interval is within 5 x 10-7 of the root). At each step, print out the end- points of the smallest interval known to con- tain a root. Wwithout running the code further, answer the following: How many steps would be required to reduce the size of this interval to 1012? 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 of f(x), using initial guess Xo = 5. Print out your approximate solution x and the value of f(xp) at each step and run %3D until |f(x) s 10-8. Without running the code further, but perhaps using information from your code about the rate at which | f(xp) is re- duced, can you estimate how many more steps would be required to make | f(xpl s 10-16 (assuming that your machine carried enough decimal places to do this)? Explain your an- swer. (c) Take your routine for doing Newton's method and modify it to run the secant method. Re- peat the run of part (b), using, say, xo = 4 and %3D X1 = 5, and again predict (without running the code further) how many steps would be required to reduce |f(x) below 10 16 (assum- ing that your machine carried enough decimal places to do this) using the secant method. Ex- plain your answer.
Expert Answer:
Answer rating: 100% (QA)
Please find below the required MATLAB Code for part a and b clear all close all clc syms x f symfun5... View the full answer
Related Book For
Campbell Biology
ISBN: 978-0321775658
10th edition
Authors: Jane B. Reece, Lisa A. Urry, Michael L. Cain, Steven A. Wasserman, Peter V. Minorsky, Robert B. Jackson
Posted Date:
Students also viewed these economics questions
-
How many turns of wire would be required to make a 130-mH inductance out of a 30.0-cm-long air-filled coil with a diameter of 5.2 cm?
-
Can you estimate how much time passed between the development of character 2 and character 4? Explain.
-
If f is a continuous function from X to Y, the graph of f, graph(f) = {x, y) : y = f (x), x X} is a closed subset of X Y. The converse of this result is not true in general. The following exercise...
-
In the Akerlof example, the individuals are treated as indifferent to risk. What would you expect to see in these markets if individuals wanted to avoid risk? What if there were some risk lovers?
-
Consider the feedback system shown in Figure DP7.14. The process transfer function is marginally stable. The controller is the proportional-derivative (PD) controller Gc(s) = KP + KDs. (a) Determine...
-
What is the mass of a cubic meter of air at 25 C and 1 atm? How many times greater is the mass of a cubic meter of liquid water? Assume the density of water is approximately 1000 kg/m 3 . * 1m 1 m K...
-
Palanquin Auto is a national pre-owned car retailer that offers an online marketplace for customers interested in purchasing a preowned automobile. In an effort to reduce price negotiation, Palanquin...
-
Susan Robinson is planning for her retirement. She is 30 years old today and would like to have $600,000 when she turns 55. She estimates that she will be able to earn a 9 percent rate of return on...
-
7. Answer for the following reaction CH3ONa a) Is this reaction SN/E1 or SN/E2 Br (2 points) b) For the reaction draw a mechanism for the substitution product and the elimination product. (4 points)...
-
Today is May 17, 2023, and you, CPA, are a Senior Tax Associate at Borden & Laurier LLP. Sylvie Condurache, Tax Manager, has called you into her office to discuss a long-time client: "I just got out...
-
Solve the following initial value problem using Laplace transforms: y/"-6y + 15y 2 sin(3t), y(0) = -1, y(0) = 4
-
Andy applies for a custodial supervisor position with a school district in Texas. The job description states that a preferred qualification is that the candidate be fluent in both English and Spanish...
-
Choose one of the companies you regularly patronize (e.g., Facebook, the Gap, etc.). Using information contained on the company website along with news sources, assess the extent to which the company...
-
A. In 2015, the Canadian province of British Columbia enacted regulations applicable to the sale of wine. Only wine produced in British Columbia could be sold on grocery store shelves. Wine produced...
-
What proposals are being made to reform the Copyright Act?
-
a. Solve the linear system \(\mathbf{A x}=\mathbf{b}\) by using Cramer's rule. b. \(\uparrow\) Repeat (a) in MATLAB. \(\mathbf{A}=\left[\begin{array}{ccc}1 & 5 & 0 \\ -1 & 2 & 1 \\ -2 & 5 &...
-
Ann and Bart each sent 25 identical marbles to the warehouse. Carl and Dave each sent 35 marbles. By agreement, all of the marbles were all put into one bin and commingled. Ann snuck in one night to...
-
Wholesalers Ltd. deals in the sale of foodstuffs to retailers. Owing to economic depression, the firm intends to relax its credit policy to boost productivity and sales. The firms current credit...
-
The wall space for the mural measures 10 feet high by 20 feet wide. You wish to include a 40-m-tall lycophyte and a giant horsetail at 15 meters tall. To determine which of the magnifications would...
-
You can determine both the image magnification and the size of a fossil specimen if an object of known size is included in the image. In following figure , the penny has a known diameter of 0.75 in....
-
List all the pairs of animal groups that share a more recent common ancestor than humans and birds.
-
A sinusoidal electromagnetic wave has a maximum electric field magnitude of \(E_{\max }=500 \mathrm{~N} / \mathrm{C}\). What is the root-mean-square value of the electric field?
-
A home microwave oven typically uses \(2.45-\mathrm{GHz}\) microwaves, and a microwave oven in a restaurant kitchen is more likely to run at \(915 \mathrm{MHz}\). Calculate the wavelength for each...
-
By focusing an ultraviolet laser pulse, you can produce an apparently hovering plasma point in midair. If it takes an electric field magnitude of \(1.0 \times 10^{6} \mathrm{~N} / \mathrm{C}\) to...
Study smarter with the SolutionInn App