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...
-
Use the data in Problem 15.17 to compute a regression model after recoding the data by the first-differences approach. Compute a Durbin-Watson statistic to determine whether significant...
-
DNS uses UDP instead of TCP. If a DNS packet is lost, there is no automatic recovery. Does this cause a problem, and if so, how is it solved?
-
The ABC Company has collected the following data concerning performance in its manufacturing plant: Required a. Prepare a traditional performance report (comparing actual to budget). Which processes...
-
For each of the six independent situations below, compute the missing amounts. a. Using contribution margin per unit: b. Using the contribution marginratio: Contribution Margin Ratio Fixed Costs...
-
50 Which one of the following is NOT an accurate statement regarding Destination reports? A) The most popular tab of a Destination Reports is a Multi-Segment tab, where the recipient can specify...
-
Toledo Custom Manufacturing (TCM) makes machined steel parts to customer specification. They have a variety of machines that can hold tight tolerances. In this case they have just received an order...
-
Wildhorse Inc. reports the following pretax income (loss) for both financial reporting purposes and tax purposes. Year 2018 2019 2020 2021 Pretax Income (Loss) $112,000 Tax Rate 17% 97,000 17%...
-
What problem is associated with including recommendations in audit findings? How does the Standards for the Professional Practice of Internal Auditing address the question of making audit...
-
In auditing ICFR for a public company client, Emily finds that the com- pany has a significant subsidiary located in a foreign country. Emily's accounting firm has no offices in that country, and the...
-
What are the five components of an audit finding?
-
Audit evidence concerning proper segregation of duties ordinarily is best obtained by a. Inspection of documents prepared by a third party, but which contain the initials of those applying client...
-
AnnaLisa, an auditor for N. M. Neal & Associates, is prevented by the management of Lileah Company from auditing controls over inventory. Lileah is a public company. Management explains that controls...
-
You are an analyst with a REIT fund, and you have just been asked to take over the valuation models of ten REITs. Your fund house uses a NAV model and a fair value model built from EVA. Your...
-
What is a manufacturing system?
-
Clean-N-Brite is a multiproduct company with several manufacturing plants. The Cincinnati plant manufactures and distributes two household cleaning and polishing compounds, regular and heavy-duty,...
-
Southern Aurora Limited (SAL) is a large Sydney-based financial institution that operates internationally. It has also established strategic alliances with a number of financial institutions based in...
-
You are the manager of internal audit for the Department of Transport, which is a major government department within your state. You have an internal audit staff of five professionals. Two are senior...
Study smarter with the SolutionInn App