Create a script in MATLAB function x = Newton_method (f, df, x0, Tol, MaxIter ) % %
Fantastic news! We've Found the answer you've been seeking!
Question:
Create a script in MATLAB
Transcribed Image Text:
function x = Newton_method (f, df, x0, Tol, MaxIter ) % % NEWTON Newton's Method % Newton's method for finding successively better approximations to the zeroes of a real-valued function. % % % Inputs: % f solve f(x)=0 % df derivative of f(x) % ΧΘ % Tol % % % Output: % X- a root of f(x)=0 % - end initial guess stopping tolerance MaxIter maximum number of iterations nit=0;%number of iterations X disp('step| disp(' while 1 ·|· x = x0 - f(x0)/df(x0); nit=nit+1; | | break end if abs(x-x0) <Tol f(x) ') if nit>MaxIter disp('Maximum number of iterations is reached!') creat a script for this code on matlab disp('The sequence is convergent!') break end x0=X; fprintf('%3i | %12.8f %12.8f\n', nit, x, f(x)) function x = Newton_method (f, df, x0, Tol, MaxIter ) % % NEWTON Newton's Method % Newton's method for finding successively better approximations to the zeroes of a real-valued function. % % % Inputs: % f solve f(x)=0 % df derivative of f(x) % ΧΘ % Tol % % % Output: % X- a root of f(x)=0 % - end initial guess stopping tolerance MaxIter maximum number of iterations nit=0;%number of iterations X disp('step| disp(' while 1 ·|· x = x0 - f(x0)/df(x0); nit=nit+1; | | break end if abs(x-x0) <Tol f(x) ') if nit>MaxIter disp('Maximum number of iterations is reached!') creat a script for this code on matlab disp('The sequence is convergent!') break end x0=X; fprintf('%3i | %12.8f %12.8f\n', nit, x, f(x))
Expert Answer:
Answer rating: 100% (QA)
Newtons Method This script implements Newtons Method for finding successive... View the full answer
Posted Date:
Students also viewed these programming questions
-
Develop a MATLAB script that plots the function dy/dx versus x (with appropriate labels) and use bisect new to determine the point of maximum deflection (i.e., the value of x where dy/dx = 0). Then...
-
nd C) Use the IVP Solver script in MATLAB to plot solutions to your system with small, varying choices of the damping coefficient c. Use the hold on command to plot many different solution curves on...
-
Write a MATLAB script to plot the efficiency as a function of electric power output for the induction generator of Problem 6.17 as the slip varies from -0.5 to -3.2 percent. Assume the generator to...
-
CASE STUDY 1: Facebook, Cambridge Analytica and Trump Scandal: Lessonfor Government, Business, Consumers and Voters. In early 2018, Facebook admitted to mishandling datafrom over 50 million Facebook...
-
Several years ago, Mary Emerson founded Emerson Consulting Inc., a consulting business specializing in financial planning for young professionals. The following captions and amounts summarize Emerson...
-
Morro Bay Surfboards manufactures fiberglass surfboards. The standard cost of direct materials and direct manufacturing labor is $225 per board. This includes 30 pounds of direct materials, at the...
-
Journal entries perpetual inventory system Non-GST version Record the following transactions in the general journal of Camberwell Ltd using the perpetual inventory system (assume GST does not...
-
The Fashion Rack has a monthly accounting period. All transactions are recorded in a general journal. Postings are made from the general journal to the accounts receivable ledger, accounts payable...
-
6. An igloo, a hemispherical enclosure built of ice (1.67 J/m-sC), has as inner radius of 2.50m. The thickness of the ice is 0.5m. At what rate must thermal energy be generated to maintain the air...
-
George Pharmacy is a pharmaceutical salesman who has been very successful at his job in the last few years. Unfortunately, his family life has not been very happy. Three years ago, his only child,...
-
Electrons generated by the Compton effect inside a carbon block (graphite) have an initial kinetic energy of 20MEV. Using the table below, the approximate range of electrons in carbon (in cm), the...
-
VR technology was developed decades ago; in fact, a computer engineer and author named Jeron Lanier coined the term virtual reality in 1987. That was two years after Lanier left his job at Atari to...
-
Explain the stages a company goes through as its management orientation evolves from domestic and ethnocentric to global and geocentric.
-
Explain how a nation can achieve competitive advantage, and list the forces that may be present in a national diamond.
-
It is a safe bet that most people reading this textbook are familiar with Red Bull. The $6.4 billion company that largely created the market for energy drinks revels in its association with cultural...
-
In November 2015, VW faced even more bad news. It was revealed that some three-liter, six-cylinder engines in cars produced by Audi, one of Volkswagen AGs luxury brands, also contained defeat...
-
Depreciation Methods A machine with a 4-year estimated useful life and an estimated 15% residual value was acquired on January 1. Would depreciation expense using the sum-of-the-years'-digits method...
-
In the operation of an automated production line with storage buffers, what does it mean if a buffer is nearly always empty or nearly always full?
-
Consider the situation illustrated in Figure 25. 11. A positively charged particle is lifted against the uniform electric field of a negatively charged plate. Ignoring any gravitational interactions,...
-
A positively charged particle is moved from point A to point B in the electric field of the massive, stationary, positively charged object in Figure 25. 12. (a) Is the electrostatic work done on the...
-
The negative terminal of a \(9-\mathrm{V}\) battery is connected to ground via a wire. (a) What is the potential of the negative terminal? (b) What is the potential of the positive terminal? (c) What...
Study smarter with the SolutionInn App