3

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

Eikthyrnir
  • 247
  • 1
  • 6
  • 1
    Start from the documentation and tutorials: How to: Solve a differential equation. – MarcoB Dec 23 '19 at 21:14
  • @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 – Eikthyrnir Dec 23 '19 at 21:24
  • 1
    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. – Mariusz Iwaniuk Dec 23 '19 at 21:42
  • 1
    @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. – MarcoB Dec 23 '19 at 21:54
  • @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 – Eikthyrnir Dec 23 '19 at 22:04
  • The problem can also be solved with Fourier cosine transform, related: https://mathematica.stackexchange.com/q/157983/1871 – xzczd Dec 24 '19 at 01:56

1 Answers1

5

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 } $$

Cesareo
  • 3,963
  • 7
  • 11
  • 4
    You can introduce a change of variable $Y=-y$ to change the b.c. at $-\infty$ to a b.c. at $+\infty$. – xzczd Dec 24 '19 at 01:52