Bisection method Definition and 29 Threads

  1. CandidFlakes

    I Why is (a+b)/2 not recommended in the Bisection method?

    The image attached above from a textbook, explains that we should refrain from using (a+b)/2 while applying Bisection method but I am unable to get the reason why it is asking to do so? While the image above is from another textbook. This book uses (a+b)/2. I am really confused by two different...
  2. P

    MHB Lachlan's question via email about the Bisection Method

    The Bisection Method solves equations of the form $\displaystyle f\left( x \right) = 0 $ so we must write the equation as $\displaystyle 11\cos{ \left( x \right) } - 1 + 2\,\mathrm{e}^{-x/10} = 0 $. We can then see that $\displaystyle f\left( x \right) = 11\cos{ \left( x \right) } - 1 +...
  3. P

    MHB Lachlan's question via email about the Bisection Method

    The Bisection Method is used to solve equations of the form $\displaystyle f\left( x \right) = 0 $, so we need to rewrite the equation as $\displaystyle 8\cos{ \left( x \right) } - \mathrm{e}^{-x/7} = 0 $. Thus $\displaystyle f\left( x \right) = 8\cos{ \left( x \right) } - \mathrm{e}^{-x/7} $...
  4. V

    Python Is My Python Bisection Method Code Correct?

    import math def poly(x): return (x**4 + 2*x**3 - 7*x**2 - 8*x + 12) def bisect(f,a,b,tol=1e-6): while (b-a)>tol: m=(a+b)/2 if (f(a)>=0>=f(m)) or (f(a)<=0<=f(m)): b=m else: a=m return (f(a),a) print(bisect(poly,-4,-2.5)) Here is...
  5. S

    Fortran Getting my method of bisection to output the correct value

    I am trying to write a program that calculates the root of chi-square. I am not getting the correct answer and I honestly am at my wits end trying to figure it out. I know my simp_p() method is returning the correct value, but for some reason my root_chisq() method is not giving me the correct...
  6. R

    Manipulating an inequality in the bisection method

    Homework Statement This is a homework problem for a numerical analysis class. Use the following theorem to find bounds for the number of iterations needed to achieve an approximation with accuracy 10^-5 to the solution of the equation given in part (a) lying in the intervals [-3,-2] and...
  7. Hi Im Paul

    Python What's wrong with my bisection method code?

    Hello, I am assigned to write a code using bisection method (aka binary search method) The equation is 10sin(x) - x^3 - N where N = 1,2,3,4,5,6,7 My code is from math import sin def neg(a, b): return a*b> 0 def bisectx(funcx, lowx, highx,n): assert not neg(funcx(lowx,n), funcx(highx,n))...
  8. Leonardo Machado

    Why Isn't My Bisection Program Updating Variables Correctly?

    Hello guys ! May you help me with this little bisection program ? For some reason it is not changing the value of the variables x0 and x1 after every loop :c #include <iostream> #include <cmath> #include <fstream> using namespace std; int main () { double x, x0, x1, f, f0, f1...
  9. F

    Bisection Method Homework: a=-2, b=2, Is b-a=1?

    Homework Statement In the first photo , interval [-2 ,2 ] means a = -2 , b = 2 , am i right ? So , how to show that b-a = 1 ? Homework EquationsThe Attempt at a Solution IMO , b-a = 2+ 2 = 4 for part b , why b - a = -1-(-2) ? Is there anything wrong with this question ?
  10. R

    MATLAB Bisection method and numerical integration

    In Matlab I am trying to use the composite Simpson's rule to find ##x_l## so that $$170=\int^{x_l}_0 \sqrt{1+(y')^2} dx = \int^{x_l}_0 \sqrt{1+\left( \frac{x^2}{68000} \right)^2} dx $$ For convenience this can be written as $$I(x) = 170 - \int^x_0 \sqrt{1 + (\frac{x^2}{68000})} dx$$ The...
  11. ramzerimar

    Numerically find temperature in function of concentration....

    Homework Statement I don't even know if this is the correct forum for this question, but here we go. This exercise is from my numerical methods for engineers class, and it says the following: The coefficient of saturation of oxygen dissolved in fresh water is given by the equation: $$...
  12. S

    MATLAB Script for Bisection Method

    Homework Statement Not really for homework, but it is a script I am working on. It involves utilizing the Bisection Method for solving equations in one variable. However, I cannot seem to get it to work properly. It seems to enter the while loop and become stuck their. When I execute it by...
  13. N

    Bisection method and multiple roots

    Hello, I have a polynomial of order n and I want to find all it's roots with bisection method. Is it possible? I already wrote an algorithm to find a root and it's works nice for finding one of it's roots, but what about others? Nikola
  14. fluidistic

    Fortran What's causing my Fortran bisection method to give incorrect results?

    I'm rusty with fortran and programming in general. I can't see my "error" in a code that I wrote from scratch. Basically I wanted to get some fun and solve for a temperature in thermodynamics where I must get "T_f" which appear in a transcendental equation: ##A\ln \left ( \frac{T_f^2}{T_1T_2}...
  15. D

    Write a program using Bisection method and method of false position.

    Hello everyone. I'm new here and I'm not not a computer science student. But, I have to take programming to complete my degree. So, now I'm in a great depression about this assignment. My lecturer ask me to write a program to find root of an equation f(x)=0 for specific f. Both methods are...
  16. J

    Fortran What's Wrong with My Fortran 90 Bisection Method Code?

    Bisection method for the equation x3−2x−2 = 0 which has a single root between x=−4 and x = 2. here's the code I have program bisection2 implicit none real :: fxa, xnew, xu, xl, fxb, fnew xu=4 xl=2 1 xnew=(xu+xl)/2 fxa=(xnew**3-(2*xnew)-2) fxb=(xl**3-(2*xl)-2)...
  17. R

    MATLAB Implementing Bisection Method in Matlab: Troubleshooting Error Message

    Here is the code I have, but I keep getting the error message: Undefined function 'f' for input arguments of type 'double'. I don't know what I have that is causing this. Does anybody see what's wrong with my code? MaxIt = 1000; epsilon = 10^-5; a=1; b=2; c = (b+a)/2; NumIt = 0...
  18. S

    Comp Sci Bisection Method for Finding Roots of x^3+4x^2-x-1 in C++

    Homework Statement find the roots ( interval halving ) , I want to know how to make a condition statement that when fun3 be less than 0.001 and then loop will stop and i get the root .(here in my code i don't know why the loop doesn't work as it should .. Homework Equations the...
  19. K

    Bisection Method in C to Find Root of x^4+x^3-12x^2-2x+10

    Hi guys, I'm doing an assignment for working out a certain root of a given function, x^4+x^3-12x^2-2x+10, to a precision of 10-6. We are asked to give two limits of where we want to find a root between but I'm getting stuck. I was just wondering if any of you could look at my code and maybe...
  20. M

    Comp Sci FORTRAN Help: Bisection Method & Roots of Functions

    Homework Statement The purpose of this program is to calculate the approximate roots of the Sine function on given intervals. The intervals are input by the user, and then the do loop continues until the condition (m becomes very close to 0 or equals 0) is met. The Attempt at a Solution...
  21. A

    Convergence of Bisection Method

    Homework Statement Show that the Bisection Method converges linearly with K = 1/2 Homework Equations Note that x(sub n) converges to the exact root r with an order of convergence p if: lim(n->oo) (|r - x(n + 1)|) / (|r - x(n)|^p) = lim(n->oo) (|e(n + 1)|) / (|e(n)|^p) = K The...
  22. P

    Bounded intervals in R and bisection method proof

    Homework Statement Let property 1 be : If [ai,bi] is a sequence of intervals that are closed such that for each i the interval [a(i+1), b(i+1)] is either the left half of [ai,bi] or the right half, then there exists precisely 1 number in all intervals sequence. Show if a field f...
  23. M

    Differential equations, euler's method and bisection method

    Homework Statement Hi guys, I have the following problem and I don't know how to start. I am given that W = 0.5, X(0) = 0, Iab = 20m and ha = 5m \frac{dy}{dx}=0 and \frac{dy^2}{d^2x}=\frac{W}{T}\sqrt{1 + (\frac{dy}{dx})^2} I am told to convert the 2nd order ODE to two 1st...
  24. S

    Solving a Problem with Bisection Method (C Program)

    here is the c program for arriving at a solution using bisection method. The ouputi s going infinte..pls help ...i think it has more of syntax errors than logical errors... main() { float a,b,c,x1,x2,x,series; double d; printf("enter a,b,c and x1(pos) & x2(neg)")...
  25. S

    How can I fix the bisection method loop when the decimal place value is changed?

    Hi, I've written code to resolve the routes of a function using the bisection method. The code works for the current route brackets (xb and xt) and for a decimal place value of 2. However when the decimal place value is changed the loop gets stuck. Code below: #include <iostream> #include...
  26. fluidistic

    Fortra 90 : Error in my program of bisection method

    Hello, I'm having trouble with a very simple program. I want it to approximate a square root of a number R. So here is my program : For example, if you enter R as 3, a as 1, b as 2 and Tol as 0.001, it should return " d " as the square root of we were looking for, "i" as the number of...
  27. J

    Solving Equation with Bisection Method - Real Root Between -2*pi and 2*pi

    I need to solve this equaation: (x1cos(p)+y1sin(p))^2 * (x2sin(p)-y2cos(p)) = (x1sin(p)-y1cos(p)) * (x2cos(p)+y2sin(p))^2 ; x1,x2,y1,y2 are constants The equation would have 3 roots 1 real and two imaginary I don't need imaginary roots. I am planning to use bisection...
  28. A

    MATLAB Finding Root of 8x^3-36x^2+54x-12=0 Using Bisection Method

    Hi, Im new to Matlab, and my lecturer asked me to do his question which is: Find one root of equation 8x^3-36x^2+54x-12=0 using the bisection method. Your answer must includethe number of iterations. Ive already read the Introduction to MATLAB 7, and Numerical Methods for Engineers. And...
  29. G

    Show that the Bisection Method converges to

    1. The function defined by f(x)=\sin(\pi*x)has zeros at every integer x. Show that when -1<a<0 and 2<b<3, the Bisection method converges to a. 0, if a+b<2 b. 2, if a+b>2 c. 1, if a+b=2 2. Bisection Method An interval [a_{n+1},b_{n+1}]containing an approximation to a root of f(x)=0 is...
Back
Top