Re: DSolve with recursively defined equations
- To: mathgroup at smc.vnet.net
- Subject: [mg53767] Re: DSolve with recursively defined equations
- From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
- Date: Thu, 27 Jan 2005 05:40:59 -0500 (EST)
- Organization: Uni Leipzig
- References: <ct7psr$ld$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, a) your first definitions of eq[] and in[] are not overwritten by the second definitions and this may cause trouble. b) nn[i,d] is for Mathematica a function of two variables i and d and there is no way to tell Mathematica that the first vaiiable is only a discrete index, wirte nn[i][d] instead of nn[i,d] will make it clear for Mathematica that you have only a system of ordinary differential equations Clear[eq, in] iCount = 2; eq[0] = nn[0]'[d] == -r nn[0][ d]; eq[i_] := nn[i]'[ d] == r(nn[i - 1][ d] - nn[i][ d]); in[0] = 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] Regards Jens <pdickof at sasktel.net> schrieb im Newsbeitrag news:ct7psr$ld$1 at smc.vnet.net... > DSolve can handle this.... > eq[0] = n0'[d] == -r n0[d]; > eq[1] = n1'[d] == r(n0[d] - n1[d]); > eq[2] = n2'[d] == r(n1[d] - n2[d]); > in[0] = n0[0] == 1; > in[1] = n1[0] == 0; > in[2] = n2[0] == 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[0] = nn'[0, d] == -r nn[0, d]; > eq[i_] := nn'[i, d] == r(nn[i - 1, d] - nn[i, d]); > in[0] = 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? > Thanks in advance..... > > Peter Dickof >