This forum is invite only. To register your account, follow the invite link in your invitation email.
Use Mathematica to find a numerical solution to the following system: $u_t=u_{xx}$, $u(x,0)=\sin(5x)$, $u(0,t)=0$, $u(1,t)=1$.
Using the code:
heatSystem = { D[u[x, t], t] == D[u[x, t], x, x], u[x, 0] == Sin[5 x], u[0, t] == 0, u[1, t] == 1}; u[x_, t_] = NDSolveValue[heatSystem, u[x, t], {x, 0, 1}, {t, 0, 1}] Manipulate[Plot[u[x, t], {x, 0, 1}, ColorFunction -> "TemperatureMap", ColorFunctionScaling -> False, PlotRange -> {-1, 1}], {t, 0, 0.15}] pics = Table[Plot[u[x, t], {x, 0, 1}, ColorFunction -> "TemperatureMap", ColorFunctionScaling -> False, PlotRange -> {-1, 1}], {t, 0, 0.5, 0.01}]; Export["anim.gif", pics] u[0.5, 1]
The graph of the solution is:
The solution to the system $u_{t}=u_{xx}, u(x,0)=sin(5x), u(0,t)=0, u(1,t)=1$ at the midpoint when t=1 is:
$u(0.5,1)=0.0894617$
Comments
Using the code:
The graph of the solution is:
The solution to the system $u_{t}=u_{xx}, u(x,0)=sin(5x), u(0,t)=0, u(1,t)=1$ at the midpoint when t=1 is:
$u(0.5,1)=0.0894617$