NDSolve problem
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg900] NDSolve problem
- From: pitts at mayo.EDU (Todd Pitts)
- Date: Fri, 28 Apr 1995 00:58:01 -0400
- Organization: Ultrasound Research Laboratory, Mayo Foundation, Rochester MN
I have been using NDSolve[] to investigate the solutions to some large,
sets of simple, ordinary differential equations. It is most convenient
to use subscripted variables/functions and parameters to represent the large number
of solution functions and system characteristics. For certain values
of coefficients the solution proceeds nicely, however, for others I obtain
the error
NDSolve::ndnum: Differential equation does not evaluate to a number at t = 0..
Below I have described the simplest system that I have been able to obtain
an error on.
(* System equation *)
eq={4.0*D[x[1][t],{t,2}]==x[1][t]-Sin[t]};
(* Initial conditions *)
bc={Evaluate[D[x[1][t],t] /. t->0]==0,x[1][0]==0};
(* Make a list of all system equations *)
sys=Join[eq,bc];
(* Send the problem to NDSolve[] *)
NDSolve[sys,x[1],{t,0,10}]
Yields the following output:
NDSolve::ndnum: Differential equation does not evaluate to a number at t = 0..
Out[32]= {{x[1] -> InterpolatingFunction[{0., 0.}, <>]}}
Changing the coefficient 4.0 in eq to unity (1 not 1.0) gives no error. Also
writing the equation as
eq={D[x[1][t],{t,2}]==(x[1][t]-Sin[t])/4};
works. If I don't use subscripted variables I don't have this problem. For
example
sys2 = sys /. x[1] -> x
NDSolve[sys2,x,{t,0,10}]
seems to work fine. I would greatly appreciate any hints. Is this a bug or
have I misunderstood the use of subscripted variables? The version number is
2.2. I get the same behavior on NeXT and DEC Alfa.
Thanks in Advance,
Todd Pitts