Consider the functions
\[Lambda][n_] := ((n \[Pi])/L)^2
\[ScriptCapitalX][
x_] := \[ScriptCapitalC][1] Cos[Sqrt[\[Lambda][n]] x]
\[ScriptCapitalT][t_] := 50 E^(-\[Lambda] t)
to give the Sum product solution
\[ScriptCapitalU][x_,
t_, \[ScriptCapitalN]_] := \[ScriptCapitalX][x] \[ScriptCapitalT][t]
Notice that the 2D and 3D plot of the Sum product solution, respective are
Plot[Evaluate@
ReplaceAll[
Table[\[ScriptCapitalX][x] \[ScriptCapitalT][t], {n, 1, 3}, {L, 1,
1}], {\[ScriptCapitalC][1] -> 1, \[Lambda] -> 1, t -> 0}], {x, 0,
1}, PlotLegends -> "Expressions", AxesLabel -> {"x", "t"},
PlotLabel -> "2D Plot Behaviour for \[ScriptCapitalU](x,t)"]
and
Plot3D[ReplaceAll[
Table[\[ScriptCapitalU][x, t, \[ScriptCapitalN]], {n, 1, 3}, {L, 1,
1}], {\[ScriptCapitalC][1] -> 1, \[Lambda] -> 1}], {t, 0, 1}, {x,
0, 1}, AxesLabel -> Automatic,
PlotLabel -> "3D Plot Behaviour for \[ScriptCapitalU](x,t)"]
If you rotate the 3D point such that the x and t plots points "towards" you, you are able to observe that they corresponds qualitatively to the 2D plot.
In the case of the 3D plot, how do I match the different colours to different "n" for n=1 to n=3?
Any help is appreciated.
Plot3D[...]
add the optionsEvaluated->True
or wrap the first argument withEvaluate
as you did inPlot
. $\endgroup$