MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Interpolating Function


On Mar 13, 10:49 am, "amitsoni.1... at gmail.com" <amitsoni.
1... at gmail.com> wrote:
> Hi,
>
> I used NDSolve to solve an ODE(f = NDSolve[.....] ) and got the result
> as an Interpolating function x->InterpolatingFunction[...]. It just
> gives the range of solution x. How can I plot or get the values of
> solution x?
>
> Thank you,
> Amit

You can work as folows:

solution1 = NDSolve[{Derivative[1][y][x] == 1/(2*y[x]), y[0.01] ==
0.1}, y, {x, 0.01, 1}];
Plot[y[x] /. solution, {x, 0.01, 1}];

or alternatively

solution = NDSolve[{Derivative[1][y][x] == y[x], y[1] == 2}, y, {x,
-3, 3}]
{{y -> InterpolatingFunction[]}}

y[x_] = y[x] /. solution[[1]]
InterpolatingFunction[][x]

Plot[y[x], {x, 0, 3}]

Dimitris



  • Prev by Date: Re: Can't resize BasicInput Palette
  • Next by Date: Re: Replacement question
  • Previous by thread: Re: Interpolating Function
  • Next by thread: Re: Interpolating Function