Suppose that we have:
uexact[x_, t_] := x*t;
unumeric[x_, t_] := 0.0000001 + x*t;
Plot3D[{unumeric[x, t], uexact[x, t]}, {x, 0, 2}, {t, 0, 2}]
**
- How to create a 3d plot as follows:
**
- Besides, what are the best ways to comparing numerical and exact solutions in the same 3D plot? Could you share your experience?
This seems like a homework problem. What have you tried?
It’s not homework.
uexact[x_, t_] := x*t;
unumeric[x_, t_] := 0.0000001 + x*t;
Show[ Plot3D[ uexact[x, t], {x, 0, 2}, {t, 0, 2}], Graphics3D[{AbsolutePointSize[4], Point[ Flatten[ Table[{x, t, unumeric[x, t]}, {x, 0, 2, 0.125}, {t, 0, 2, 0.125}], 1]]}]]
I achieved it. But how to add the legends?