       Re: Saving Interpolated Function

• To: mathgroup at smc.vnet.net
• Subject: [mg81019] Re: Saving Interpolated Function
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Sat, 8 Sep 2007 03:49:34 -0400 (EDT)
• Organization: The Open University, Milton Keynes, UK
• References: <fbqpja\$696\$1@smc.vnet.net>

```lederer at ssb.rochester.edu wrote:

> I am doing some numerical analysis leading to an interpolated function
> that I will need later.
>
> These calculations take many minutes, and I want to beable to save the
> interpolated function--so it does not have to be regenerated every
> time I come back to the problem.
>
> How can I do this.?

The function *DumpSave* should be what you are looking for. Here is an
example: we save the interpolating function in the default user
directory, then, in a new session, we load its definition with *Get* (or
<<).

In:= f =
First[u /. NDSolve[{u''[t] + u[t] == 0, u == 0, u' == 1},
u, {t, 0, \[Pi]}]]

Out= InterpolatingFunction[]

In:= DumpSave["f.mx", f]

Out=  InterpolatingFunction[]

In:= Quit[]

(* Later, in a fresh session *)

In:= << f.mx

In:= Plot[{f[t], f'[t]}, {t, 0, \[Pi]}]

[... graphic deleted ...]

Regards,
--
Jean-Marc

```

• Prev by Date: Re: Saving Interpolated Function
• Next by Date: Re: Plotting a straight line in a 3D plot
• Previous by thread: Re: Saving Interpolated Function
• Next by thread: Re: Saving Interpolated Function