Re: NDSolve with arrays

*To*: mathgroup at smc.vnet.net*Subject*: [mg89241] Re: NDSolve with arrays*From*: Svend.Domdey at googlemail.com*Date*: Sun, 1 Jun 2008 03:35:30 -0400 (EDT)*References*: <g1m8ev$ia$1@smc.vnet.net>

to be more precise, play[x_, j_] :=If[ IntegerPart[x^2+j^2]>n, n, IntegerPart[x^2+j^2]>n], i.e. the index on the rhs of my equation depends both on j and x. any suggestions? thanks svend On May 29, 2:44 pm, svend <dom... at tphys.uni-heidelberg.de> wrote: > hi all, > i want to solve a PDE by discretizing in one variable in an array and solv= e. the equations are of the following type: > n = 10; > x0 = 1; > x1 = 10; > > play[x_] := IntegerPart[x] > > eq1 := {D[f[j][x], x] == f[play[x]][x], f[j][x0] == j^2} > > eqs = Flatten[Table[eq1, {j, 1, n}]] > fun = Flatten[Table[f[j], {j, 1, n}]]; > tes = NDSolve[eqs, fun, {x, x0, x1}][[1]]; > > my problem is that the variable x, in which the equation is differential, = also appears on the rhs in the "index" of my array. mathematica does not eva= luate "play[x]" during NDSolve and just tells me that the rhs is not numeric= al. I tried "_NumericQ" and similar things but nothing seems. I would be ver= y happy if someone could tell me how to resolve this. > > thanks > svend