Message Boards Message Boards

[✓] Plot3D the following solution obtained using DSolve?

GROUPS:

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?

Attachments:
POSTED BY: Tim Zhang
Answer
15 days ago

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]
POSTED BY: Kyle Martin
Answer
15 days ago

Group Abstract Group Abstract