22mdum.mws

Partial Differential Equations PowerTool

by Dr. Jim Herod

Section 5.4: A String in a Viscous Medium

Maple Packages for Section 5.4

>    restart;

>    with(plots):

Warning, the name changecoords has been redefined

>    with(PDEtools):

>   

The variation on the wave equation we consider in this section is the following:

                              diff(u,`$`(x,2))-k*diff(u,t)-g = diff(u,`$`(t,2))

                                            u(t, 0) = 0 = u(t, L)

 

                                            u( 0, x) = F(x)

                                             u[t]  ( 0 , x) = G(x).

This problem has a physical realization. It models a string for which there is a downward pull, perhaps gravity. Also, there is a force pulling in the opposite direction from the velocity. Thus, if the vibration of the string occurs in a viscous medium, there is a resistance proportional to the velocity of the motion of the string.

If you were in a Mathematics office or an Engineering office and stepped out into the hall from your workplace, stopped the first person you saw, and asked them how to solve this PDE, they would respond something such as, "Separate variables. Isn't that how you do all those problems?"

I say to you: "Surely. Separation of variables is one of the main ideas of these notes." So, let's solve the equation as the person we might stop in the hall would. Let's use the techniques of Fourier Series.

To be specific, we will get solutions that we can graph for the equation:

                           diff(w,`$`(x,2))-diff(w,t)/5-32 = diff(w,`$`(t,2))

                                            w(t, 0) = 0 = w(t,   Pi )

 

                                            w( 0, x) = sin(x)

                                             w[t]  ( 0 , x) = 0.

Recognize that this is a non-homogeneous problem. The -32 term makes it so. We must separate out the steady state solution and the transient solution.

The steady state solution v(x) is independent of time. Thus, that solution will satisfy the equation

                  diff(v(x),`$`(x,2))  - 32 = 0,  with v(0) = 0 = v( Pi ).

We solve this second order ordinary differential equation.

>    dsolve({diff(v(x),x,x)=32,v(0)=0,v(Pi)=0},v(x));

v(x) = 16*x^2-16*Pi*x

We find that the steady state solution is v(x) = 16*x^2-16*Pi*x .

>    v:=x->16*x^2-16*Pi*x;

v := proc (x) options operator, arrow; 16*x^2-16*Pi*x end proc

Next we solve the transient equation. The transient equation is

                         diff(w,`$`(x,2))-diff(w,t)/5 = diff(w,`$`(t,2))

                                            w(t, 0) = 0 = w(t, Pi )

 

                                            w( 0, x) = sin(x/2) - v(x)

                                             w[t]  ( 0 , x) = 0.

How do we solve this transient equation? Just like the hall-walker said: we separate variables. This leads to equations

                    X''/X = (T'' +T '/5 )/T.

In the usual manner, we arrive at two ordinary differential equations, the solutions of which lead to the solutions for the PDE:

            X '' = lambda  X,  with X(0) = X( Pi  ) = 0

and

            T '' + T'/5 = lambda  T.

We've seen the X equation enough to know all solutions: lambda  = -n^2  and X[n] (x) = sin( n*Pi*x/L ) = sin(n x ). Check this by asking:

(1) Is X[n] '' = lambda    X[n]  ?

(2) Is X[n] (0) = 0 ?   Is X[n] ( Pi ) = 0 ?

The answer to the three questions is yes.

For each n, we solve the T equation. Be sure we know what the T equation is:

                        T '' + T'/5 = -n^2  T.

Since this is a second order equation in T, we expect two constants. These will be constants that we will determine by some Fourier process.

     How many terms shall we do? Let's call the number of terms we choose to do by the name N.

>    N:=5;

N := 5

>    for n from 1 to N do
   dsolve(diff(T(t),t,t)+diff(T(t),t)/5=-n^2*T(t),T(t));
end do;
n:='n':

T(t) = _C1*exp(-1/10*t)*sin(3/10*11^(1/2)*t)+_C2*exp(-1/10*t)*cos(3/10*11^(1/2)*t)

T(t) = _C1*exp(-1/10*t)*sin(1/10*399^(1/2)*t)+_C2*exp(-1/10*t)*cos(1/10*399^(1/2)*t)

T(t) = _C1*exp(-1/10*t)*sin(1/10*899^(1/2)*t)+_C2*exp(-1/10*t)*cos(1/10*899^(1/2)*t)

T(t) = _C1*exp(-1/10*t)*sin(1/10*1599^(1/2)*t)+_C2*exp(-1/10*t)*cos(1/10*1599^(1/2)*t)

T(t) = _C1*exp(-1/10*t)*sin(7/10*51^(1/2)*t)+_C2*exp(-1/10*t)*cos(7/10*51^(1/2)*t)

>   

It would be nice to have a good formula for those trig terms. I need a formula that represents this sequence:

                  sqrt(99), sqrt(399), sqrt(899), sqrt(1599), sqrt(2499) , ... .

   

The question is: how can I write that multiple of t inside those sine or cosine function as a function of n. (Such questions are often on IQ tests.) Here's a way to find the answer. I'll solve the equation again without saying what n is.

>    dsolve(diff(T(t),t,t)+diff(T(t),t)/5=-n^2*T(t),T(t));

T(t) = _C1*exp((-1/10+1/10*(1-100*n^2)^(1/2))*t)+_C2*exp((-1/10-1/10*(1-100*n^2)^(1/2))*t)

>   

It is clear what the terms are now, isn't it? Using the Euler identity relating exponential and trig functions, each T is of the form

              T[n](t) = A[n]*exp(-t/10)*cos(t*sqrt(100*n^2-1)/10)+B[n]*exp(-t/10)*sin(t*sqrt(100*n^2-1)/10) .

I can now make the general solution for the PDE. I hope you can too.

>    w:=(t,x)->
 sum(A[n]*exp(-t/10)*cos(t*sqrt(100*n^2-1)/10)*sin(n*x),n=1..N)+
 sum(B[n]*exp(-t/10)*sin(t*sqrt(100*n^2-1)/10)*sin(n*x),n=1..N);

w := proc (t, x) options operator, arrow; sum(A[n]*exp(-1/10*t)*cos(1/10*t*sqrt(-1+100*n^2))*sin(n*x),n = 1 .. N)+sum(B[n]*exp(-1/10*t)*sin(1/10*t*sqrt(-1+100*n^2))*sin(n*x),n = 1 .. N) end proc

>   

We check that this is a general solution. Ask: does it satisfy the PDE and the boundary conditions? (The initial conditions will determine the values of A and B.)

The PDE:

>    simplify(diff(w(t,x),x,x)-diff(w(t,x),t)/5-diff(w(t,x),t,t));

0

Boundary conditions:

>    w(t,0); w(t,Pi);

0

0

>   

It remains to determine the A's and B's. Observe what is u(0,x)  and u[t](0,x) .

>    w(0,x);

A[1]*sin(x)+A[2]*sin(2*x)+A[3]*sin(3*x)+A[4]*sin(4*x)+A[5]*sin(5*x)

>    D[1](w)(0,x);

-1/10*A[1]*sin(x)-1/10*A[2]*sin(2*x)-1/10*A[3]*sin(3*x)-1/10*A[4]*sin(4*x)-1/10*A[5]*sin(5*x)+1/10*B[1]*99^(1/2)*sin(x)+1/10*B[2]*399^(1/2)*sin(2*x)+1/10*B[3]*899^(1/2)*sin(3*x)+1/10*B[4]*1599^(1/2)*si...
-1/10*A[1]*sin(x)-1/10*A[2]*sin(2*x)-1/10*A[3]*sin(3*x)-1/10*A[4]*sin(4*x)-1/10*A[5]*sin(5*x)+1/10*B[1]*99^(1/2)*sin(x)+1/10*B[2]*399^(1/2)*sin(2*x)+1/10*B[3]*899^(1/2)*sin(3*x)+1/10*B[4]*1599^(1/2)*si...

>    DerivTerm:=collect(collect(collect(collect(collect(%,sin(x)),sin(2*x)),sin(3*x)),sin(4*x)),sin(5*x));

DerivTerm := (-1/10*A[5]+1/10*B[5]*2499^(1/2))*sin(5*x)+(-1/10*A[4]+1/10*B[4]*1599^(1/2))*sin(4*x)+(-1/10*A[3]+1/10*B[3]*899^(1/2))*sin(3*x)+(-1/10*A[2]+1/10*B[2]*399^(1/2))*sin(2*x)+(-1/10*A[1]+1/10*B...
DerivTerm := (-1/10*A[5]+1/10*B[5]*2499^(1/2))*sin(5*x)+(-1/10*A[4]+1/10*B[4]*1599^(1/2))*sin(4*x)+(-1/10*A[3]+1/10*B[3]*899^(1/2))*sin(3*x)+(-1/10*A[2]+1/10*B[2]*399^(1/2))*sin(2*x)+(-1/10*A[1]+1/10*B...

>   

It seems clear that we can get the A's through a simple Fourier Series. Having the A's we can get the B's. We do that here. This is the first time in this problem to use the initial conditions.

Recall that the solution for the original problem is

        u(t, x) = v(x) + w(t, x).

Thus,   u(0, x) = v(x) + w(0, x)   and     diff(u,t) (0,x) = diff(w,t) (0,x).

This means that  

    A[n] = int((f(x)-v(x))*sin(n*x),x)/int(sin(n*x)^2,x)  

and

    (sqrt(100*n^2-1)*B[n]-A[n])/10   =   int(g(x)*sin(n*x),x)/int(sin(n*x)^2,x())  .

We compute

>    fmv:=x->sin(x)-v(x);

fmv := proc (x) options operator, arrow; sin(x)-v(x) end proc

>    for n from 1 to N do
   A[n]:=int(fmv(x)*sin(n*x),x=0..Pi)/int(sin(n*x)^2,x=0..Pi);
od;

A[1] := 2*(64+1/2*Pi)/Pi

A[2] := 0

A[3] := 128/27/Pi

A[4] := 0

A[5] := 128/125/Pi

>    g:=x->0;

g := 0

>    for n from 1 to N do
   B[n]:=(10*int(g(x)*sin(n*x),x=0..Pi)/int(sin(n*x)^2,x=0..Pi)+A[n])
                /sqrt(100*n^2-1);
end do;
n:='n';

B[1] := 2/33*(64+1/2*Pi)/Pi*11^(1/2)

B[2] := 0

B[3] := 128/24273/Pi*899^(1/2)

B[4] := 0

B[5] := 128/44625/Pi*51^(1/2)

n := 'n'

We now have the transient solution completely determined. We create the solution to the original problem:

                              u(t,x) = w(t,x) + v(x).

>    u:=(t,x)->w(t,x)+v(x);

u := proc (t, x) options operator, arrow; w(t,x)+v(x) end proc

It seems appropriate to check that this is really the solution. We check the boundary conditions.

>    u(t,0); u(t,Pi);

0

0

We check the PDE.

>    simplify(diff(u(t,x),x,x)-diff(u(t,x),t)/5-32-diff(u(t,x),t,t));

0

We check the initial conditions. For each one, we draw graphs to see how close we are to the initial value.

>    plot([sin(x),u(0,x)],x=0..Pi,color=[black,red]);

[Maple Plot]

We draw a graph to see how close the initial velocity is to zero. Off-set the graph so that it can be seen.

>    plot(eval(subs(t=0,diff(u(t,x),t)))+0.001,x=0..Pi,y=-1..1);

[Maple Plot]

We now show an animation. Can you predict the movement? It should be a vibrating string; the first derivative term is a retarding force so the oscillations should decrease in size; and the downward force should pull the string down to that hanging, steady state

>    with(plots):
animate(u(t,x),x=0..Pi,t=0..20, frames=40);

[Maple Plot]

In this Section, we have made the physical model more interesting. We assumed that the string lies in a viscous medium and is subject to a constant force pulling it downward. This made the partial differential equation more interesting. There were more terms to consider than the simple wave equation. To solve the problem, we used the methods of separation of variables.

Unassisted Maple

Because the problem of this section has been a wave equation problem and because we did not use d'Alembert's techniques, we wonder what Maple will suggest when unassisted. Will it suggest a variation on d'Alembert's Method, or will it suggest separation of variables?

Note that at the beginning, we called up the package PDEtools. We make a generic u and define the PDE.

>    u:='u';

u := 'u'

>    PDE:=diff(u(t,x),x,x)-diff(u(t,x),t,t)-diff(u(t,x),t)=0;

PDE := diff(u(t,x),`$`(x,2))-diff(u(t,x),`$`(t,2))-diff(u(t,x),t) = 0

Look to see what form Maple gets for a solutions.

>    ans := pdsolve(PDE);

ans := `&where`(u(t,x) = _F1(_xi1)*_F2(_xi2),[{diff(_F1(_xi1),_xi1) = _c[1]*_F1(_xi1), diff(_F2(_xi2),_xi2) = -_c[1]*_F2(_xi2)/(-1/2+2*_c[1])}, `&and`({_xi1 = -t+x, _xi2 = 1/2*t+1/2*x})])
ans := `&where`(u(t,x) = _F1(_xi1)*_F2(_xi2),[{diff(_F1(_xi1),_xi1) = _c[1]*_F1(_xi1), diff(_F2(_xi2),_xi2) = -_c[1]*_F2(_xi2)/(-1/2+2*_c[1])}, `&and`({_xi1 = -t+x, _xi2 = 1/2*t+1/2*x})])

>    build(ans);

u(t,x) = _C1/exp(_c[1]/(-1+4*_c[1])*(-t+x))*exp(_c[1]^2/(-1+4*_c[1])*(-t+x))^4/exp(_c[1]/(-1+4*_c[1])*(1/2*t+1/2*x))^2*_C2

This process provides solutions as exponentials. Most important, it suggests that one can obtain a solution to this problem by performing a d'Alembert type transformation to get a different second order partial differential equation. Going in these directions might be pursued at a different time.

EMAIL: herod@math.gatech.edu   or   jherod@tds.net

URL: http://www.math.gatech.edu/~herod

Copyright ©  2003  by James V. Herod

All rights reserved