Question: Correct saving of dsolve' results

I try to save results of numeric integration of ODE, returned by dsolve. I address very simple equation and before saving all works as needed:

S1 := dsolve([diff(z(x), x$2)+z(x) = -2, z(0)=0, z(1)=1], z(x), 'numeric', 'output' = listprocedure);

F1 := unapply(rhs(S1[2])(x), x); plot(F1, 0..1, thickness=3);
1

Next I save solution S1 by save operator:

save S1,  filename;

S1 saved and likely looks correctly:

S1 := [x = proc (x) local _res, _dat, _solnproc; option
`Copyright (c) 1993 by the University of Waterloo. All rights reserved.`; _dat
:= Array(1..4, {1 = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; ........................................................

Operator read reads S1 from file:
read filename;

but

F1 := unapply(rhs(S1[2])(x), x);

returns an error:

Error, (in unknown) invalid input: the 1st argument to pointto is not a valid pointer handle

How to save solution correctly?

 

Please Wait...