0
$\begingroup$

Following is my Program. I tried with Exponential or gaussian initial conditions it works, but there is a problem in using discrete delta or step function.

eq1 = D[u[x, t], t] == D[u[x, t], x, x];

ics = {u[x, 0] == DiscreteDelta[x - 2]}
bcs = {u[-5, t] == 0, u[5, t] == 0};

s10 = NDSolve[{eq1, ics, bcs}, {u[x, t]}, {x, 0, 5}, {t, 0, 5}];

Plot3D[u[x, t] /. s10, {x, 0, 5}, {t, 0, 5}, PlotRange -> All]
$\endgroup$
  • 1
    $\begingroup$ DiscreteDelta of a continuous variable makes no sense. $\endgroup$ – John Doty Jun 14 '18 at 11:48
  • $\begingroup$ Dirac Delta is also not working. How can I invoke step initial conditions here? @John Doty $\endgroup$ – Sachin Kaushik Jun 14 '18 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.