       Re: DSolve with recursively defined equations

• To: mathgroup at smc.vnet.net
• Subject: [mg53772] Re: DSolve with recursively defined equations
• From: Roland Franzius <roland.franzius at uos.de>
• Date: Thu, 27 Jan 2005 05:41:07 -0500 (EST)
• Organization: Universitaet Hannover
• References: <ct7psr\$ld\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```pdickof at sasktel.net wrote:
> 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?

nn'[1,d] is defined as the Derivative wrt. to the first argument and
even this notation is misinterpreted by Mathematica if you swap 1,d.

Working alternatives:

Separate index and Variable
Remove[nn, eq, in, eqns, funcs];
iCount = 2;
eq = nn'[d] == -r nn[d];
eq[i_] := nn[i]'[d] == r(nn[i - 1][d] - nn[i][d]);
in = nn == 1;
in[i_] := nn[i] == 0;
eqns = Flatten[Table[{eq[i], in[i]}, {i, 0, iCount}]];
funcs = Table[nn[i][d], {i, 0, iCount}];
DSolve[eqns, funcs, d]

or write Derivative's arguments explicitely

eq = D[nn[d,0,d]] == -r nn[d,0];
eq[i_] := D[nn[i,d],d] == r(nn[i - 1,d] - nn[i,d]);

etc.

--

Roland Franzius

```

• Prev by Date: Algebra of Einstein velocity addition
• Next by Date: Re: Re: symbolic complex expressions
• Previous by thread: Re: DSolve with recursively defined equations
• Next by thread: Re: DSolve with recursively defined equations