The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Matlab assignment : There is 2 PDF files attached to this homework. One is for the requirements and the other describes the “Newton-Raphson” method of finding a root of an equation. This assignment has to have a function and sub functions.
Once done with the code please test it with the given inputs and match it out with the outputs in table 6.2.
I would a code for this assignment.
BSEN212A Assignment 7Due February 5, 2016February 1, 2016The .pdf attached to your assignment–NewtonRaphsonMethodRootFinding.pdf–describes the “Newton-Raphson”method of finding a root of an equation. (At some points in the document, Newton-Raphson is contrasted with anothermethod called the ‘Bisection Method’ –don’t worry about the latter method.)The purpose of this assignment is to write a MATLAB function that executes the Newton-Raphson method, using theflowchart on the third page as help (but see below!)1.Write a root finder that inputs an ‘initial guess’ and an ‘accuracy’ to which you would like the root solved.2.Rewrite a good-engineering-computing pseudocode, using the flowchart on the third page, BUT using awhileloop as the main iteration. (Hint: you won’t start where the flowchart says “Start.”)(Another hint: when do youwant the while loop to stop? As soon as you have achieved the accuracy entered in.)3.Usesubfunctionsto calculate f(x)and f’(x)a.In particular, do not use any MATLAB ‘symbolic’functions to calculate derivatives. That is, you willnot be using something not covered in this class, like ‘syms’or ‘diff’. When you write the derivativesubfunction, you will take a derivative with pencil and paper, and then plug that expression directly intothe subfunction.4.On every iteration, display the current x value, y value, and current root guess (corresponding toxi,y, andxninthe handout)5.Using steps 1-4, find a root of equation 6.20, with an initial guess of 10 and an accuracy of 1e-10. Your outputshould match values from Table 6.2.6.Using steps 1-4, find a root of± ²ln3yxx³´with an initial guess of 10 and an accuracy of 1e-10. Note thatyou will have to change your subfunctions! (That is, with new analytical expressions.) Your output should looklike this:>> find_root(10,1e-10);Iteration 1:x_i = 10.0000f(x_i) = -4.6974x_n = 4.7807Iteration 2:x_i = 4.7807f(x_i) = -0.2161x_n = 4.5074Iteration 3:x_i = 4.5074f(x_i) = -0.0017x_n = 4.5052Iteration 4:x_i = 4.5052f(x_i) = -0.0000x_n = 4.5052found_root = 4.5052(Hint: to line up things nicely infprintforsprintf, use the \t delimiter as a ‘tab’ character)As always, turn in a good report including pseudocode, code (you can turn in one .m file, parts 5 and 6 could bedifferent commented/uncommented lines for the specific functions/subfunctions), and a diary of yourinput/output.
Attachments:
-----------