Problem 4
Find the solution, , to the wave equation for a vibrating string which is initially flat but has a
specified initial velocity. More specifically, solve
with , , , and ,
where , , and .
First c lear the workspace and define .
> restart: f := x -> x*(Pi-x);
First note that the specific conditions do not exactly match the verbal description. The derivative condition
at implies that we have a sliding connection at that end so that the string always has a zero derivative.
If we keep this condition, then the problem is essentially identical to Problem 3. Let's consider the case
where .
Start by assuming a separable solution of the form . Then we can conclude that if there is a
solution of this form, then and must satisfy two ordinary differential equations of the form
and , where the separation constant, , is the same for both equations.
We consider the possible values of , and their role in the equation for . Note that the boundary
conditions imply that and .
With these values of we see that the general solution for the equation that is given by
.
Thus there are solutions to the heat equation of the form
.
We can instruct Maple to verify this as follows:
> u[k] := (x,t) -> (c[k]*cos(k*t)+d[k]*sin(k*t))*sin(k*x);
> D[2,2](u[k])(x,t) - D[1,1](u[k])(x,t);
> simplify(%);
We have two remaining conditions to satisfy, namely , and .
Since we have an infinite set of solutions, each with an unspecified coefficients, , and , can we find a linear
combination, which yields the solution?
That is, can we write ?
First, set and plug this into the series to get
.
But this can only be true for all if . This leaves the condition
This is the answer to Problem 2 provided we set .
> d[k] := (2/(k*Pi))*int(f(x)*sin(k*x),x=0..Pi);
> dcoef := unapply(d[k],k);
> d[1] := dcoef(1);d[2] := dcoef(2);d[3] := dcoef(3);d[4] := dcoef(4);d[5] := dcoef(5);
An approximation to the solultion using 25 terms is thus
> u[25] := (x,t) -> sum(dcoef(k)*sin(k*t)*sin(k*x),k=1..25);
We can get a plot of this approximate solution. It shows the string starting out flat and then vibrating periodically
> plot3d(u[25],0..Pi,0..10,axes=BOXED,labels=['x','t','u']);
We can also use Maple's plot package to view this solution as a movie.
> with(plots): animate(u[25](x,t), x=0..Pi, t=0..10);
>