# Error when Solving Recurrence Relation

I would like to analyze the following recurrence relation.

$$r_i = r_{i-1} - \frac{1}{2} \cdot \sqrt{1 - \frac{4\pi^2\cdot r_{i-1}^2}{n^2}}$$

$$r_0 = \frac{n}{2\pi}$$

I have implemented this as follows:

RSolve[{a[t] == a[t - 1] - 1/2*Sqrt[1 - 4*Pi^2*a[t - 1]^2/n^2],
a[1] == n/2*Pi}, a[t], t]


The output is :

$$\text{RSolve}\left[\left\{a(t)=a(-1+t)-\frac{1}{2} \sqrt{1-\frac{4 \pi^2 a(-1+t)^2}{n^2}},\frac{\pi }{n}=\frac{n}{2 \pi }\right\},a(t),t\right]$$

I do not understand why the boundary condition (a[1]) is replaced like this. The corresponding error message is

"Supplied equations are not difference equations of the given functions."

Does anyone know where my mistake is?

Thanks a lot.

• Obviously a[1] is defined, try to restart Mathematica kernel. – Ulrich Neumann Apr 24 at 8:17
• Yes, thanks that is the problem.$\text{RSolve}\left[\left\{a(t)=a(t-1)-\frac{1}{2} \sqrt{1-\frac{4 \pi ^2 a(t-1)^2}{n^2}},a(1)=\frac{n}{2 \pi }\right\},a(t),t\right]$ . It looks like Mathematica is not able to solve this ... – Jannik Apr 24 at 8:23

Rsolve can solve linear recurrence equations of any order with constant coefficients. It can also solve many linear equations up to second order with nonconstant coefficients, as well as many nonlinear equations.
RSolve[{a[t] == a[t - 1] - a[t - 1]^2, a[1] == 1/2}, a[t], t]