Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
restrepo
GitHub Repository: restrepo/ComputationalMethods
Path: blob/master/homework/homework_2018_1_02_1038414799.ipynb
934 views
Kernel: Python 3
%pylab inline from scipy import optimize
Populating the interactive namespace from numpy and matplotlib
#Finding the roots of a function using fixed point method def f(x): return x - (x**2)*np.cos(2*x) s=optimize.fixed_point(f,(-1,0.1,1)) print("The roots of the function are: {}".format(s))
The roots of the function are: [ -7.85398163e-01 1.27870763e-09 7.85398163e-01]