Consider the following module:
computation[i_, j_] := Module[{func, fintt, fintt2},
func[x_, y_, t_] =
Exp[-(y^i + j*x^2)*t^3 + -(i*y + j*x^2)*t^4]*Cos[i^3*y*t^5];
fintt[t_] =
Interpolation[
Table[{t,
NIntegrate[func[x, y, t], {x, 0.1, 2}, {y, 0.2, x}]}, {t, 0.,
0.5, 0.05}], InterpolationOrder -> 1][t];
fintt2[t_] =
If[i > 0 && j > 0 && t > 0, fintt[t]^j*Cos[t*i]^j, fintt[t]];
{i, j, fintt[t], fintt2[t]}]
Let us test it:
funcTest[t_]=computation[1,2]
funcTest[2]
My problem is already described in this question. In short, if trying to export the content funcTest[t]
and then importing it after quitting the kernel, the system forgets what is fintt$3487[t]
, and does not return the function when trying to use it. Let us also assume that:
1) It is not possible to make fintt
global.
2) The If[]
condition cannot be put out of the Module
environment.
The difference, in this case, is that the If condition is applied to a kind of implicit function. How can I fix this issue?