5/3/2023 0 Comments Bisection method pseudocode![]() ![]() ![]() cos ( x ) - x ** 3 if x is not None else None p0 = p1 = pnew = q0 = f ( p0 ) q1 = f ( p1 ) for _ in range ( 100 ): if p1 is not None and p0 is not None : p = p1 - q1 * ( p1 - p0 ) / ( q1 - q0 ) if np. close ( "all" ) ani2 = FuncAnimation ( fig, animate, frames = len ( p ), interval = 1600 ) ani2ĭef secant_zero_animate ( p0, p1 ): f = lambda x : np. sin ( x ) if x is not None else None for i in range ( 15 ): x = p if p is not None else p xold = x x = x - f ( x ) / fprime ( x ) p. cos ( x ) - x ** 3 if x is not None else None fprime = lambda x : - 3 * x ** 2 - np. append ( p ) count = 0 subcount = 0 a_label = b_label = p_label = for _ in range ( len ( a )): a_label. append ( a + ( b - a ) / 2 ) FP = f ( p ) if np. cos ( x ) - x ** 3 if x is not None else None FA = f ( a ) for i in range ( 20 ): p. rc ( "animation", html = "jshtml" ) a = b = p = f = lambda x : np. Import numpy as np import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation import matplotlib matplotlib. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |