MathGroup Archive 2007

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

Search the Archive

Re: Interpolating Function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74199] Re: Interpolating Function
  • From: "dimitris" <dimmechan at yahoo.com>
  • Date: Wed, 14 Mar 2007 03:47:51 -0500 (EST)
  • References: <et5oik$js9$1@smc.vnet.net>

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