# differential equations – how we can extract the value of the solution of a PDE in a point x? (NDSolve)

Please I need your help, I calculate the solution of heat equation using methode of line
This is my code:

``````n = 10
grid = 1/n  Range[0, n];
d1 = NDSolve`FiniteDifferenceDerivative[Derivative[1], grid];
d2 = NDSolve`FiniteDifferenceDerivative[Derivative[2], grid];
M1 = d1["DifferentiationMatrix"];
M2 = d2["DifferentiationMatrix"];
y00[t_] := Sqrt[2] Sin[Pi t];
T= 0.02;
tab = Table[u[i]
tab1 = Table[u[i], {i, Length[grid]} ];
ux = M1.tab;
uxx = M2.tab;
solu1   = D[u[1]
solu2 = D[u[n + 1]
solu3 = Table[D[u[i]
solu4 = Table[u[i][0] == y00[grid[[i]]], {i, Length[grid]}];
sol1 = NDSolve[{solu1, solu2, solu3, solu4}, tab1, {t, 0, T},
Method -> {"MethodOfLines",
"SpatialDiscretization" -> {"TensorProductGrid",
"MaxPoints" -> 25}}];
``````

Now that I have calculated the solution “sol1”. I need to approximate the value of this solution in $$t = T$$ in the space $$grid$$ something like

``````h = Table [sol1 [grid[[i]],T],{i,Length[grid]}]
``````

but this is not working for me, can anyone help me with that please??