Let's define the following function:
f[t_, x_] = t^2 + t*x*(1 - x)
such that $x \in (0,1)$ and `$t \in (0,0.02)$ The problem is when I want to define the following function:
z[t_,x_] = Interpolation[Table[{x, f[t, x] Piecewise[{{1, 0.2 < x < 0.8}}]}, {t, 0,0.02},{x, 0,1, 1/24}]];
This is not working!! (I think the problem is because I discretize in space and not in time!!)
_
for arguments in definingf
, using=
instead of:=
in definingz
, and also when you don't specify step inTable
it's 1 which in your caset
has almost no effect. RunningTable
alone will show you it will return a nested list not the kind of inputInterpolation
wants. Another thing is using similar names (z
andTable
). I think I should also remind usingClearAll
before correcting the notes. $\endgroup$