MATLAB Newton non-linear equation

434 Views Asked by At

I have the following non-linear equation:

enter image description here

where $w0=0.25,w0=0.5,w0=0.75$. I have to prove that if $k$ is a root, then also $−k$ is a root and that there exists only one $k∈(0,1)$ root, but my MATLAB code doesn't return any solution.

Using wolframalpha I have computed the derivative of w0 and obtained, the constants $w0=0.25=0.5=0.75$ were ignored.

enter image description here

In MATLAB I have the following function to compute the roots of non-linear equations: enter image description here

And my test file looks like this: enter image description here

Any idea to make my code functional is appreciated.

2

There are 2 best solutions below

0
On

By plotting your function for the indicated values of $\omega_0$, it seems that there's no real solution for the equation $f(k;\omega_0) = 0$. I haven't tested your Newton-Raphson code but it fails to converge because of this, most likely.

See the figure below:

enter image description here

Cheers!

0
On

Note that for $-1 < x < 1$, $1\pm x > 0$.

Further note that $f(x) = 2x$ is an odd function. It suffices to show that $g(x) = \log \frac{1+x}{1-x}$ is odd.

$$g(-x) = \log \frac{1+(-x)}{1-(-x)} = \log 1-x - \log 1+x = -\left[\log 1+x -\log 1-x\right] = -g(x).$$

Therefore, $h(x) = \frac{2x}{\log \frac{1+x}{1-x}}$ is even, so $h(-x) = h(x)$ for $-1 < x < 1$.