Here is the problem. We have the following simple PDE: \begin{equation} \frac{\partial p(x,t)}{\partial t}= - a\frac{\partial p(x,t)}{\partial x} + \frac{D}{2} \frac{ \partial^2 p(x,t) }{\partial x^2}, \quad0<x<L, \quad t>0 \end{equation} where $a$ and $D$ are constants. We also have the following initial and boundary conditions: \begin{equation} p(x,0)=0\\ a p(x,t)- \frac{D}{2} \frac{\partial p(x,t)}{\partial x} = f(t) \quad at \quad x=0 \\ \frac{\partial^2 p(x,t)}{\partial x^2}=0 \quad at \quad x=L \end{equation}
The expression, $\frac{\partial^2 p(x,t)}{\partial x^2}=0$, is not a standard well-known boundary condition and makes the PDE difficult to solve. I would be grateful if anyone have any idea for solving this PDE.
The equations in the question can be written as
Unfortunately,
returns unevaluated with the error message,
because the last boundary condition, above, contains a first derivative in time. This situation has much in common with question 78493, even though the equations are different. Following that approach with (for example)
f = Sin[t], we decompose the PDE into a set of ODEs atnlocations inx.Note that the array of equations,
eqns, contains the boundary conditions,as well as
n - 1equations representing the PDE itself, for instance,That such equations are readily solvable numerically suggests (to me, at least) that this capability should be added to
NDSolve.