zz133
(Tim Zhang)
November 28, 2017, 3:51pm
1
I have run into trouble with a Plot3D problem. My code is following:
eqn = D[u[x, t], t] == D[D[u[x, t], x], x];
ic = {u[x, 0] == 1, u[0, t] == 0, Derivative[1, 0][u][10, t] == 0};
dsol = DSolve[{eqn, ic}, u, {x, t}];
Plot3D[u[x, t], {x, 0, 100}, {t, 0, 100}, ColorFunction -> "RustTones", Mesh -> All];
When I click “shift+return”, it just results in an empty graph. I don’t know what is wrong with my code. Could anyone help me?
kmartin
(Kyle Martin)
November 28, 2017, 8:15pm
2
The example here might get you started on what’s missing from what you had. Below I have added what is in that example to your code, which then gives a nice plot. Hopefully it is what you’re after.
ic = {u[x, 0] == 1, u[0, t] == 0, Derivative[1, 0][u][10, t] == 0};
dsol = DSolve[{eqn, ic}, u[x, t], {x, t}];
asol = u[x, t] /. dsol[[1]] /. {\[Infinity] -> 3} // Activate;
Plot3D[asol, {x, 0, 100}, {t, 0, 100}, ColorFunction -> "RustTones",
Mesh -> All]