3
$\begingroup$

I have the following differential equation

$\frac{\partial u}{\partial t}=\nu \frac{\partial^2 u}{\partial y^2}$ where $u=u(y,t)$

with boundary and initial conditions:

$\mu\frac{\partial u(0,t)}{\partial y}=\tau; u(-\infty,t)=0; u(y,0)=0$

How can I solve it using mathematica?

I tried to hardcode it:

DSolve[{D[u[y, t], t] == \[Nu] D[u[y, t], {y, 2}], (D[u[y, t], y] /.y -> 0) == \[Tau], u[-Infinity, t] == 0, u[y, 0] == 0}, 
 u[y, t], {y, t}]

enter image description here

$\endgroup$
6
  • 1
    $\begingroup$ Start from the documentation and tutorials: How to: Solve a differential equation. $\endgroup$
    – MarcoB
    Dec 23 '19 at 21:14
  • $\begingroup$ @MarcoB I read this tutorial, but if I try to hardcode my DE in Mathematica I get in response only the task itself, not correct answer $\endgroup$
    – tim bars
    Dec 23 '19 at 21:24
  • 1
    $\begingroup$ People here generally like users to post (complete) code as Mathematica code instead of just images, so they can copy-paste it,so as to try and reproduce the issue so as to diagnose it. $\endgroup$ Dec 23 '19 at 21:42
  • 1
    $\begingroup$ @tim Do you have a reason to assume that a closed-form analytical solution should exist for your equation? In some (many) cases, only a numerical solution might be available, in which case you would want to try NDSolve instead. $\endgroup$
    – MarcoB
    Dec 23 '19 at 21:54
  • $\begingroup$ @MarcoB I'm not sure if there is a solution for this equation, but I know, that it is solvable if I'll change -Infinity to some finite number. But even so, I can't solve it using mathematica $\endgroup$
    – tim bars
    Dec 23 '19 at 22:04
5
$\begingroup$

If you change the boundary condition for $u(\infty, t) = 0$ instead of $u(-\infty,t)$ then we have a beautiful solution using the Laplace transform

Clear[u, t, y]
eqn = D[u[y, t], t] - nu D[u[y, t], {y, 2}] == 0;
ic = {u[y, 0] == 0};
bc = {mu Derivative[1, 0][u][0, t] == tau};
teqn = LaplaceTransform[{eqn, bc}, t, s] /. Rule @@@ ic;
tsol = u[y, t] /. First@DSolve[teqn /. HoldPattern@LaplaceTransform[a_, __] :> a, u[y, t], y]

so we obtain

(*-((E^(-((Sqrt[s] y)/Sqrt[nu])) Sqrt[nu] tau)/(mu s^(3/2))) + 2 C[1] Cosh[(Sqrt[s] y)/Sqrt[nu]]*)

or

$$ U(y,s) = 2 c_1 \cosh \left(\frac{\sqrt{s} y}{\sqrt{\nu }}\right)-\frac{\sqrt{\nu } \tau e^{-\frac{\sqrt{s} y}{\sqrt{\nu }}}}{\mu s^{3/2}} $$

but as $y\to\infty$ the solution will remain $0$ then $c_1 = 0$ so we have

$$ U(y,s) = -\frac{\sqrt{\nu } \tau e^{-\frac{\sqrt{s} y}{\sqrt{\nu }}}}{\mu s^{3/2}} $$

Finally

InverseLaplaceTransform[tsol /. {C[1] -> 0}, s, t] // FullSimplify

gives

$$ u(y,t) = \frac{\tau \left(y \text{erfc}\left(\frac{y}{2 \sqrt{\nu t}}\right)-\frac{2 \sqrt{\nu } \sqrt{t} e^{-\frac{y^2}{4 \nu t}}}{\sqrt{\pi }}\right)}{\mu } $$

$\endgroup$
1
  • 4
    $\begingroup$ You can introduce a change of variable $Y=-y$ to change the b.c. at $-\infty$ to a b.c. at $+\infty$. $\endgroup$
    – xzczd
    Dec 24 '19 at 1:52

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.