38FstOrd.mws

Partial Differential Equations PowerTool

by Dr. Jim Herod

Section 9.1: An Introduction to First Order Partial Differential Equations

Maple Packages for Section  9.1

>    restart:

>    with(plots):

Warning, the name changecoords has been redefined

>   

In this Section 9.1, we introduce the beginnings of ideas about first order partial differential equations.

We begin with a first order partial differential equation:

         1*diff(u,t)  + 2 diff(u,x)  = - u (t, x)  with u (0, x) = exp(- x^2 ).

The equation is called first order  because the partial derivatives are only of order one. There are no second order partials in this equation.

Previously, when considering a partial differential equation in these notes, we have discussed how a solution might be constructed, and then looked to see what Maple could do with obtaining a solution with little assistant from the user. In this Section, we will break with the pattern that we have used before, and look first at the solutions that Maple obtains. We will try to point out the features to consider as we examine these several examples.

 

Example 1.

Of course, the first thing is to declare what is the partial differential equation that we want to solve.

>    PDE := diff(u(t,x),t)+2*diff(u(t,x),x)=-3*u(t,x);

PDE := diff(u(t,x),t)+2*diff(u(t,x),x) = -3*u(t,x)

The construction of a solution for this partial differential equation is done with pdsolve .

>    sol1:=pdsolve(PDE);

sol1 := u(t,x) = _F1(x-2*t)*exp(-3*t)

It is no surprise that, just as with first order ordinary differential equations, there is one unknown in this general solution. It is to be found by using the initial condition. Toward using the initial condition to find _F1, we make the general solution.

>    u1:=unapply(rhs(sol1),(t,x));

u1 := proc (t, x) options operator, arrow; _F1(x-2*t)*exp(-3*t) end proc

Next, we use the initial condition to determine this unknown function, _F1.

>    u1(0,x)=exp(-x^2);

_F1(x) = exp(-x^2)

Thus, we substitute this value for _F1, and make the special solution to the pde which has this initial value.

>    u1s:=unapply(subs(_F1(x-2*t)=exp(-(x-2*t)^2),u1(t,x)),(t,x));

u1s := proc (t, x) options operator, arrow; exp(-(x-2*t)^2)*exp(-3*t) end proc

Why not check to see that all is in order?

>    simplify(diff(u1s(t,x),t)+3*u1s(t,x)+2*diff(u1s(t,x),x));

0

We plot the solution. We visualize the initial value lying above the x axes when t = 0, and look to see how the initial value evolves as t increases.

>    plot3d(u1s(t,x),x=-3..3,t=0..2,axes=NORMAL,orientation=[-70,70]);

[Maple Plot]

Rotate that graph around a little and what you should observe is that the initial value moves toward zero at t increases and is pulled toward the "northeast". We try to develop a visualization of this by a sequence of graphs of u( t[n]  , x) as t[n]  increases. Step through the animation and watch as the peak drops and moves into the first quadrant.

>    for n from 0 to 10 do
   J[n]:=spacecurve([x,n/10,u1s(n/10,x)],x=-3..3,
             axes=normal,orientation=[-85,65]):
end do:

>    display3d([seq(J[n],n=0..10)],insequence=true);

[Maple Plot]

We ask: what changes in the pde could make the peak of the solution move toward the "northwest", into the second quadrant. Here is an example which shows one possible change to accomplish that modification of the graph..

>    PDE := diff(u(t,x),t)-2*diff(u(t,x),x)=-3*u(t,x);

PDE := diff(u(t,x),t)-2*diff(u(t,x),x) = -3*u(t,x)

>    sol1:=pdsolve(PDE);

sol1 := u(t,x) = _F1(x+2*t)*exp(-3*t)

>    u1:=unapply(rhs(sol1),(t,x));

u1 := proc (t, x) options operator, arrow; _F1(x+2*t)*exp(-3*t) end proc

>    u1(0,x)=exp(-x^2);

_F1(x) = exp(-x^2)

>    u1s:=unapply(subs(_F1(x+2*t)=exp(-(x+2*t)^2),u1(t,x)),(t,x));

u1s := proc (t, x) options operator, arrow; exp(-(x+2*t)^2)*exp(-3*t) end proc

>    simplify(diff(u1s(t,x),t)-2*diff(u1s(t,x),x)+3*u1s(t,x));

0

We changed one plus  to a minus  and expect the peak to change directions. Here is the graph that will show that this change accomplishes the task.

>    plot3d(u1s(t,x),x=-3..3,t=0..2,axes=NORMAL,orientation=[-70,70]);

[Maple Plot]

What changes in the pde could make the peak increase instead of decreasing. Here is a possibility.

>    PDE := diff(u(t,x),t)+2*diff(u(t,x),x)= 3*u(t,x);

PDE := diff(u(t,x),t)+2*diff(u(t,x),x) = 3*u(t,x)

>    sol1:=pdsolve(PDE);

sol1 := u(t,x) = _F1(x-2*t)*exp(3*t)

>    u1:=unapply(rhs(sol1),(t,x));

u1 := proc (t, x) options operator, arrow; _F1(x-2*t)*exp(3*t) end proc

>    u1(0,x)=exp(-x^2);

_F1(x) = exp(-x^2)

>    u1s:=unapply(subs(_F1(x-2*t)=exp(-(x-2*t)^2),u1(t,x)),(t,x));

u1s := proc (t, x) options operator, arrow; exp(-(x-2*t)^2)*exp(3*t) end proc

>    simplify(diff(u1s(t,x),t)+2*diff(u1s(t,x),x)-3*u1s(t,x));

0

We changed a different plus  to a minus  and expect the peak to grow. Here is the graph.

>    plot3d(u1s(t,x),x=-3..3,t=0..1,axes=NORMAL,orientation=[-70,70]);

[Maple Plot]

>   

As a check to see that you understand this idea, you might go back and change the PDE to get an increasing maximum moving into the second quadrant, instead of into the first quadrant as in the above picture.

Just as in a first study of ordinary differential equations, so here we started this examination with constant coefficients. What about variable coefficients? Some such equations can be tough, some are standard. Consider this second example:

             diff(u,t)  + x diff(u,x)  = - t  u (t, x) with u (0, x) = cos(x).

The term on the right is negative. Should we expect the peaks to decay to zero? The two partials are added if x is positive and subtracted if x is negative. Should we expect the peaks to move to the northeast in the right quadrant and to the northwest in the second quadrant?

We look at this example next.

Example 2

We follow the pattern we have had before without comment.

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

PDE := diff(u(t,x),t)+x*diff(u(t,x),x) = -t*u(t,x)

>    sol2:=pdsolve(PDE);

sol2 := u(t,x) = _F1(x/exp(t))*exp(-1/2*t^2)

>    u2:=unapply(rhs(sol2),(t,x));

u2 := proc (t, x) options operator, arrow; _F1(x/exp(t))*exp(-1/2*t^2) end proc

>    u2(0,x)=cos(x);

_F1(x) = cos(x)

>    u2s:=unapply(subs(_F1=cos,u2(t,x)),(t,x));

u2s := proc (t, x) options operator, arrow; cos(x/exp(t))*exp(-1/2*t^2) end proc

>    diff(u2s(t,x),t)+x*diff(u2s(t,x),x)+t*u2s(t,x);

0

>    plot3d(u2s(t,x),x=-2*Pi..2*Pi,t=0..3,axes=NORMAL,
           orientation=[65,65], lightmodel=light1, style=patchnogrid, numpoints=1000);

[Maple Plot]

Rotate the graph around. You should see that where x > 0 the graph moves toward the Northeast, and where x < 0, it moves toward the Northwest.

>    for n from 0 to 10 do
   J[n]:=spacecurve([x,n/10,u2s(n/10,x)],x=-2*Pi..2*Pi,
             axes=normal,orientation=[-85,65],view=[-2*Pi..2*Pi,0..2,-1..1]):
end do:

>    display3d([seq(J[n],n=0..10)],insequence=true);

[Maple Plot]

>   

These two example begin to give some ideas about the structure of solutions for first order PDE's. And, the question begins to creep into the conscious: what happens if the graph moves to the Northeast when x < 0 and to the Northwest when x > 0?

We have illustrated a constant coefficient, first order pde and a variable coefficient, first order pde. We now illustrate that some nonhomogeneous first order pde's can be solved. Recall that with ordinary differential equations, one had to exercise care if the coefficient of du/dt  was zero at t = 0. That happens in this next example. Just as with those examples in ordinary differential equations, so here we give the initial value  at t = 1.

Example 3

Since the steps are the same as in the above, we proceed without comment, again.

>    PDE := t*diff(u(t,x),t)+x*diff(u(t,x),x)=t*x*(t^2+1);

PDE := t*diff(u(t,x),t)+x*diff(u(t,x),x) = t*x*(t^2+1)

>    sol3:=pdsolve(PDE);

sol3 := u(t,x) = 1/4*x*t^3+1/2*x*t+_F1(x/t)

>    u3:=unapply(rhs(sol3),(t,x));

u3 := proc (t, x) options operator, arrow; 1/4*x*t^3+1/2*x*t+_F1(x/t) end proc

>    u3(1,x)=x^2;

3/4*x+_F1(x) = x^2

>    u3s:=unapply(subs(_F1(x/t)=(x/t)^2-3*x/t/4,u3(t,x)),(t,x));

u3s := proc (t, x) options operator, arrow; 1/4*x*t^3+1/2*x*t+x^2/t^2-3/4*x/t end proc

>    simplify(t*diff(u3s(t,x),t)+x*diff(u3s(t,x),x)-t*x*(t^2+1));

0

>    plot3d(u3s(t,x),x=-Pi..Pi,t=1..2,axes=NORMAL,orientation=[65,65]);

[Maple Plot]

>    for n from 10 to 20 do
   J[n]:=spacecurve([x,n/10,u3s(n/10,x)],x=-3..3,
             axes=normal,orientation=[35,65],view=[-3..3,0..2,-5..5],color=red):
od:

>    display3d([seq(J[n],n=10..20)],insequence=true);

[Maple Plot]

What is the status at this point. First, it should be clear that Maple can produce solutions and graphs for some partial differential equation in the form

    p(t, x) u[t]   +  q(t, x) u[x]  + r(t, x) u (t,x) = s(t, x).

It would be interesting to find the limits of what Maple can do with this type equation. We do not choose that route. Rather, we introduce the notion of characteristics  in the next section. This notion sheds some light on the geometry of solutions for such first order partial differential equations.

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