Bisection Method In Python | Numerical Methods

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ก.ย. 2024

ความคิดเห็น • 22

  • @antekkalafior
    @antekkalafior 3 ปีที่แล้ว +40

    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 2 ปีที่แล้ว +17

    It is insane how well this video is made

    • @StudySessionYT
      @StudySessionYT  2 ปีที่แล้ว +4

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

  • @samramzi4639
    @samramzi4639 9 หลายเดือนก่อน +8

    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?

  • @cristianortiz3349
    @cristianortiz3349 3 ปีที่แล้ว +2

    Very nice explanation!

  • @masnunahmedsporsho612
    @masnunahmedsporsho612 2 ปีที่แล้ว +1

    nice work man

  • @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 8 ชั่วโมงที่ผ่านมา

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

  • @AhsanJannat
    @AhsanJannat 3 ปีที่แล้ว +1

    thank you for the video

  • @developerx962
    @developerx962 2 ปีที่แล้ว

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

  • @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 9 หลายเดือนก่อน

    how to determine a and b programmaticaly

  • @mohamedameen6585
    @mohamedameen6585 3 ปีที่แล้ว +1

    Which editer did u use it

    • @FandiM666
      @FandiM666 3 ปีที่แล้ว +2

      Pycharm

  • @_.sunnyraj._
    @_.sunnyraj._ 6 หลายเดือนก่อน +1

    AYe thanks !

  • @relyn5544
    @relyn5544 ปีที่แล้ว

    KT'den saygılarla

  • @ramkrishnakondeti6597
    @ramkrishnakondeti6597 2 ปีที่แล้ว