Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

Re: interpolatingfunction

  • To: mathgroup at smc.vnet.net
  • Subject: [mg15952] Re: interpolatingfunction
  • From: juan antonio gonzalez castro <jagonzal at students.uiuc.edu>
  • Date: Wed, 17 Feb 1999 23:34:12 -0500
  • Organization: University of Illinois at Urbana-Champaign
  • References: <7a2bg1$1th@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,
 Here is a way to handle it:
say you want the Num Sol of an ODE as follows
 In[1]:  NDSolve[{y''[x] == y[x], y[0]==y'[0]==1}, y, {x, 0, 5}]

you would the following output
Out[1]: {{y\[Rule]InterpolatingFunction[{{0.,5.}},"<>"]}}

to define this as a funtion you can define a function as follows:

 In[2]: f[x_] := y[x] /. %1 [[1]]

the function f[x], valid only for 0<x<5, is basically what you are
after.

Try it,
_______________________________________________________________________
Juan A. Gonzalez-Castro, 

>On 12 Feb 1999 phpcp at csv.warwick.ac.uk wrote:
> 
> hi all,
> 
> i solved a d.e. using NDSolve and got a solution in
> InterpolatingFunction form. How can i define this as a function that
> returns values using an argument.
> 
> thanks,
> sanjay
> 
> 
> 
> 



  • Prev by Date: Finite Differences and Mathematica?
  • Next by Date: Re: PlotVectorField Package (easy question?)
  • Previous by thread: Re: interpolatingfunction
  • Next by thread: Re: searching for an enveloppe