1
$\begingroup$

I am attempting to obtain the analytical solution (if possible) to the following:

$$a w^{(1,0)}(x,t)+b w^{(0,1)}(x,t)=p(x)+g w(x,t)$$ $$I.C.: w(x,0)=0 | B.C.: w(0,t)=z(t)$$

Clear["Global`*"]
a = v;
b = 1;
g = -\[Lambda];
p = \[Psi]*Cos[Pi*x];
ic = w[x, 0] == 0;
bc = w[0, t] == z[t];
pde = a*D[w[x, t], x] + b*D[w[x, t], t] == g*w[x, t] + p
DSolve[pde, w[x, t], {x, t}]

$$\left\{\left\{w(x,t)\to \frac{e^{-\frac{\lambda x}{v}} \left(\pi ^2 v^2 c_1\left(\frac{t v-x}{v}\right)+\lambda ^2 c_1\left(\frac{t v-x}{v}\right)+\pi v \psi \sin (\pi x) e^{\frac{\lambda x}{v}}+\lambda \psi \cos (\pi x) e^{\frac{\lambda x}{v}}\right)}{\lambda ^2+\pi ^2 v^2}\right\}\right\}$$

However, the solution returned only has 1 integration constant, c_1, rather than the 2 I expected (i.e., an initial condition and a boundary condition). Thus, when I attempt the next step to apply the conditions I can only apply one, leading to an erroneous/incomplete solution.

Any guidance would be greatly appreciated. Using v11.2.

Update

Apparently c_1 is really a function and not a constant. In that case I am still left wondering how to proceed. There is a soluction when solving for IC OR BC but not both. Ideas/tricks on how to proceed?

DSolve[{pde, ic}, w[x, t], {x, t}]

$$\left\{\left\{w(x,t)\to \frac{\psi e^{-\frac{\lambda x}{v}} \left(-\pi v e^{\frac{\lambda (x-t v)}{v}} \sin (\pi (x-t v))-\lambda e^{\frac{\lambda (x-t v)}{v}} \cos (\pi (x-t v))+\pi v \sin (\pi x) e^{\frac{\lambda x}{v}}+\lambda \cos (\pi x) e^{\frac{\lambda x}{v}}\right)}{\lambda ^2+\pi ^2 v^2}\right\}\right\}$$

DSolve[{pde, bc}, w[x, t], {x, t}]

$$\left\{\left\{w(x,t)\to \frac{e^{-\frac{\lambda x}{v}} \left(-\lambda \psi +\pi ^2 v^2 z\left(\frac{t v-x}{v}\right)+\lambda ^2 z\left(\frac{t v-x}{v}\right)+\pi v \psi \sin (\pi x) e^{\frac{\lambda x}{v}}+\lambda \psi \cos (\pi x) e^{\frac{\lambda x}{v}}\right)}{\lambda ^2+\pi ^2 v^2}\right\}\right\}$$

DSolve[{pde, ic, bc}, w[x, t], {x, t}]

$$\text{DSolve}\left[\left\{v w^{(1,0)}(x,t)+w^{(0,1)}(x,t)=\psi \cos (\pi x)-\lambda w(x,t),w(x,0)=0,w(0,t)=z(t)\right\},w(x,t),\{x,t\}\right]$$

$\endgroup$
  • 1
    $\begingroup$ You get function c1[t], not only a constant! $\endgroup$ – Ulrich Neumann Aug 3 at 15:05
  • 1
    $\begingroup$ If you look at the StandardForm or FullForm of the solution you can see that C[1] is an arbitray function rather than an arbitrary constant. $\endgroup$ – Bob Hanlon Aug 3 at 15:06
  • $\begingroup$ Hmm, interesting. I would have never guessed that. $\endgroup$ – Scott G Aug 3 at 15:38
  • 1
    $\begingroup$ Do the IC and BC apply to all values of $x$ and $t$, or just $x >0$ and $t > 0$? If it's the latter, then I think the ICs and BCs can be both be satisfied. If the former, they probably can't. (The solution along any characteristic is determined by its intersections with the IC and/or BC surface, and if the characteristics intersect said surfaces more than once, the solutions are overdetermined.) $\endgroup$ – Michael Seifert Aug 3 at 16:57
  • 1
    $\begingroup$ Note that the code does work if you replace z[t] with a known function such as Sin[t]. $\endgroup$ – Michael Seifert Aug 3 at 18:43
3
$\begingroup$

While Mathematica does not seem to be able to solve the problem for a general unknown boundary condition $w(0,t) = z(t)$, it can generally solve it if $z(t)$ is replaced by a known function such as $\sin(t)$:

Clear["Global`*"]
a = v;
b = 1;
g = -\[Lambda];
p = \[Psi]*Cos[Pi*x];
ic = w[x, 0] == 0;
bc = w[0, t] == Sin[t];
pde = a*D[w[x, t], x] + b*D[w[x, t], t] == g*w[x, t] + p
DSolve[{pde, bc, ic}, w[x, t], {x, t}]

Replacing $z(t)$ with a polynomial also results in a solution fairly quickly. I also tried $z(t) = \ln(1+t)$, which took longer but did eventually return a solution as well.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Disclaimer: I believe this is the code I used when I tested it out two days ago. But I've got both my Mathematica kernels working on another problem right now and so I haven't personally tested this version. It should work, but let me know if it doesn't. $\endgroup$ – Michael Seifert Aug 5 at 21:04
  • $\begingroup$ I double checked it and it works. $\endgroup$ – Scott G Aug 5 at 21:08

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.