# Coupled PDEs: Wave and String Equations

I need to solve a system of mixed string and wave equations. Omitting some constants it looks like this:

$$u_ {\text {yy}} (y, t) - u_ {\text {tt}} (y, t) = \varphi _{t}(x, y, t)$$ $$\nabla _{\{x,y\}}^{}\varphi (x,y,t) = \varphi _{tt}(x,y,t)$$

With boundary and initial conditions:

$$u(\pm1,t)=0, u_t(y,0)=0,u(y,0)=\cos \left(\frac{\pi y}{2}\right)$$ $$\varphi _{x}(0, y, t)=u_t(y,t), \varphi _{y}(x, \pm1, t)=0$$

$$u(y,0)$$ function may be different. I've tried several ways with no success.

    pde = {Derivative[0, 2][u][y, t] == Derivative[2, 0][u][y, t] + Derivative[0, 1, 0][\[CurlyPhi]][0, y, t],
Derivative[2, 0, 0][\[CurlyPhi]][x, y, t] + Derivative[0, 2, 0][\[CurlyPhi]][x, y, t] == Derivative[0, 0, 2][\[CurlyPhi]][x, y, t] +
NeumannValue[Derivative[0, 1][u][y, t], x == 0] + NeumannValue[0, y == -1 || y == 1]};
bdc = {DirichletCondition[u[y, t] == 0, y == 1], DirichletCondition[u[y, t] == 0, y == -1],
DirichletCondition[\[CurlyPhi][x, y, t] == 0, x == 0]};
ic = {u[y, 0] == Cos[(Pi*y)/2], Derivative[0, 1][u][y, 0] == 0};
res = NDSolve[{pde, bdc, ic}, {u, \[CurlyPhi]}, {x, 0, 1}, {y, -1, 1}, {t, 0, 5}]


$$u(y,t) -> u(x,y,t)$$

    pde = {Derivative[0, 0, 2][u][x, y, t] == Derivative[0, 2, 0][u][x, y, t] + Derivative[0, 1, 0][\[CurlyPhi]][0, y, t],
Derivative[2, 0, 0][\[CurlyPhi]][x, y, t] + Derivative[0, 2, 0][\[CurlyPhi]][x, y, t] == Derivative[0, 0, 2][\[CurlyPhi]][x, y, t] +
NeumannValue[Derivative[0, 0, 1][u][x, y, t], x == 0] + NeumannValue[0, y == -1 || y == 1]};
bdc = {DirichletCondition[u[x, y, t] == 0, y == 1], DirichletCondition[u[x, y, t] == 0, y == -1],
DirichletCondition[\[CurlyPhi][x, y, t] == 0, x == 0]};
ic = {u[x, y, 0] == 0, u[x, y, 5] == 0};
res = NDSolve[{pde, bdc, ic}, {u, \[CurlyPhi]}, {x, 0, 1}, {y, -1, 1}, {t, 0, 5}]


Even took the original system:


pde = {Derivative[0, 2, 0][u][x, y, t] - Derivative[0, 0, 2][u][x, y, t] - \[Rho][0, y, t] == 0,
Derivative[0, 0, 1][\[Rho]][x, y, t] + Derivative[1, 0, 0][vx][x, y, t] + Derivative[0, 1, 0][vy][x, y, t] == 0,
Derivative[0, 0, 1][vx][x, y, t] - Derivative[1, 0, 0][\[Rho]][x, y, t] == 0,
Derivative[0, 0, 1][vy][x, y, t] - Derivative[0, 1, 0][\[Rho]][x, y, t] == 0};
bcs = {u[x, 1, t] == 0, u[x, -1, t] == 0, vx[0, y, t] == Derivative[0, 0, 1][u][x, y, t], vy[0, y, t] == 0,
vy[x, -1, t] == 0, vy[x, 1, t] == 0};
ics = {u[x, y, 0] == Cos[(Pi*y)/2], Derivative[0, 0, 1][u][x, y, 0] == 0, \[Rho][x, y, 0] == 0, vx[x, y, 0] == 0,
vy[x, y, 0] == 0};
res = NDSolve[{pde, bcs, ics}, {u, \[Rho], vx, vy}, {x, y, t}];


In all cases, different errors. I think I have a problem with the formulation of the problem for WM. Maybe I'm going the wrong way? Please, help me find the working solution.

TQ WM11

One problem is that the equations you have written down do not correspond to the coded equations and I am not sure what the correct input is. Here is one version of what you could mean - I have no idea if this makes any sense:

pde = {
D[u[x, y, t], {y, 2}] - D[u[x, y, t], {t, 2}] ==
D[\[CurlyPhi][x, y, t], t],
Laplacian[\[CurlyPhi][x, y, t], {x, y}] ==
D[\[CurlyPhi][x, y, t], {t, 2}] +
NeumannValue[Derivative[0, 0, 1][u][x, y, t], x == 0]};
bdc = {DirichletCondition[u[x, y, t] == 0, y == 1 || y == -1]};
ic = {u[x, y, 0] == Cos[\[Pi] y/2],
Derivative[0, 0, 1][u][x, y, 0] == 0, \[CurlyPhi][x, y, 0] == 0,
Derivative[0, 0, 1][\[CurlyPhi]][x, y, 0] == 0};
res = NDSolveValue[{pde, bdc, ic}, {u, \[CurlyPhi]}, {x, 0,
1}, {y, -1, 1}, {t, 0, 5}]


You need to think about initial conditions for phi.

GraphicsRow[{Plot3D[
Evaluate[res[[1]][x, y, 5]], {x, 0, 1}, {y, -1, 1}],
Plot3D[Evaluate[res[[2]][x, y, 5]], {x, 0, 1}, {y, -1, 1}]}]


• The code may vary in BC because I tried to simplify it to force to work it. The right BC in the begining of my post. In WM11 this code give me error: CoefficientArrays::poly: [CurlyPhi]$879+[CurlyPhi]$880-[CurlyPhi]$882-NeumannValue[u$881,x==0] is not a polynomial. NDSolveValue::femper: PDE parsing error of {-u$876+u$877-[CurlyPhi]$878,[CurlyPhi]$879+[CurlyPhi]$880-[CurlyPhi]$882-NeumannValue[u\$881,x==0]}. Inconsistent equation dimensions. – VasilySH Jun 5 '19 at 13:08
• @VasilySH, works fine for me in V11.3 and V12.0 – user21 Jun 5 '19 at 13:10
• @VasilySH, try without the NeumannValue to see if this is the only issue. – user21 Jun 5 '19 at 13:11
• Without NeumannValue it says: NDSolveValue::fembdnl: The dependent variable in (u^(0,0,1))[0,y,t]==0 in the boundary condition DirichletCondition[(u^(0,0,1))[0,y,t]==0,x==0.] needs to be linear. WM11.0.0 ( Also you put Dirichlet condition instead of Neumann on borders (y == 1 || y == -1) You fix function value instead of derivative. So it's wrong solution. – VasilySH Jun 5 '19 at 13:32
• @VasilySH, I updated the equation to use Neumann zero for phi_x. – user21 Jun 5 '19 at 13:48