Here is the code (I'm sorry to give you such a complex code sample but I failed to reproduce the error with a simpler InterpolatingFunction):
(*constants*)
R0 = 8.314; M = 28.8 10^(-3); R = R0/M;
te0 = 298; pa0 = 101325; ρg0 = Pi 25 10^-4 pa0/(R te0);
ρs0 = 0.17; t0 = 0.005; x1 = 0.01; x2 = -10^-3;
Q = 3000000; A = 10^15; ea = 9 10^4; cg = (5/2) R; cs = 1.46 10^3;
kg = 2.61 10^-2; ks = 0.36; ac = 4/0.01; hc = 1500;
c1 = NDSolve[{((ArcTan[-10^5 x]/Pi) + 1/2) (ρs0 cs D[te[t, x], t] -
(0.005^2 Pi) ks D[te[t, x], x, x] - ρs0 Q A Exp[-ea/(R0 te[t, x])])
+ ((ArcTan[1000000 x]/Pi) + 1/2) (ρg0) cg D[te[t, x], t]
(+ρg0) (A ρs0/ρg0 Exp[-ea/(R0 te0)] x2 -
A ρs0/ρg0 Exp[-ea/(R0 te0)] x2/x1 x) (1 - Exp[-10^4 t])
cg D[te[t, x], x] (+ρg0) R te[t, x] (1 - Exp[-10^4 t])
(-A ρs0/ρg0 Exp[-ea/(R0 te0)] x2/x1) -
((0.005^2 Pi) kg D[te[t, x], x, x]) + (0.005^2 Pi) ac hc (te[t, x] - te0) == 0,
te[0, x] == te0, te[t, x2] == te0, te[t, x1] == te0},
{te[t, x]}, {t, 0, t0}, {x, x2, x1}, PrecisionGoal -> 3];
f[t_, x_] = te[t, x] /. c1; teb1[t_] = f[t, 0];
Plot[teb1[t], {t, 0, t0}]
Subscript[teb, i] =
FunctionInterpolation[
If[(D[(te[t, x] /. c1), x] /. x -> 0) < 100, ((te[t, x] /. c1) /. x -> 0) + 0.01,
((te[t, x] /. c1) /. x -> 0)],
{t, 0, t0}]
After I ran the code, the warning message generated…"The function did not evaluate to a real number", why? Who can tell me what is wrong?