0
$\begingroup$

Reposting my question in a more legible and understandable way. The earlier one was flouting a few too many posting guidelines.

I am trying to solve the heat conduction partial differential equation, I have two boundary conditions and this is how I have tried to model the DSolve/NDsolve arguments but have failed on both occasions.

Here is my code:

 pde = c*p*D[y[r, t], t] - k*D[y[r, t], {r, 2}] == q[r];     
 NDSolve[pde, y[r, 0] == 0, y[Infinity, t] == 0, y[r, t], {r, t}]

This is what I get:

NDSolve::dsvar: y[∞, t] == 0 cannot be used as a variable.

I also used Dirichlet boundaries:

pde = c*p*D[y[r, t], t] - k*D[y[r, t], {r, 2}] == q[r];
NDSolve[pde, DirichletCondition[y[r, 0] == 0, True], 
DirichletCondition[y[Infinity, t] == 0, t > 0], y[r, t], {r, t}]

This is what I got this time:

NDSolve::litarg: To avoid possible ambiguity, the arguments of the dependent variable in DirichletCondition[y[r, 0] == 0, True] should literally match the independent variables.

Getting the same error messages with both DSolve and NDSolve. Can't really wrap my head around it. Where exactly am I going wrong?

$\endgroup$
  • $\begingroup$ Try:c = 1; p = 1; k = 1; q[r_] := r; pde = c*p*D[y[r, t], t] - k*D[y[r, t], {r, 2}] == q[r]; sol = NDSolve[{pde, y[r, 0] == 0, y[1000, t] == 0, y[0, t] == 0}, y[r, t], {r, 0, 1}, {t, 0, 1}]; Plot3D[y[r, t] /. sol, {r, 0, 1}, {t, 0, 1}] $\endgroup$ – Mariusz Iwaniuk Feb 15 '18 at 18:48
  • $\begingroup$ Thank you so much @MariuszIwaniuk for taking the time to test this out! I can see why your solution works but is it not possible to get a more symbolic solution? Also, the third boundary condition that you added, is it possible physically? At the focal point of the heat source at any time, the heat generation and therefore the temperature change would be maximum and not zero. $\endgroup$ – Raghav Kaushal Feb 15 '18 at 18:52
  • $\begingroup$ DSolve[]'s support for symbolic PDE's equations is still somewhat limited, so don't be surprised if some things don't work yet. Have you a third bounduary condition or initial condition? If you do not need it a third condition the DSolve symbolic can't find.Try NDSolve numericbut you need third condition! $\endgroup$ – Mariusz Iwaniuk Feb 15 '18 at 19:22

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.