0

I have read about how to define a recursive function using RecurrenceTable but for $u(100)$ you need all 99 previous terms. The posts doesn't help me. I want to define in mathematica this function:

$$ u(n) = u_0 + \frac{\mu}{\Gamma(\nu)} \sum_{i=1}^n \frac{\Gamma(n-i+\nu)}{\Gamma(n-i+1)} u(i-1)(1-u(i-1)), $$ where $\Gamma(x)$ is the Euler gamma function and $\mu$ and $\nu$ are positive numbers.

Can anybody help me?

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Dog_69
  • 113
  • 6

2 Answers2

0

The possible implementation would be something like:

u[n_, nu_, mu_] := 
 u[n, nu, mu] = 
  u0 + mu/Gamma[nu]*
    Sum[Gamma[n - i + nu]/
      Gamma[n - i + 1] u[i - 1, nu, mu] (1 - u[i - 1, nu, mu]), {i, 1,
       n}]
0

Unless the values for {u[0], μ, ν} are small, an overflow tends to occur.

SeedRandom[1];

ν = RandomReal[{1/10, 2}, WorkingPrecision -> 50];
μ = RandomReal[{1/10, 2}, WorkingPrecision -> 50];

Clear[u]

u[0] = RandomReal[{1/100, 1}, WorkingPrecision -> 50];

u[n_Integer?Positive] := u[n] =
  u[0] + μ/Gamma[ν] Sum[
     u[i - 1] (1 - u[i - 1]) Gamma[n - i + ν]/Gamma[n - i + 1], {i, n}]

u[100]

(*  1.000082  *)
Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198
  • Your code works perfect. But now,I want to draw a bifurcation diagram of u in terms of $mu$. I know I should define a function of $n$ and $mu$. It would be u[n_Integer?Positive,mu]?? Lot of thanks – Dog_69 May 29 '17 at 20:36
  • No, it would be u[n_Integer?Positive, m_] := u[n, m] = ... – Bob Hanlon May 29 '17 at 21:19
  • Yes I forget the "-" but I had this idea. Thanks. – Dog_69 May 29 '17 at 21:35