Re: NDSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg117436] Re: NDSolve
- From: Oliver Ruebenkoenig <ruebenko at wolfram.com>
- Date: Fri, 18 Mar 2011 06:01:58 -0500 (EST)
On Thu, 17 Mar 2011, tarun dutta wrote:
> while we want to use NDSolve the format of NDSolve is like
> NDSolve[{equations},variable,{x,Xmin,Xmax}]
> I wish to write {x,Xmin,Xmax} inthe following way
> {x,Xmin,Xmax,Xstep} e.g.{x,0,5,1}
> But the problem is that I can not use this kind of format.
> Is there anyway of writing this stuff?
> regards
> tarun
>
>
the question is why you want that. Here is a way to get the Xstep from the
interpolating function.
s = y /. First@
NDSolve[{y'[x] == y[x] Cos[x + y[x]], y[0] == 1}, y, {x, 0, 1},
InterpolationOrder -> All]
pts = Transpose[{#, s /@ #} &[Range[0, 1, 0.1]]]
Show[Graphics[Point[pts]],
Plot[s[x], {x, 0, 1}]
]
There other options if you are talking about tensor grids.
hth,
Oliver