Page 1 of 1

2: solve the roots of the equation through iteration methods, Newton, secant method Some hints: import numpy as np impor

Posted: Mon May 02, 2022 12:10 pm
by answerhappygod
2 Solve The Roots Of The Equation Through Iteration Methods Newton Secant Method Some Hints Import Numpy As Np Impor 1
2 Solve The Roots Of The Equation Through Iteration Methods Newton Secant Method Some Hints Import Numpy As Np Impor 1 (37.37 KiB) Viewed 29 times
2: solve the roots of the equation through iteration methods, Newton, secant method Some hints: import numpy as np import matplotlib.pyplot as plt f=lambda x:x**2-2*x xi=lambda x:np.sqrt(2*x) xrange=np.arange(0,5.2,0.1) plt.figure() plt.plot(xrange,f(xrange)) plt.hlines(0,0,plt.xlim([1]) def plot(x,color='g'): plt.hlines(f(x),0,x,color, '--') plt.vlines(x,0,f(x),color, '--')