I have a function $\psi(x,n)$ in mathematica which is quite complicated. However, plugging in $n=0$ gives a simple form. Mathematica knows this (see below), however it is still unable to even evaluate the function at a point. Doing so gives no errors but the output never returns, even though it is a calculation I can do in my head.
At this point I am stumped... here is the output which has me confounded:
Here is the function definition. $\psi$ is defined recursively as a function that remembers values it has found.
ψ0[x_] := 1/(2 π)^(1/4) Exp[-(x^2/4) - I k x];
ψr[x_?NumericQ, n_?NumericQ] := ψr[x, n] =
NIntegrate[
SK[y, x, Δt] (
Projector[x]/
Sqrt[NIntegrate[Abs[Projector[x] ψr[x, n - 1]]^2, {x, -∞, ∞}]]
) ψr[x, n - 1], {y, -∞, ∞}];
ψr[x_, 0] := ψ0[x];
Here are the definitions which indirectly enter into the definition of the function:
ε = 0.2;
Δt = 1.0;
L = 8.0;
tTypical = 10.0;
tMax = 20.0;
k = L/tTypical;
nMax = Floor[tMax/ Δt];
Projector[x_] := 1/(1 + Exp[-((L - x)/ε)]);
SK[x1_, x2_, t_] := 1/Sqrt[2 π I t] Exp[-((x1 - x2)^2/(2 I t))];
Edit: Here is a stack trace of the evaluation using TracePrint[ψr[0,0]]. Mathematica seems not smart enough to just plug in x, rather it is trying to do an integration. An elegant solution doesn't come to mind.