Menu

(Solved) : 1 Create File Matlab Workspace Named Newtonmem Containing Following 5 0 Program Program1 S Q32646509 . . .

Numerical analysis / matlab question
(Question 2)

1. Create a file, in your Matlab workspace, named newtonme.m containing the following 5 0, for program (program1) for solving the equation2352 2r12 f-iliex 4-2 x 3-5x 2+12*x-5); fd=inline(41x^ 3-61x^ 2-101x+12); p0-0.2 tol= 10^ (-5) disp(sprintf(%5d % 14.9f % 14.9f,npo.f(pd)))) disp(sprintf(%5d %14.9f%14.9f pdf(po))) n-n+1 p-po-f(p0)/fd(po); disp(sprintf(%3d %14.9f%14.9f,n,p.f(p))) while (ni-50 &abs(p-po)i,tol) n=n+1; p=pd)-f(pd))/fd(pd)); disp(sprintf(%3d %14.9f%14.9f,n,p,f(p))) end (a) Run programl for p (b) Run program 1 for ㎕ = 0.75 and Tol = 10(-5). How rnany iterations does your (c) Modify the program to approximate a root of the equation: e2727r*e* 0.2 and Tol-10(5). How many iterations does your program take to converge to the solution p? program take to converge to the solution p? 9x2e2z 0, for 3 < x < 5, to within 10-5. 2. Repeat exercisel using modified Newtons method. Is there an improvement in speed of convergence over exercise 1?1. Create a file, in your Matlab workspace, named newtonme.m containing the following 5 0, for program (program1) for solving the equation2352 2r12 f-iliex 4-2 x 3-5x 2+12*x-5″); fd=inline(’41x^ 3-61x^ 2-101x+12); p0-0.2 tol= 10^ (-5) disp(sprintf(%5d % 14.9f % 14.9f’,npo.f(pd)))) disp(sprintf(“%5d %14.9f%14.9f pdf(po))) n-n+1 p-po-f(p0)/fd(po); disp(sprintf(“%3d %14.9f%14.9f’,n,p.f(p))) while (ni-50 &abs(p-po)i,tol) n=n+1; p=pd)-f(pd))/fd(pd)); disp(sprintf(“%3d %14.9f%14.9f’,n,p,f(p))) end (a) Run programl for p (b) Run program 1 for ㎕ = 0.75 and Tol = 10″(-5). How rnany iterations does your (c) Modify the program to approximate a root of the equation: e2727r*e* 0.2 and Tol-10(5). How many iterations does your program take to converge to the solution p? program take to converge to the solution p? 9x2e2z 0, for 3 < x < 5, to within 10-5. 2. Repeat exercisel using modified Newton’s method. Is there an improvement in speed of convergence over exercise 1? Show transcribed image text

Expert Answer


Answer to 1 Create File Matlab Workspace Named Newtonmem Containing Following 5 0 Program Program1 S Q32646509 . . .

OR