# Numerical methods problem

1. Jun 8, 2014

### shyjuu

1. The problem statement, all variables and given/known data

2. Relevant equations

3. 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

File size:
15.3 KB
Views:
58
2. Jun 8, 2014

### D H

Staff Emeritus

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.

3. Jun 8, 2014

### shyjuu

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

4. Jun 8, 2014

### SteamKing

Staff Emeritus
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 $y = x^{2}-4$ 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.

5. Jun 8, 2014

### shyjuu

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

6. Jun 8, 2014

### D H

Staff Emeritus
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.

7. Jun 9, 2014

### shyjuu

but I am not getting 75 ohm as answer after several iterations , so what to do now

8. Jun 9, 2014

### D H

Staff Emeritus

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.

9. Jun 9, 2014

### shyjuu

Actually I am confused how to calculate w3 at each iteration , and what to take w1 and w2 each time

10. Jun 9, 2014

### D H

Staff Emeritus
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. Jun 9, 2014

### shyjuu

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. Jun 9, 2014

### D H

Staff Emeritus
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. Jun 9, 2014

### shyjuu

60.87 but it should be near to 70 I think, now should I do more iterations

14. Jun 9, 2014

### D H

Staff Emeritus
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. Jun 9, 2014

### shyjuu

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. Jun 9, 2014

### D H

Staff Emeritus
You are doing something wrong then. Show me what you have done. Can you make a table like this to show your progress?

Code (Text):
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.

17. Jun 9, 2014

### shyjuu

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. Jun 9, 2014

### shyjuu

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. Jun 9, 2014

### D H

Staff Emeritus
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?

20. Jun 9, 2014

### shyjuu

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