Hello, I am using Interpolation to connect the data points in the attachment DATA.nb
and trying with high precision(70). However it seems that Interpolation suppresses the precision of the table it acts on, so the values of the resulting interpolating function become all the same with 16 precision in the range(the notebook below shows the beginning and ending values):
I searched for the precision option of it in Wolfram documentation center but found nothing. How can I refine the result of such interpolation? Thanks!
Try using exact numbers
Nice method, thank you! What if the InterpolatingFunction is given by NDSolve solution? Or similarly, just rationalize the equations first?
Dear Dr. Namjoshi! Here are two issues I found related to the InterpolatingFunction result obtained by NDSolve, which I've tried my best to work out but still failed:
First, since some of the solution is large and requires one to store manually, he can use the result without losing precision by means of % exactly referred to the output, while after copying the solution of interpolated function and paste it somewhere else, the value of the function becomes no longer as precise as the original output; the problem is, does it mean one can't totally store the data(to be used the other day after restarting MMA)? How can I store complete information of the solution?
Second, sometimes I try to manually store the InterpolatingFunction obtained by NDSolve, however, clicking the storing button doesn't work. What's wrong? I guess the reason might be the lack of memory. Additionally referred to the first problem, is the data completely stored when storing button seems to work?
These are the problems I've encountered, I'd be glad if you help me solve them, thank!
I rarely make use of the "Data not in notebook; Store now" feature. It can significantly increase the size of the notebook resulting in slow loading/saving time. If you want to save the results of computations for use later in a different session then take a look at Save and Get. e.g.
iFunc = Interpolation@Rationalize[data, 0]
Close notebook, quit kernel or restart Mathematica
This will also work for persisting the solutions from NDSolve. The round-trip from Save to Get should not cause any loss of precision. If you find it does, it is a bug. e.g. you can try this
iFuncNew = Interpolation@Rationalize[data, 0]
iFunc == iFuncNew
(* True *)
OK, I‘ll try your timely advice, thanks!
Hi, Rohit! I trided what you told me last time. Though iFunc == iFuncNew gave True result, the sizes of them differed: 3.5M(initial) and 2.2M(New). Next are the screenshots:
The function SOMA is
That is strange. If you look at InputForm@iFunc and compare it with the file iFunc.wl (it is a text file) you will see that the InputForm includes a long list of numbers like 5.715581102622704*^11 at the end. I have no idea what those numbers are. What matters is that the expressions are identical. I would trust Equal more than some approximate number computed by the frontend.
If you are still concerned, generate some random rational numbers within the domain of the interpolating function and evaluate both functions at that value and compare the result.
Hi Rohit, as your suggestion directed, I get some functions rationalized, but the solution of this NDSolve,