Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2: Newton's Method (4 points) known as the Newton-Raphson method) is an iterative way to find the roots of a function hat is, the

image text in transcribed
image text in transcribed
image text in transcribed
Question 2: Newton's Method (4 points) known as the Newton-Raphson method) is an iterative way to find the roots of a function hat is, the values of x such that )0. The idea is this: given a function, f(x), take an initial guess of the roots, o. You can then find your next guess as f(Xo) Wheref '(x) is the donative/(x).f(x) will be closer to 0 than/(xo) Your original guess does not have to be close to an actual root, it will converge regardless For a more detailed description of the algorithm, see write a function, newton t, tprime, eps) that takes a function, its deneative, and a tolerance as output, and returns a value of x that evat to unt Note: remember that you can approach O from either side. fx) -30 is most certainly less than like. eps 0,001, but much further from 0 than we'd Note: The above are lambda functions, and behave just like regular functions when you call them. 72 +3(71+2=72 In [152): | n(7)-= 72 Outl152: True In (153): Deftining functions for second test case from math import log 9 lambda x: log(x) gp lambda x: 1/x abs(g(newtonlg, gp, 0.0001))0.0001 -153-1590a9798219> in 7 absiglnewtong, gp, 0.0001)) in dambda>(x) 1 # Defining functions for second test case >3 g lambda x: logix) In [154) # Fnctions for third test case. t need to get "close enough" # Note there isn't actually a 0 for this from math importe def hlx): function, you ust return e*x # Test case h(newton(h, hprime, 0.000001) in 7 absiglnewtong, gp, 0.0001)) in dambda>(x) 1 # Defining functions for second test case >3 g lambda x: logix) In [154) # Fnctions for third test case. t need to get "close enough" # Note there isn't actually a 0 for this from math importe def hlx): function, you ust return e*x # Test case h(newton(h, hprime, 0.000001)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions