687293743 3.3 The method of characteristic curves This method reduces the PDE u(x,y) to an ODE by following the solution in a special characteristic curve where u is a constant. PDEs with variable coefficients of the form u u + p(x,y) =0 x y (3.3-1) where p(x,y) is a function of x and y can be solved by the method of characteristic curves. We begin by reviewing the concept of directional derivative of a function. Let u(x,y) is a function of twovariables and v = (v1, v2) is a unit vector with arbitrary direction shown in Figure 3.3-1 where i and j are unit vectors in the x and y direction, respectively. y v v2j v1i x Figure 3.3-1. Unit vector v = (v1, v2) with arbitrary direction v = v1 i + v2 j = v cos i + v sin j (3.3-2) The directional derivative g’ of u measures the rate of change of u at the point (xo, yo) as we move in the direction of v . u u i + g’ = u v = ( j )( v1 i + v2 j ) x y g’ = v1 u u (xo, yo) + v2 (xo, yo) x y (3.3-3a) (3.3-3b) Consequently, if g’ = 0, then u is not changing in the direction of v . We next review the concept of directional field for an ODE. Consider the equation dy = p(x,y) dx (3.3-4) 63 687293743 The solution curve at the point (xo, yo) is changing in the direction of the vector (1, p(xo, yo)) as shown in Figure 3.3-2. y pxo,yo) xo,yo) slope = dy/dx = pxo,yo) x Figure 3.3-2. Slope of the tangent to the solution curve at (xo, yo). If we plot the vector (1, p(x, y)) for many points we obtain the directional field for the ODE. A solution curve through the point (x, y) can be traced by moving in the direction of the vector field (1, p(x, y)). Example 3.3-1 _____________________________________________________ (Kreyszig, pg. 11) Plot the directional field of y’ = xy Solution The MATLAB command quiver can be used to plot a directional field. We need to provide the locations of the points ([x,y]=meshgrid(-2:.2:2)) where the vector (1, p(x, y)) will be plotted. In the Matlab script, p(x, y) = fy = x.*y. Figure 3.3-3 shows the directional field of y’ = xy. Matlab script _________ % Plot directional field of y' = xy % quiver command clear % Clear variables clf % and figures [x,y]=meshgrid(-2:.2:2); % Define a grid n=length(x); fx=ones(n,n); fy=x.*y; quiver(x,y,fx,fy); % Plot vectors title('Directional field of dy/dx = xy') xlabel('x'); ylabel('y'); grid on zoom % Change resolution with mouse ______________ 64 687293743 Directional field of dy/dx = xy 2.5 2 1.5 1 y 0.5 0 -0.5 -1 -1.5 -2 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 x Figure 3.3-3. Slope of the tangent to the solution curve at (x, y). The PDE u u + p(x,y) =0 x y (3.3-1) is also the directional derivative of u in the direction of the vector (1, p(x, y)). Since the directional derivative is equal to zero, u(x,y) remains constant if from the point (x, y) we move in the direction of vector (1, p(x, y)). Therefore u(x,y) is constant on the solution curve of Eq. (3.34) dy = p(x,y) dx (3.3-4) These solution curves are called the characteristic curves of Eq. (3.3-1). Let the solution of Eq. (3.3-4) be (x,y) = C, where C is an arbitrary constant. Since u is constant on each such curve, the values of u depend only on C. 65 687293743 u(x,y) = f(C) = f((x,y)) This is the solution of Eq. (3.3-1). Example 3.3-2. Find the general solution of u u +x =0 x y (3.3-5) dy 1 = p(x,y) = x y = x2 + C dx 2 C=y 1 2 1 x u(x,y) = f(C) = f(y x2) is the general solution of Eq. (3.3-5). 2 2 One particular solution of Eq. (3.3-5) is u(x,y) = sin(y 1 2 x ). The validity of this solution can be 2 verified by substituting it back into the PDE. u 1 1 u = x cos(y x2); = cos(y x2) x 2 2 y u 1 1 u +x = x cos(y x2) + x cos(y x2) = 0 x 2 2 y u u +x =1 x y with the boundary condition u(y,0) = f(y). Example 3.3-3 Find a solution of (3.3-6) The general solution of an ODE is given by a family of curves u(x) lying in the two-dimensional (z, x) space. The general solution of a first order PDE is given by a family of surfaces u(x,y) lying in the three-dimensional (z, x, y) space. The solution surface can also be represented in parametric form as a function of the parameter s: u = u(x(s),y(s)), so that by applying the chain differentiation rule we obtain du u dx dx u dy u du u dy = + + = ds x ds ds y ds ds x y ds (3.3-7) Consider a first-order PDE of the form a u u +b =c x y (3.3-8) By comparing term by term Eq. (3.3-7) with Eq. (3.3-8), the following system of ODEs is obtained 66 687293743 dx dy du dx dy du = a, = b, = c ds = = = ds ds b c ds a (3.3-9) From Eq. (3.3-6), a = 1, b = x, c = 1, therefore dx dy du = = x 1 1 dx dy 1 1 = dy = xdx y = x2 + C C = y x2 x 2 2 1 dx du 1 = du = dx u = x + C = x + C = x + f(y x2) 1 2 1 Since at x = 0, u = f(y) One particular solution of Eq. (3.3-6) is u(x,y) = x + sin(y can be verified by substituting it back into the PDE. u 1 1 u = 1 x cos(y x2); = cos(y x2) x 2 2 y u u +x =1 x y 1 x cos(y 1 2 1 x ) + x cos(y x2) = 1 2 2 67 1 2 x ). The validity of this solution 2