Problem: Plotting list of {InterpolatingFunction[]}

• To: mathgroup at smc.vnet.net
• Subject: [mg2548] Problem: Plotting list of {InterpolatingFunction[]}
• From: Patrick Jemmer <paddy at sun4.bham.ac.uk>
• Date: Mon, 20 Nov 1995 01:13:09 -0500
• Organization: The University of Birmingham, UK.

```Hello all: I am solving a set of DEs using NDSolve to produce
a list of interpolating functions, where the list is called ans:

In[5]:= ans

Out[5]= {{source[t] -> InterpolatingFunction[{0., 1.}, <>][t],

>     sink[t] -> InterpolatingFunction[{0., 1.}, <>][t],

>     conc[t] -> InterpolatingFunction[{0., 1.}, <>][t],

>     a1[t] -> InterpolatingFunction[{0., 1.}, <>][t],

>     b1[t] -> InterpolatingFunction[{0., 1.}, <>][t]}}

I then substitute with the list sp={source[t], sink[t], ... }

intpf =sp/. ans

Out[6]= {InterpolatingFunction[{0., 1.}, <>][t],

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

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

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

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

I am then trying to plot these together:

Plot[intpf,{t,0,1}]In[7]:= Plot[intpf,{t,0,1}]

Plot::plnr: CompiledFunction[{t}, intpf, -CompiledCode-][t]
is not a machine-size real number at t = 0..

Plot::plnr: CompiledFunction[{t}, intpf, -CompiledCode-][t]
is not a machine-size real number at t = 0.0416667.

Plot::plnr: CompiledFunction[{t}, intpf, -CompiledCode-][t]
is not a machine-size real number at t = 0.0833333.

General::stop: Further output of Plot::plnr
will be suppressed during this calculation.

and an empty plot....

If I extract each component
In[8]:= aa=intpf[[1]]

Out[8]= InterpolatingFunction[{0., 1.}, <>][t]

Everything works fine and i can plot the whole lot on one graph...

What's going on?

Thanks, patrick.

(e-mail duplicates of any help would be appreciated, as
I don't know whether I'll have access to usenet for a few days).