If True, raise a RuntimeError if the algorithm didn’t converge, with If True and x0 is non-scalar, the return value is (x, converged, zero_der) (see Returns section for details). Is the root and r is a RootResults object. If True and x0 is scalar, the return value is (x, r), where x If full_output is False (default), the root is returned. If it is not None, then Halley’s methodĪnother estimate of the root that should be somewhere near theĪctual root. If it is None (default), then the normal Newton-Raphson ![]() The second order derivative of the function when available andĬonvenient. If func is complex-valued,Ī larger tol is recommended as both the real and imaginary parts args tuple, optionalĮxtra arguments to be used in the function call. Is None (default), then the secant method is used. ![]() The derivative of the function when available and convenient. If not scalar, then func must be vectorized and returnĪ sequence or array of the same shape as its first argument. x0 float, sequence, or ndarrayĪn initial estimate of the root that should be somewhere near theĪctual root. Single variable of the form f(x,a,b,c.), where a,b,c.Īre extra arguments that can be passed in the args parameter. For problems involving several variables, see root. Newton is for finding roots of a scalar-valued functions of a single (second) derivative of func with respect to its only variable evaluated Then its return must also have the same shape: each element is the first In this case, func must be vectorized to return a sequence or array of The roots of the function from each (scalar) starting point in x0. If x0 is a sequence with more than one item, newton returns an array: ![]() If the second orderĭerivative fprime2 of func is also provided, then Halley’s method is Is provided, otherwise the secant method is used. The Newton-Raphson method is used if the derivative fprime of func newton ( func, x0, fprime = None, args = (), tol = 1.48e-08, maxiter = 50, fprime2 = None, x1 = None, rtol = 0.0, full_output = False, disp = True ) #įind a root of a real or complex function using the Newton-Raphsonįind a root of the scalar-valued function func given a nearby scalar
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |