I am trying to solve the equation
$$ \frac{d^2u}{dt^2}-\frac{d^2}{dx^2}\left(c_s^2u+\nu\frac{du}{dt}\right)=0 $$
with initial conditions
$$u(x, 0)=0$$
$$\frac{du}{dt}|_{t=0}=0$$
and boundary conditions
$$ {\frac{du}{dx}}|_{x=0,1}=a\sin{(\omega_d t)}-b\cos{(\omega_d t)}$$
My attempts so far are
ClearAll[u, x, t, a, b, c, w, n];
c = 1;
n = 1;
a = 1;
b = 1;
w = 1;
pde = D[u[t, x], t, t] - c*D[u[t, x], x, x] - n*D[u[t, x], x, x, t] == 0;
ics = {u[0,x]==0};
bcs =
{(D[u[t,x],x] /. x->0) == a*Sin[w*t]-b*Cos[w*t],
(D[u[t,x],x] /. x->1) == a*Sin[w*t]-b*Cos[w*t]};
sol = NDSolveValue[{pde, ics, bcs}, u, {x, 0, 1},{t, 0, 10}]
but I am receiving multiple error messages. Among them:
NDSolveValue::fembdnl: The dependent variable in (u^(0,1))[t,0]==-Cos[t]+Sin[t] in the boundary condition DirichletCondition[(u^(0,1))[t,0]==-Cos[t]+Sin[t],x==0.] needs to be linear.
NDSolveValue::fembdnl: The dependent variable in (u^(0,1))[t,0]==-Cos[t]+Sin[t] in the boundary condition DirichletCondition[(u^(0,1))[t,0]==-Cos[t]+Sin[t],x==0.] needs to be linear.
NDSolveValue::femcmsd: The spatial derivative order of the PDE may not exceed two.
How can I solve it?
NDSolve
solves the problem without difficulty,ibcinc
warning is generated, but it doesn't seem to be a big deal in this case. $\endgroup$ClearAll[u, x, t, a, b, c, w, n]; c = 1; n = 1; a = 1; b = 1; w = 1; pde = D[u[t, x], t, t] - c*D[u[t, x], x, x] - n*D[u[t, x], x, x, t] == 0; ics = {u[0, x] == 0, D[u[t, x], t] == 0 /. t -> 0}; bcs = {(D[u[t, x], x] /. x -> 0) == a*Sin[w*t] - b*Cos[w*t], (D[u[t, x], x] /. x -> 1) == a*Sin[w*t] - b*Cos[w*t]}; sol = NDSolveValue[{pde, ics, bcs}, u, {x, 0, 1}, {t, 0, 10}]; Plot3D[sol[t, x], {t, 0, 10}, {x, 0, 1}, PlotRange -> All]
$\endgroup$