Please excuse me if the question has already been answered somewhere else, but I was not able to find it. Could somebody tell me what I am doing wrong here? The solution of DSolve is of course correct (u[t,x] = 5tx, u[1,10]/.sol = 50), but the one of NDSolve is going in the complete wrong direction (u[1,10]/.soln = -50). Why??? Do you get the same values when you run the code? Where did I write something wrong? This is really driving me nuts!
sol = DSolve[
{
0 + D[u[t, x], {x, 2}] == 0
, u[t, 0] == 0
, (D[u[t, x], x] /. x -> 10) == 5*t
}
, {u}
, {t, x}
][[1]];
u[1, 10] /. sol
(*50*)
soln = NDSolve[
{
0 + D[u[t, x], {x, 2}] == 0
, u[t, 0] == 0
, (D[u[t, x], x] /. x -> 10) == 5*t
}
, {u}
, {t, 0, 1}
, {x, 0, 10}
][[1]];
u[1, 10] /. soln
(*-50*)