# Analytic solution of dynamic Euler–Bernoulli beam equation with compatibility condition

The Euler–Bernoulli beam equation (also known as wave equation for beam) with pined-pined boundary has well-known solutions, but directly input the equation into Mathematica does not return them.

$$EI\cfrac{\partial^4 w}{\partial x^4} + \mu\cfrac{\partial^2 w}{\partial t^2} == 0$$ $$w(0,t) = w(L,t)=0 \\ \cfrac{\partial^2 w(0,t)}{\partial x^2}=\cfrac{\partial^2 w(L,t)}{\partial x^2}=0$$

DSolve[{EI D[y[x, t], {x, 4}] + mu D[y[x, t], {t, 2}] == 0,
y[0, t] == 0, y[L, t] == 0, Derivative[2, 0][y][0, t] == 0,
Derivative[2, 0][y][L, t] == 0}, y[x, t], {x, t}]


Can anyone give me a hint on how to solve it using DSolve?

## Update:

Adding initial conditions does not help:

DSolve[{K D[y[x, t], {x, 4}] + M D[y[x, t], {t, 2}] == 0,
y[0, t] == 0, y[L, t] == 0, Derivative[2, 0][y][0, t] == 0,
Derivative[2, 0][y][L, t] == 0, y[x, 0] == Sin[x/L Pi],
Derivative[0, 1][y][x, 0] == 0}, y[x, t], {x, t}]


## The actual situation

Here is the actual boundary conditions and compatibility conditions I am trying to solve:

1. Boundary conditions: $$w(0,t) = w(L,t)=0 \\ \cfrac{\partial^2 w(0,t)}{\partial x^2}=\cfrac{\partial^2 w(L,t)}{\partial x^2}=0$$
2. Compatibility conditions:

(1). compatibility condition for spring at $L/2$ $$w(x,t)\lvert_{x\to L/2^-}=w(x,t)\lvert_{x\to L/2^+}\\w'(x,t)\lvert_{x\to L/2^-}=w'(x,t)\lvert_{x\to L/2^+}\\w''(x,t)\lvert_{x\to L/2^-}=w''(x,t)\lvert_{x\to L/2^+}\\w'''(x,t)\lvert_{x\to L/2^-}=w'''(x,t)\lvert_{x\to L/2^+}+k w(L/2,t)$$ (2). compatibility condition for mass at $x_m$ $$w(x,t)\lvert_{x\to x_m^-}=w(x,t)\lvert_{x\to x_m^+}\\w'(x,t)\lvert_{x\to x_m^-}=w'(x,t)\lvert_{x\to x_m^+}\\w''(x,t)\lvert_{x\to x_m^-}=w''(x,t)\lvert_{x\to x_m^+}\\w'''(x,t)\lvert_{x\to x_m^-}=w'''(x,t)\lvert_{x\to x_m^+}-M\ddot w(x_m,t)$$

For special cases of the problem, Russian expert Filippov gave the solution in his book in 1970, but it is now very hard to find a copy of the book. And what is worse, the book is written in Russian.

Solving this problem maybe is reinvent the wheel, but the old way to manufacture the wheel is lost.

I opened a new question on how to trade compatibility condition here.

• Have you tried adding initial conditions as well? like y[x,0] = ... and y(0,1)[x,0] = ... May 23 '15 at 18:23
• @GregoryRut This seems to be a wave equation for flexural motion in a rigid membrane ... May 23 '15 at 18:24
• @GregoryRut There are various kinds of wave equations, what you are referring to is the simplest 1d case, which is the wave equation for strings. The equation presented here, is the second simplest case, which is the wave equation for uniform beam. May 25 '15 at 2:03
• This looks like the vibration of a beam. The beam will have an infinite number of natural frequencies. This is an eigenvalue problem with each eigenvalue corresponding to a natural frequency. Engineering text books give the standard solution through separation of variables as in xzczd below. Space solution is in terms of a Cos[ k x] + b Sin[ k x] + c Cosh[k s] +d Shin[k x] where the a, b, c d depend on boundary conditions and k is a wave number. I solve this and your extended problem with the spring or mass regularly. I am away at the moment but will give you a solution in a few days time.
– Hugh
May 25 '15 at 5:51
• Bichoy, kattern, thanks. Seems I was a little bit ignorant. May 25 '15 at 17:09

The short answer is: It's a common sense that (at least currently) DSolve is very weak on solving PDE and it simply can't handle this problem, period. However, with a little effort, you can solve it with LaplaceTransform:

eqn = ϵ D[y[x, t], {x, 4}] + μ D[y[x, t], {t, 2}] == 0;
ic = {y[x, 0] == Sin[x/L Pi], Derivative[0, 1][y][x, 0] == 0};
bc = {y[0, t] == 0, y[L, t] == 0,
Derivative[2, 0][y][0, t] == 0, Derivative[2, 0][y][L, t] == 0};

teqn = With[{l = LaplaceTransform},
l[{eqn, bc}, t, s] /. HoldPattern@l[u_, t, s] :> u] /. Rule @@@ ic


$$\left\{\mu \left(s^2 y(x,t)-s \sin \left(\frac{\pi x}{L}\right)\right)+\epsilon y^{(4,0)}(x,t)=0,\left\{y(0,t)=0,y(L,t)=0,y^{(2,0)}(0,t)=0,y^{(2,0)}(L,t)=0\right\}\right\}$$

Notice that $y(x,t)$ actually represents $\mathcal{L}_t[y(x,t)](x)$ in teqn. I made this replacement because DSolve has some difficulty in understanding $\mathcal{L}_t[y(x,t)](x)$. Now we just need to solve teqn with DSolve:

tsol = DSolve[teqn, y[x, t], x][[1, 1, -1]]


$$\frac{\mu L^4 s \sin \left(\frac{\pi x}{L}\right)}{\left(\pi ^2 \sqrt{\epsilon }-i \sqrt{\mu } L^2 s\right) \left(\pi ^2 \sqrt{\epsilon }+i \sqrt{\mu } L^2 s\right)}$$

and change the transformed solution back:

sol = InverseLaplaceTransform[tsol, s, t]


$$\frac{1}{2} \sin \left(\frac{\pi x}{L}\right) e^{-\frac{i \pi ^2 t \sqrt{\epsilon }}{\sqrt{\mu } L^2}} \left(1+e^{\frac{2 i \pi ^2 t \sqrt{\epsilon }}{\sqrt{\mu } L^2}}\right)$$

When dealing with an initial boundary value problem, the above approach is more automatic than Jens' method of separation of variables. You can wrap the procedure into a function:

pdeSolveWithLaplaceTransform[eqn_, ic_, func : _[__], t_, nott_] :=
With[{l = LaplaceTransform},
Module[{s},
InverseLaplaceTransform[
func /. First@
DSolve[l[eqn, t, s] /. HoldPattern@l[u_, t, s] :> u /. Rule @@@ Flatten@{ic},
func, nott], s, t]]]


This function will probably fail in more complex cases, but does have a certain generality, for example, it can handle the problem in this post like this:

eqn = D[p[x, t], {t, 2}] == c^2 (D[p[x, t], {x, 2}]);
ic = {p[x, 0] == Exp[x], D[p[x, t], t] == Sin[x] /. t -> 0};

pdeSolveWithLaplaceTransform[eqn, ic, p[x, t], t, x]


$$c_1 \delta \left(t+\frac{x}{c}\right)+c_2 \delta \left(t-\frac{x}{c}\right)+\frac{c \left(e^{2 c t}+1\right) e^{x-c t}-i e^{-i c t} \left(-1+e^{2 i c t}\right) \sin (x)}{2 c}$$

## Update: solution to the actual situation

OK, since a solution containing InverseLaplaceTransform is acceptable for you, I'd like to make this complement. Still, I'll use LaplaceTransform for your actual situation. For brevity, let's define a helper function, a pdeSolveWithLaplaceTransform without inverse transform:

helper[eqn_, ic_, func : _[__], t_, s_, nott_, const_: C] :=
func /. First@
DSolve[With[{l = LaplaceTransform}, l[eqn, t, s] /. HoldPattern@l[u_, t, s] :> u] /.
Rule @@@ ic, func, nott, GeneratedParameters -> const]


First find the transformed solutions with boundary conditions at only one side respectively:

eqn = ϵ D[y[x, t], {x, 4}] + μ D[y[x, t], {t, 2}] == 0;
ic = {y[x, 0] == Sin[x/L Pi], Derivative[0, 1][y][x, 0] == 0};
bcL = {y[0, t] == 0, Derivative[2, 0][y][0, t] == 0};
bcR = {y[L, t] == 0, Derivative[2, 0][y][L, t] == 0};

tsolL = helper[{eqn, bcL}, ic, y[x, t], t, s, x, cL]
tsolR = helper[{eqn, bcR}, ic, y[x, t], t, s, x, cR]


Needless to say, tsolL and tsolR involve constants. (To be more specific, cL, cL, cR, cR.) How to eliminate them? We still have compatibility conditions unused:

(1) compatibility condition for spring at $L/2$

cond1 = Solve[{# == #2, D[#, x] == D[#2, x], D[#, {x, 2}] == D[#2, {x, 2}],
D[#, {x, 3}] == D[#2, {x, 3}] + k #} &[tsolL, tsolR] /. x -> L/2,
{cL, cL, cR, cR}][];

tsolLcond1 = tsolL /. cond1 (*// Simplify*)
tsolRcond1 = tsolR /. cond1 (*// Simplify*)


(2) compatibility condition for mass at $x_m$

cond2 = Solve[{# == #2, D[#, x] == D[#2, x], D[#, {x, 2}] == D[#2, {x, 2}],
D[#, {x, 3}] == D[#2, {x, 3}] + s^2 # - s ic[[1, -1]] - ic[[2, -1]]} &
[tsolL, tsolR] /. x -> xm, {cL, cL, cR, cR}][];

tsolLcond2 = tsolL /. cond2 (*// Simplify*)
tsolRcond2 = tsolR /. cond2 (*// Simplify*)


The result is quite lengthy so I'd like to omit them here. The final step is to make the inverse transform. As mentioned above, InverseLaplaceTransform will remain unevaluated. If you want to calculate the transform numerically in the future work, have a look at this package.

• I agree this method maybe more useful, when I am considering about complex boundary condition. Actually, what I am trying to obtain is a even more complex boundary. I will update it in the question, since it is too long to be posted here. May 25 '15 at 5:08
• (+1) Indeed, Laplace transforms also helped overcome the inability to solve an integro-differential equation here. For more complex boundary conditions it may be necessary to use superpositions of the general solution I obtained from separation of variables.
– Jens
May 25 '15 at 17:50
• @kattern As to the The actual situation: is a solution involving unevaluated InverseLaplaceTransform acceptable? May 26 '15 at 5:52
• I think so. Because for this problem, most publications mostly obtain eigenfrequency equations. Then, the solutions of the equation are calculated based on numerical solutions of the eigenfrequency equation. May 26 '15 at 5:58

You can help Mathematica solve this partial differential equation by telling it to use separation of variables, as in DSolve doesn't find a solution (this may be a duplicate, but I decided to answer in order to show how to adapt my linked answer here):

op =
Function[y, ϵ D[y, {x, 4}] + μ D[y, {t, 2}]];

ansatz = ψ[x] f[t]

(* ==> f[t] ψ[x] *)

eq2 = Subtract @@ Simplify[op[ansatz]/ansatz == 0]

ψSolution =
DSolve[Select[eq2, FreeQ[#, t] &] == C^2, ψ[x], x]


$$\left\{\left\{\psi (x)\to c_3 e^{-\frac{\sqrt{c_1} x}{\sqrt{\epsilon }}}+c_5 e^{\frac{\sqrt{c_1} x}{\sqrt{\epsilon }}}+c_4 \sin \left(\frac{\sqrt{c_1} x}{\sqrt{\epsilon }}\right)+c_2 \cos \left(\frac{\sqrt{c_1} x}{\sqrt{\epsilon }}\right)\right\}\right\}$$

fSolution =
DSolve[Select[eq2, FreeQ[#, x] &] == -C^2, f[t], t,
GeneratedParameters -> B]


$$\left\{\left\{f(t)\to B(2) \sin \left(\frac{c_1 t}{\sqrt{\mu }}\right)+B(1) \cos \left(\frac{c_1 t}{\sqrt{\mu }}\right)\right\}\right\}$$

generalSolution =
ansatz /. Flatten[Join[ψSolution, fSolution]]


$$\left(c_3 e^{-\frac{\sqrt{c_1} x}{\sqrt{\epsilon }}}+c_5 e^{\frac{\sqrt{c_1} x}{\sqrt{\epsilon }}}+c_4 \sin \left(\frac{\sqrt{c_1} x}{\sqrt{\epsilon }}\right)+c_2 \cos \left(\frac{\sqrt{c_1} x}{\sqrt{\epsilon }}\right)\right) \left(B(2) \sin \left(\frac{c_1 t}{\sqrt{\mu }}\right)+B(1) \cos \left(\frac{c_1 t}{\sqrt{\mu }}\right)\right)$$

I find the general solution in two steps, where the second DSolve requires a separate set of names for the integration constants, specified by GeneratedParameters.

• This one worked for me but how to find the unknown C's and B's in view of the ic or bc?
– zhk
May 26 '15 at 11:30