Bisection Method In Python | Numerical Methods

Поділитися
Вставка
  • Опубліковано 7 лис 2024

КОМЕНТАРІ • 22

  • @antekkalafior
    @antekkalafior 3 роки тому +41

    You Sir just explained in 3 minutes stuff that my professor tried to explain for 30 minutes and nobody understood. Thank you!

    • @StudySessionYT
      @StudySessionYT  3 роки тому +3

      Im glad you found the video helpful! Thanks for watching!

  • @wshcc1156
    @wshcc1156 3 роки тому +17

    It is insane how well this video is made

    • @StudySessionYT
      @StudySessionYT  3 роки тому +4

      Thank you very much, im glad you found the video helpful!

  • @samramzi4639
    @samramzi4639 11 місяців тому +9

    def bisection_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

    error=abs(b-a)

    while error > error_accept:
    c=(b+a)/2

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

    elif f(c)*f(a)

  • @cristianortiz3349
    @cristianortiz3349 3 роки тому +1

    I will use this video as a reference to my project

  • @nathanaeltomaterado9452
    @nathanaeltomaterado9452 2 роки тому +2

    Sir is it possible to create a user input for the equation that users want to give?

  • @BankoleAyodeleMEG
    @BankoleAyodeleMEG 2 роки тому +2

    Nice video. I feel it would have been nice if it just printed the final root out
    And also please can you provide the code

    • @jzyhere
      @jzyhere Місяць тому

      Outside the while loop use this statement : root = (a + b) / 2 and also include print(root) this will give u the final root also.

  • @pedrobrant9564
    @pedrobrant9564 2 роки тому

    what if I need to use cos(x) and sin(x) in my function? does the eval work? Thanks for the video.

  • @richardpatove4587
    @richardpatove4587 11 місяців тому

    how to determine a and b programmaticaly

  • @cristianortiz3349
    @cristianortiz3349 3 роки тому +2

    Very nice explanation!

  • @AhsanJannat
    @AhsanJannat 3 роки тому +1

    thank you for the video

  • @masnunahmedsporsho612
    @masnunahmedsporsho612 2 роки тому +1

    nice work man

  • @mohamedameen6585
    @mohamedameen6585 3 роки тому +1

    Which editer did u use it

  • @_.sunnyraj._
    @_.sunnyraj._ 8 місяців тому +1

    AYe thanks !

  • @developerx962
    @developerx962 3 роки тому

    💙Thank alot that is amazing, thank you for your time 💙

  • @relyn5544
    @relyn5544 2 роки тому

    KT'den saygılarla

  • @ramkrishnakondeti6597
    @ramkrishnakondeti6597 2 роки тому