MathGroup Archive 1999

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

Search the Archive

Re: interpolatingfunction


phpcp at csv.warwick.ac.uk wrote in message <7a2bg1$1th at smc.vnet.net>...
>
>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
>
>

Sanjay:

An expression InterpolatingFunction[...] behave as a function:

NDSolve[{x'[t] == x[t], x[0]==1}, x,{t,0,1}]

{{x -> InterpolatingFunction[{{0.,1.}},"<>"]}}

f = x/.%[[1]]

InterpolatingFunction[{{0.,1.}},"<>"]

f[.3]

    1.34986

Allan

---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565





  • Prev by Date: Linear algebra
  • Next by Date: RE: How to print a determinant in the traditional way
  • Previous by thread: Re: interpolatingfunction
  • Next by thread: Re: interpolatingfunction