       DSolve with recursively defined equations

• To: mathgroup at smc.vnet.net
• Subject: [mg53760] DSolve with recursively defined equations
• Date: Wed, 26 Jan 2005 04:37:21 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```DSolve can handle this....
eq = n0'[d] == -r n0[d];
eq = n1'[d] == r(n0[d]  - n1[d]);
eq = n2'[d] == r(n1[d]  - n2[d]);
in = n0 == 1;
in = n1 == 0;
in = n2 == 0;
eqns = Flatten[Table[{eq[i], in[i]}, {i, 0, 2}]];
funcs = {n0[d], n1[d], n2[d]};
DSolve[eqns, funcs, d]

...but when I try to generalize to the following ...
Remove[nn, eq, in, eqns, funcs];
iCount=2;
eq = nn'[0, d] == -r nn[0, d];
eq[i_] := nn'[i, d] == r(nn[i - 1, d]  - nn[i, d]);
in = nn[0, 0] == 1;
in[i_] := nn[i, 0] == 0;
eqns = Flatten[Table[{eq[i], in[i]}, {i, 0, iCount}]];
funcs = Table[nn[i, d], {i, 0, iCount}];
DSolve[eqns, funcs, d]

...I get the message
DSolve::bvnul: For some branches of the general solution, \
the given boundary conditions lead to an empty solution.

I don't understand the difference. Is it possible to generalize as
above? Is it possible to obtain a general solution for the ith
equation? What are the relevant sections in the documentation?