3

I want to solve this 2nd order PDE-

$$ u_t = K u_{xx} \\ u(x=0,t)=f(t) \\ u(x=L,t)=g(t) \\ u(x,t=0)=\phi(x) $$

Based on this answer - Heat equation with time dependent boundary conditions?, I solved it and got the answer as mentioned in the question as far as I understood -

$$ u(x,t)=\sum_{n=1}^\infty u_n(t) sin(\lambda_n x) \\ \lambda_n=\frac{n \pi}{L} \\ u_n(t)=e^{-\lambda_n^2Kt}\int e^{\lambda_n^2Kt}F(t)dt \\ F(t)=\frac{2\lambda_n}{L}[f(t)+(-1)^{n+1}g(t)] \\ u_n(0)=\frac{2}{L}\int_o^L \phi(x) sin(\lambda_nx)dx $$

What I don't understand is how does this solution satisfy the boundary conditions? At $x=0$, $sin(\lambda_n x) $ will always be zero and thus $u(x=0,t)=0$ instead of $u(x=0,t)=f(t)$.

I thought I understood the solution but I guess not and I don't know if I am doing something wrong entirely. Because no matter how I solve $u_n(t)$ and what the solution for that is, $u(x=0,t)$ is always zero.

  • I think the BC zero is the one of the modified function v in the original problem. – QuantumPotatoïd Oct 19 '21 at 17:52
  • I am sorry I didn't understand what you mean. What do you mean by modified function v? – Yuki.kuroshita Oct 19 '21 at 17:55
  • BC $$u(0,t)=f(t)\textrm{ write } u(x,t)=v(x,t)+f(t)\Rightarrow v(0,t)=0$$ – QuantumPotatoïd Oct 19 '21 at 18:21
  • We can do this directly? But in the answer this is not done – Yuki.kuroshita Oct 19 '21 at 18:39
  • Yes I think there probably is a mistake. – QuantumPotatoïd Oct 20 '21 at 05:53
  • Btw : why there is not a relativistic boundary condition : $u(x=\pm ct,t)=0$ if the particle were localized at initial time ? – QuantumPotatoïd Oct 20 '21 at 06:08
  • There is also the problem that the added function is not unique, for example $u(0,t)=f(t),u(\pi/2,t)=g(t)\Rightarrow v(x,t)+f(t)+h(x)(g(t)-f(t))$ with any function $h(x)|h(0)=0,h(\pi/2)=1$. – QuantumPotatoïd Oct 20 '21 at 07:33
  • I don't know about the relativistic boundary, but I solved the problem based on what you said, and separated the problem into a homogenous and inhomogeneous component and then used eigenfunction expansion to solve it – Yuki.kuroshita Oct 22 '21 at 18:12
  • For example I obtained for SE with relativistic boundaries : $u(x,t)=\sum_{n=0}^\infty A_ne^{-\frac{i\hbar(2n+1)^2\pi^2}{8mc^2t}}\cos ((2n+1)\frac{\pi x}{2ct})$, the An are found by projecting on the initial state delta. – QuantumPotatoïd Oct 25 '21 at 13:20
  • Could you write an answer on how you solved it? I got a very different answer. I am not sure what relativistic boundary conditions would do in this scenario but I could also write an answer to show how I solved it – Yuki.kuroshita Oct 26 '21 at 00:13

2 Answers2

2

From @Cretin2's comment I figured what the original answer was missing was splitting the equation into homogenous and inhomogeneous parts.So I start with that:-

$$ u_t=Ku_{xx} \\ u(x=0,t)=f(t) \\ u(x=L,t)=g(t) \\ u(x,t=0)=\phi(x)\\ $$ $u$ is composed of a homogenous and inhomogeneous term, represented by $u_h$ and $u_{ih}$ respectively $$ u=u_{ih}+u_h \\ \frac{\partial^2u_{ih}}{\partial x^2}=0 \\ \implies u_{ih}=c_1x+c_2 \\ $$

Substituting- $$ u_{ih}(x=0,t)=f(t) \\ u_{ih}(x=L,t)=g(t) \\ $$ we get, $$ c_2=f(t) \\ c_1=\frac{g(t)-f(t)}{L} \\ \implies u_{ih}=\frac{g(t)-f(t)}{L}x+f(t) $$ Plugging this into the equation for $u$, we get,

$$ u=\frac{g(t)-f(t)}{L}x+f(t)+u_h \\ \frac{\partial u}{\partial t}=\frac{\dot{g(t)}-\dot{f(t)}}{L}x+\dot{f(t)} + \frac{\partial u_h}{\partial t} \\ \frac{\partial^2 u}{\partial x^2}=\frac{\partial^2 u_h}{\partial x^2} \\ \implies \frac{\partial u_h}{\partial t}=K\frac{\partial^2 u_h}{\partial x^2}+\frac{\dot{f(t)}-\dot{g(t)}}{L}x-\dot{f(t)} $$

Let $\frac{\dot{f(t)}-\dot{g(t)}}{L}x-\dot{f(t)}=F(x,t)$ which is now the "source term"

$$ \frac{\partial u_h}{\partial t}=\frac{\partial^2 u_h}{\partial x^2}+F(x,t) $$

with boundary conditions :- $$ u_h(x=0,t)=0 \\ u_h(x=L,t)=0 \\ u_h(x,t=0)=u(x,t=0)-u_{ih}(x,t=0) \\ \implies u_h(x,t=0)=\phi(x)-\frac{g(0)-f(0)}{L}x-f(0)=\psi(x) $$

To solve this PDE, I can now use eigenfunction epansion. If there was no source term, by using separation of variables we could solve $u_h$

$$ u_h(x,t)=\sum_{n=1}^\infty u_n(t) \sin(\lambda_n x) \\ \lambda=\frac{n \pi}{L} $$

Where $u_n(t)$ is the time dependent factor of $u_h(x,t)$.

$$ \frac{\partial u_h}{\partial t}=\sum_{n=1}^\infty v_n(t) \sin(\lambda_n x) \\ \frac{\partial^2 u_h}{\partial x^2}=\sum_{n=1}^\infty w_n(t) \sin(\lambda_n x) \\ $$

where,

$$ v_n(t)=\frac{d u_n}{dt} \\ w_n(t)=-\lambda_n^2 u_n(t) $$

Let $F(x,t)=\sum_{n=1}^\infty f_n(t) \sin(\lambda_n x)$

Wecan substitute all of these in the original equation and after some simplification we get,

$$ \frac{du_n}{dt}=-K\lambda_n^2u_n(t)+f_n(t) $$

This is a simple ODE in $u_n$ which I solved by multiplying by an integrating factor to get -

$$ u_n(t)=e^{-\lambda_n^2Kt}\int_0^t e^{\lambda_n^2 K\tau}f_n(\tau) d\tau + e^{-\lambda_n^2Kt} c $$

where $c$ is a constant of integration

$$ u_n(0)=0+c $$

So we need to now find u_n(0) and f_n(t). We know,

$$ \int_0^L \sin(\lambda_mx)\sin(\lambda_nx) dx=0, m\neq n \\ = L/2, m=n $$

we have,

$$ u_h(x,t)=\sum_{n=1}^\infty u_n(t) \sin(\lambda_n x) \\ \int_0^L u_h(x,t)\sin(\lambda_n x) dx = u_n(t) L/2 \\ u_n(0)=\frac{2}{L}\int_0^L u(x,t=0) \sin(\lambda_nx) dx \\ \implies u_n(0)=\frac{2}{L}\int_0^L \psi(x) \sin(\lambda_nx) dx $$

Similarly for $f_n(t)$ we have,

$$ f_n(t)=\frac{2}{L}\int_0^L F(x,t) \sin(\lambda_n x) dx $$

Plugging everything in, we get,

$$ u(x,t)=\frac{g(t)-f(t)}{L}x+f(t)+\sum_{n=1}^\infty u_n(t) \sin(\frac{n \pi}{L} x) \\ u_n(t)=e^{-(\frac{n \pi}{L})^2 Kt}\int_0^t e^{(\frac{n \pi}{L})^2 K\tau}\frac{2}{L}\int_0^L \frac{\dot{f(\tau)}-\dot{g(\tau)}}{L}x-\dot{f(\tau)} \sin(\frac{n \pi}{L} x) dx d\tau \\ + e^{-(\frac{n \pi}{L})^2Kt} \frac{2}{L}\int_0^L \psi(x) \sin(\frac{n\pi}{L}x) dx $$

This satisfies all the BCs without the need to introduce any additional conditions

  • What happens if $f(t)$ and $g(t)$ are not differentiable, but are only continuous? I know that the problem has a solution (see, for example, Friedman's Parabolic PDE text, chapter 3, Theorem 9). Is there still a way to make such an explicit formulation? – qp212223 Dec 21 '23 at 02:05
  • Also, how do we get a Fourier series for $F(x,t)$ if it does not have period $L$? – qp212223 Dec 21 '23 at 02:31
1

The equation is $$\partial^2_x u(x,t)=K\partial_t u(x,t)$$ Boundary : $$u(\pm ct,t)=0$$

Eigenfunctions of the lhs operator with the boundary : $$v_n(x,t)=\cos\left((2n+1)\frac{\pi x}{2ct}\right)$$

Expansion in the base obtained : $$u(x,t)=\sum_{n=0}^\infty a_n(t)v_n(x,t)$$

Plugging in the original function :

$$-\sum_n (2n+1)^2\frac{\pi^2}{4c^2t^2} a_n(t)v_n(x,t)=K\sum_n \dot{a}_n(t)v_n(x,t)+a_n(t)(2n+1)\frac{\pi x}{2ct^2}\sin\left((2n+1)\frac{\pi x}{2ct}\right)$$

Projection : $$\int_{-ct}^{ct}v_m(x,t)\cdot dx$$ based on :

$$\int_D\cos(ax)\cos(bx)dx=\frac{a\sin(ax)\cos(bx)}{a^2-b^2}-b\frac{\cos(ax)\sin(bx)}{a^2-b^2}=0,a\neq b$$ due to vanishing of cosines at boundary

$$\int_D \cos(ax)\cos(ax)dx=\frac{\sin(ax)\cos(ax)}{2a}+x/2=ct$$

$$\int_D x\sin(ax)\cos(bx)dx=1/2\left(\frac{\sin(x(a-b))}{(a-b)^2}+\frac{\sin(x(a+b))}{(a+b)^2}-\frac{x\cos(x(a-b))}{(a-b)}-\frac{x\cos(x(a+b))}{(a+b)}\right)=c(-1)^{m+n}\frac{2n+1}{(m+n)(m+n+1)}=C_{mn}, a\neq b$$

The sines vanish because sum and difference of 2 odd numbers is even.

You were right, This is where I made the mistake, the matrix is not diagonal but full.

Remains

$$\int_D x\sin(ax)\cos(ax)dx=ct/2a=\frac{c^2t^2}{(2n+1)\pi}=b_n(t)$$

Let $D_{mn}(t)=b_n(t)\delta_{mn}+C_{mn}$

The equation for the coefficients is :

$$-K^{-1}\left((2n+1)^2\frac{\pi^2}{4ct}\right)a_n(t)=\dot{a}_n(t)ct+\sum_{m=0}^\infty D_{nm}(t)a_m(t)$$

Hence we get an infinite system of odes written as a matrix system of the form : $$\dot{\vec{a}}(t)=F(t)\vec{a}(t)\Rightarrow \vec{a}(t)=e^{\int_0^t F(s)ds}\vec{a}(0)$$

  • Ah I see. With relativistic boundary conditions you could do it like this, but I don't think you need them for this specific problem. I will post how I did it. – Yuki.kuroshita Oct 27 '21 at 15:24
  • It depends if one doesn't want to violate causality, other than the solution of qft in physics. – QuantumPotatoïd Oct 28 '21 at 04:17
  • Depends of what u is I guess. If u is signifying temperature, this is just the 1-D heat equation, if u is the hydraulic head, it is just the groundwater flow equation, if u is concentration, it is the diffusion equation and so on. – Yuki.kuroshita Oct 29 '21 at 04:17