Question

How can I determine the initial guess of the equation Ax+Bsin(x)=C in terms of A,B and C ? I am trying to solve it using Newton Raphson. A,B and C will be given during runtime.

Is there any other method more efficient than Newton Raphson for this purpose ?

Was it helpful?

Solution

The optimal initial guess is the root itself, so finding an "optimal" guess isn't really valid.

Any guess will give you a valid solution eventually as long as f'(x0) != 0 for any step, which only occurs at the zeroes of cos(x), which are k*pi + pi/2 for any integer k.

I would try x0 = C * pi, just to see if it works.

Your biggest problem, however, would be the periodic nature of your function. Newton's method will be slow (if it even works) for your function as sin(x) will shift x0 back and forth over and over.


Precaution:

In Newton's method, do you notice how f'(xn) is in the denominator? f'(x) approaches 0 infinitely many times. If your f'(x) = 0.0001 (or anywhere close to zero, which has a chance of happening), your xn+1 gets thrown really far away from xn.

Worse yet, this can happen over and over due to f'(x) being a periodic function, which means that Newton's method might never even converge for an arbitrary x0.

OTHER TIPS

The simplest "good" approximation is to just assume that sin(x) is approximately zero, and so set:

x0 = C/A

Well, if A,B and C are real and different from 0, then (B+C)/A is an upper quote to the highest root and (C-B)/A is a lower quote to the lowest root, as -1 <= sin(x) <= 1. You could start with those.

Newton method can work with any guess. the problem is simple, if there is an equation and I guessed x0=100 and the best close solution for it is x0=2 and I know the answer is 2.34* by using any guess in the world you will eventually get to 2.34* the method says to choose a guess because without a valid guess it will take many solutions which aren't comfortable no one wants to repeat the method 20 times and guessing a solution is not hard you just find a critical point- for example, 3 is too big and 2 is too small so the answer is between 2 and 3 but if instead guessing 2 you guess 50 you will still get to the right solution. like I said it will just take you much longer I tested the method by myself I guessed 1000 to a random equation and I knew the best guess was 4 the answer was between 4 and 5 I chose 1000 it took me much time but after a few hours, I got down from 1000 to 4.something if you somehow can't find a critical point you can actually put a random number equals to x0 and then eventually you will get to the right solution no matter what number you guessed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top