I am trying to solve $$u_t=\frac{1}{4}u_{xx}$$ $-\infty
With the initial condition $u(x,0)=\phi(x)$ where
$$ \phi(x)= \left\{ \begin{array}{lr} 1 & |x|<1\\ 0 & |x|\geq 1 \end{array} \right.$$
So I initially typed in my piecewise function like this
ϕ[x_] := Piecewise[{{1, Abs[x]<1}, {0, Abs[x] >= 1}}]
But I have also tried this, (are they both valid, or is just one, or is neither?)
ϕ[x_] := Piecewise[{{1, -1 < x < 1}, {0, x >= 1 || x <= -1}}]
Then, following the mathematica examples I tried to solve the differential equation:
pde = D[u[x, t], t] - 1/4 D[u[x, t], {x, 2}] == 0
soln = DSolve[{pde, u[x, 0] == ϕ[x]}, u[x, t], {x, t}]
Which outputs a bunch of weird stuff, not the solution (I think) I was expecting. If my math is correct I think the solution to this would involve the error function. Any tips to where I might be going wrong would be aprreciated!
Comments
Post a Comment