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.

  • $\begingroup$ Obviously a[1] is defined, try to restart Mathematica kernel. $\endgroup$ Apr 24 '19 at 8:17
  • $\begingroup$ 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 ... $\endgroup$
    – Jannik
    Apr 24 '19 at 8:23

The documentation states that

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.

however, the reality is that its capabilities are severely limited. For example, the command

RSolve[{a[t] == a[t - 1] - a[t - 1]^2, a[1] == 1/2}, a[t], t]

returns unevaluated. There is no closed form solution that I know of so this is not surprising. I am certain that the same holds for your recurrence equation.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.