False Position Method In Python | Numerical Methods

Поделиться
HTML-код
  • Опубликовано: 17 янв 2025

Комментарии • 7

  • @antekkalafior
    @antekkalafior 3 года назад +1

    Love the video! Very clearly and professionally explained.

  • @developerx962
    @developerx962 3 года назад

    The doctor asked me to do it, but based on the estimated error, not the error, and it was resolved successfully. Thank you very much for this wonderful video, sir.😍

  • @remziogultum6697
    @remziogultum6697 2 года назад

    this video is just next level thank you so much

  • @amenehameri
    @amenehameri 6 месяцев назад

    so helpful tanks

  • @bramgriffioen5436
    @bramgriffioen5436 3 года назад +1

    Thank you !

  • @developerx962
    @developerx962 3 года назад +1

    thank you alot

  • @samramzi4639
    @samramzi4639 Год назад

    def False_Position_Method(func,a,b,error_accept):
    """
    This function solves for an unknown root of non-linear funktion given the function, the initial root boundaries,
    and an acceptable level of error.
    Parameters
    ----------
    func : The user defined function, witch needs to be entered as a string.
    a : The inital lower root boundray.
    b : The inital upper root boundray.
    error_accept : The user's acceptable level of error
    Returns
    -------
    f : The root boundraies and the error at the final iteration.
    """


    def f(x):
    f=eval(func)
    return f

    i=0
    c_before=0
    c=(a*f(b)-b*f(a))/(f(b)-f(a))
    error=(c-c_before)

    while error > error_accept:
    c_after=(a*f(b)-b*f(a))/(f(b)-f(a))

    if f(a)*f(b)>=0:
    print("No root multiple roots present, therefore, the bisection method will not work!")
    quit()

    elif f(c_after)*f(a)