What are the possible ways to write an equation in $x=\phi(x)$ form for Iteration method?

80 Views Asked by At

Iterative method For $x=\phi(x)$ , $x_{n+1}=\phi(x_n)$

$x\sin x+\cos x=0$

$[x=2.7984]$

I tried the following forms but they are not provide solution

$x=\arccos(-x\sin(x))$

$x=\arcsin(\cos(x)/x)$

$x=\operatorname{arccot}(-x)$

$x=-\cot(x)$

$x=x+x\sin x+\cos x$

What is the general way to try to write $x=\phi(x)$ in programming?

1

There are 1 best solutions below

0
On BEST ANSWER

It usually helps when the iteration function provides some visual compression from domain to range. While $$ x=ϕ(x)=-\frac{\cos x}{\sin x}=-\cot x $$ will expand finite intervals to the full real line, due to the periodic poles of the cotangent function, the branches $$ x=ϕ_k(x)=k\pi-\text{arccot}(x) $$ of the inverse function will have the opposite effect, mapping the full real line to the finite interval $(\,(k-1)\pi,k\pi\,)$. Starting the iteration in the middle of that interval a test of the iteration can be implemented as

k = np.arange(-5,6,1)
x = (k-0.5)*np.pi
for j in range(10): print j,x; x = k*np.pi-np.arctan2(1,x)

with the results

0 [-17.27875959 -14.13716694 -10.99557429  -7.85398163  -4.71238898 -1.57079633   1.57079633   4.71238898   7.85398163  10.99557429 14.13716694]
1 [-18.79174588 -15.63734536 -12.47567444  -9.29813542  -6.07408066 -2.57468115   2.57468115   6.07408066   9.29813542  12.47567444 15.63734536]
2 [-18.79639121 -15.64410076 -12.48638564  -9.31764132  -6.12001504 -2.77112818   2.77112818   6.12001504   9.31764132  12.48638564 15.64410076]
3 [-18.79640433 -15.64412826 -12.48645396  -9.3178639   -6.12121835 -2.79527254   2.79527254   6.12121835   9.3178639   12.48645396 15.64412826]
4 [-18.79640437 -15.64412837 -12.48645439  -9.31786643  -6.12124963 -2.79803313   2.79803313   6.12124963   9.31786643  12.48645439 15.64412837]
5 [-18.79640437 -15.64412837 -12.4864544   -9.31786646  -6.12125045 -2.79834608   2.79834608   6.12125045   9.31786646  12.4864544  15.64412837]
6 [-18.79640437 -15.64412837 -12.4864544   -9.31786646  -6.12125047 -2.79838152   2.79838152   6.12125047   9.31786646  12.4864544  15.64412837]
7 [-18.79640437 -15.64412837 -12.4864544   -9.31786646  -6.12125047 -2.79838553   2.79838553   6.12125047   9.31786646  12.4864544  15.64412837]
8 [-18.79640437 -15.64412837 -12.4864544   -9.31786646  -6.12125047 -2.79838599   2.79838599   6.12125047   9.31786646  12.4864544  15.64412837]
9 [-18.79640437 -15.64412837 -12.4864544   -9.31786646  -6.12125047 -2.79838604   2.79838604   6.12125047   9.31786646  12.4864544  15.64412837]

showing rapid convergence.