How to Ensure Bracketing in Numerical Methods

Click For Summary

Discussion Overview

The discussion revolves around the application of the bisection method in numerical methods for root finding, particularly in the context of a function that does not appear to have roots within a specified interval. Participants are exploring how to proceed when initial guesses yield positive function values and how to determine subsequent points in the iteration process.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant expresses confusion about how to proceed with the bisection method when both initial guesses yield positive function values.
  • Another participant suggests defining a new function to find where it equals a specific value rather than zero.
  • Multiple participants clarify that the midpoint is calculated as the average of the two endpoints, and that the next interval must be chosen based on function values at the endpoints.
  • There is a discussion about the nature of the function being analyzed, with some participants noting that it is always positive, indicating that the method may not yield a root in the expected manner.
  • Some participants request to see detailed calculations to identify potential mistakes in the iterative process.
  • Concerns are raised about the speed of convergence of the bisection method, with some participants suggesting that it is slow but reliable.
  • There is a repeated emphasis on the need to calculate function values at the endpoints to determine the next steps in the iteration.

Areas of Agreement / Disagreement

Participants generally agree on the mechanics of the bisection method, but there is disagreement regarding the applicability of the method when the function does not yield a root within the specified interval. The discussion remains unresolved as participants explore different approaches and clarify misunderstandings.

Contextual Notes

Some limitations are noted, including the dependence on the function's behavior and the initial guesses provided. The discussion highlights the importance of checking additional values within the interval to ascertain the presence of roots.

shyjuu
Messages
13
Reaction score
0


I had tried to solve but the problem is here initial guess is given as 1 and 1000 but both has positive value of function , so wat to do now how to determine x3 which is x1+x2, wat to take x1 and x2 in second iteration, just guide me how to solve

Thanks a lot for ur replies
 

Attachments

  • Bisection k.JPG
    Bisection k.JPG
    15.3 KB · Views: 437
Physics news on Phys.org
Please don't use text speech.

You can use a root finding algorithm to solve for f(x)=a, but simply using the root finding algorithm to find where f(x)=0 obviously is not going to yield a solution to f(x)=a. You need to define a new function, g(x)=f(x)-a. Using a root finding algorithm on g(x)=0 will find the solutions of f(x)=a.
 
D H said:
Please don't use text speech.

You can use a root finding algorithm to solve for f(x)=a, but simply using the root finding algorithm to find where f(x)=0 obviously is not going to yield a solution to f(x)=a. You need to define a new function, g(x)=f(x)-a. Using a root finding algorithm on g(x)=0 will find the solutions of f(x)=a.

Yes i had used gerneral Bisection fornula to find the solution, and can u please elaborate more

Thanks in advance
 
shyjuu said:

The Attempt at a Solution



I had tried to solve but the problem is here initial guess is given as 1 and 1000 but both has positive value of function , so wat to do now how to determine x3 which is x1+x2, wat to take x1 and x2 in second iteration, just guide me how to solve

Thanks a lot for ur replies

The 'bisection method' means just that. You are originally given the interval ω = [1,1000]. Your next interval can be ω = [1,500] or ω = [500,1000]. x3 isn't x1+x2, but 0.5*(x1+x2). You get to pick which of the original endpoints to use in the next interval after calculating the midpoint of the original interval.

If your problem was to find the roots of [itex]y = x^{2}-4[/itex] using an initial interval of x = [-3,3], y(x1) and y(x2) for this interval would both be positive. Therefore, one or both roots may lie within the original interval, but you can't know for certain unless you check additional values of x within that initial interval.
 
SteamKing said:
The 'bisection method' means just that. You are originally given the interval ω = [1,1000]. Your next interval can be ω = [1,500] or ω = [500,1000]. x3 isn't x1+x2, but 0.5*(x1+x2). You get to pick which of the original endpoints to use in the next interval after calculating the midpoint of the original interval.

If your problem was to find the roots of [itex]y = x^{2}-4[/itex] using an initial interval of x = [-3,3], y(x1) and y(x2) for this interval would both be positive. Therefore, one or both roots may lie within the original interval, but you can't know for certain unless you check additional values of x within that initial interval.

Thanks, Yes i know its formula is (x1+x2)/2 , but the problem is (1+1000)/2 is 500.5 now the problem is f(1) = +ve and f(1000) is also+ve , also f(500.5) is +ve , my Question is how can we determine next point whether to take 500.5 and 1 or 500.5 and 1000 for calculating next x3
 
Apparently you are using ##f(\omega) = 1/\sqrt{1/R^2 + (\omega C - 1/(\omega L))^2}##. That's obviously positive for all real ω. You aren't trying to find where this function f(ω) is zero, which is what a root finding algorithm searches for. You are trying to find where it takes on a value of 75 ohms.
 
D H said:
Apparently you are using ##f(\omega) = 1/\sqrt{1/R^2 + (\omega C - 1/(\omega L))^2}##. That's obviously positive for all real ω. You aren't trying to find where this function f(ω) is zero, which is what a root finding algorithm searches for. You are trying to find where it takes on a value of 75 ohms.

but I am not getting 75 ohm as answer after several iterations , so what to do now
 
Show your work! I can't read your mind to see where you've made a mistake (and you most certainly have made a mistake of some kind).

In particular, please show ωlow, f(ωlow), ωhigh, f(ωhigh), ωmid, and f(ωmid). The first three or four steps should be enough to see what you've done wrong.
 
D H said:
Show your work! I can't read your mind to see where you've made a mistake (and you most certainly have made a mistake of some kind).

In particular, please show ωlow, f(ωlow), ωhigh, f(ωhigh), ωmid, and f(ωmid). The first three or four steps should be enough to see what you've done wrong.

Actually I am confused how to calculate w3 at each iteration , and what to take w1 and w2 each time
 
  • #10
You start with ωlow=1 and ωhi=1000. At any stage, you compute the midpoint by averaging ωlow and ωhi. For example, for the first step you would use ωmid=500.5.

What impedances do you get for 1 Hz, 1000 Hz, and 500.5 Hz?
 
  • #11
D H said:
You start with ωlow=1 and ωhi=1000. At any stage, you compute the midpoint by averaging ωlow and ωhi. For example, for the first step you would use ωmid=500.5.

What impedances do you get for 1 Hz, 1000 Hz, and 500.5 Hz?

z=173 , now for 2 iteration I take w1=1 and w2=500.5 w3=250.75 here I get z=111

similarly calculating liek this I am not getting z=75
 
  • #12
You're getting closer, though. Bisection isn't noted for being speedy.

What are your next two steps? That's what's going to tell me if you made a mistake.
 
  • #13
D H said:
You're getting closer, though. Bisection isn't noted for being speedy.

What are your next two steps? That's what's going to tell me if you made a mistake.

60.87 but it should be near to 70 I think, now should I do more iterations
 
  • #14
Why do you think that? Bisection is slow, but it's slow and steady. Bisection is always the last fallback to solving an ill-behaved function because it always works. Other techniques can be much faster, but sometimes they blow up, sometimes they get stuck. Bisection always halves the interval on each step, so it is guaranteed to eventually find the solution. (Once you have it bracketed of course. You were given two values that bracketed the solution.)
 
  • #15
D H said:
Why do you think that? Bisection is slow, but it's slow and steady. Bisection is always the last fallback to solving an ill-behaved function because it always works. Other techniques can be much faster, but sometimes they blow up, sometimes they get stuck. Bisection always halves the interval on each step, so it is guaranteed to eventually find the solution. (Once you have it bracketed of course. You were given two values that bracketed the solution.)

but solving for more 3 to 4 iteration I am not getting near to answer my next answer is coming 30 then 11 and like that so would it come to 70 after this numbers also
 
  • #16
You are doing something wrong then. Show me what you have done. Can you make a table like this to show your progress?

Code:
step   wlo    f(wlo)     whi     f(whi)   wmid    f(wmid)
  1    1.0000  0.500  1000.0000 214.605  500.5000 173.003
  2    1.0000  0.500   500.5000 173.003  250.7500 111.116
  3    1.0000  0.500   250.7500 111.116  125.8750  60.879

Please show your equivalent, and show the next three or four lines after the steps I've shown.

I cannot help you find your problem if you do not show your work!
 
  • #17
D H said:
You are doing something wrong then. Show me what you have done. Can you make a table like this to show your progress?

Code:
step   wlo    f(wlo)     whi     f(whi)   wmid    f(wmid)
  1    1.0000  0.500  1000.0000 214.605  500.5000 173.003
  2    1.0000  0.500   500.5000 173.003  250.7500 111.116
  3    1.0000  0.500   250.7500 111.116  125.8750  60.879

Please show your equivalent, and show the next three or four lines after the steps I've shown.

I cannot help you find your problem if you do not show your work!

I am getting exactly same till here , is there any need to calculate f(wlo) and f(whi) because every time you will get positive value so we need to just replace x1(wlow) by x3(wmid) , yes I am posting it wait
 
  • #18
shyjuu said:
I am getting exactly same till here , is there any need to calculate f(wlo) and f(whi) because every time you will get positive value so we need to just replace x1(wlow) by x3(wmid) , yes I am posting it wait

I think we are following wrong procedure because since f(w3) is always positive we need to replace w1 and w2 so in second iteration we should take w1=500.5 and w2= 1000 , in every iteration w2 will be 1000 and w1 will be replace with new value, but by solving like this also I am not getting , at 6 and 7 iteration I am getting 214 but this is not the answer , we need to get 70, so are we doing anything wrong?
 
  • #19
Why can't you just do what I asked? Helping you is getting rather frustrating.

shyjuu said:
I think we are following wrong procedure because since f(w3) is always positive we need to replace w1 and w2 so in second iteration we should take w1=500.5 and w2= 1000 , in every iteration w2 will be 1000 and w1 will be replace with new value, but by solving like this also I am not getting , at 6 and 7 iteration I am getting 214 but this is not the answer , we need to get 70, so are we doing anything wrong?
Yes, you are doing something wrong. You absolutely should not take w1=500.5 and w2= 1000 on the second iteration. You no longer have the solution bracketed when you do this.

What does "bracketed" mean? If you are trying to solve f(x)=0 you need to ensure that f(x1) and f(x2) have opposite signs. If the function is continuous, there must exist at least one point x that lies somewhere between x1 and x2 such that f(x)=0.

If you are trying to solve f(x)=a where a is some non-zero constant you need to ensure that f(x1) and f(x2) lie on opposite sides of the desired value a. So for step 1, we have ω1=1, ω2=1000. Note that these bracket the solution f(ω)=75 because f(ω1)=0.5<75 and f(ω2)=214.6>75. The midpoint is ω3=500.5, where f(ω3)=173. Choosing to replace ω1 with ω3 is absolutely the wrong choice. With this choice you have ω1=500.5 and ω2=1000, with f(ω1)=173 and f(ω2)=214.6. Both are above 75. You have violated the bracketing condition. Game over.

In that first step you must replace ω2 with ω3 to keep the solution bracketed. The same goes for the next step where ω3=250.75 and f(ω3)=111.116. Once again, both f(ω2) and f(ω3) are greater than 75.

What happens on the next step, which would be the next line in my table? Here ω3=125.875 and f(ω3)=60.879. Hint: Is this value greater than or less than 75? Which value does that say you should replace?
 
  • #20
D H said:
Why can't you just do what I asked? Helping you is getting rather frustrating.


Yes, you are doing something wrong. You absolutely should not take w1=500.5 and w2= 1000 on the second iteration. You no longer have the solution bracketed when you do this.

What does "bracketed" mean? If you are trying to solve f(x)=0 you need to ensure that f(x1) and f(x2) have opposite signs. If the function is continuous, there must exist at least one point x that lies somewhere between x1 and x2 such that f(x)=0.

If you are trying to solve f(x)=a where a is some non-zero constant you need to ensure that f(x1) and f(x2) lie on opposite sides of the desired value a. So for step 1, we have ω1=1, ω2=1000. Note that these bracket the solution f(ω)=75 because f(ω1)=0.5<75 and f(ω2)=214.6>75. The midpoint is ω3=500.5, where f(ω3)=173. Choosing to replace ω1 with ω3 is absolutely the wrong choice. With this choice you have ω1=500.5 and ω2=1000, with f(ω1)=173 and f(ω2)=214.6. Both are above 75. You have violated the bracketing condition. Game over.

In that first step you must replace ω2 with ω3 to keep the solution bracketed. The same goes for the next step where ω3=250.75 and f(ω3)=111.116. Once again, both f(ω2) and f(ω3) are greater than 75.

What happens on the next step, which would be the next line in my table? Here ω3=125.875 and f(ω3)=60.879. Hint: Is this value greater than or less than 75? Which value does that say you should replace?

This is really helpful , great insight, let me try by following this rule
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 14 ·
Replies
14
Views
12K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
8K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 16 ·
Replies
16
Views
4K