December 2:

Partial Differential Equations (Last Unit!)

Chapters 29, 30 and 32

 

Homework:

 

Chapter 29

29.16    

 

Chapter 30

     30.13    

 

Chapter 32

     32.1, 32.2, 32.3, 32.5

 

Set up analytical solution and write MATLAB code for each problem. This Homework is due on December 15, 2003

 

 

Partial Differential Equations

Eqn involving partial derivatives of an unknown function involving two or more independent variables is called a partial differential equation.

 

order of a PDE is the highest order partial derivative in the eqn.

 

linear second order systems in the following general form:

 

 

The world according to PDEs

 

 

B2-4AC

 

Category

 

Example

 

< 0

Elliptic

Laplace's eqn (steady state, 2 spatial dimensions)

= 0

Parabolic

Heat conduction

> 0

Hyperbolic

Wave eqn

 

 

Numerical Models of Steady State behavior:

 

Laplace's Equation

 

Poisson's Equation

 

Solution Methods:

Finite Difference representations based on treating the space as a grid of discrete points.

 

The finite difference equations are substituted for the partial derivatives.

 

using central finite differences:

with errors O() and O().  Subsituting,

 

 

Now let's assume that .  Then

 

 

 

 

 

O

 
 
O

 

 

O

 

 

O

 

O

 

O

 

 

O

 

O

 

O

 

 

 

 

Solution Methodologies:

 

Solving the linear system directly: Works well for small, artificial systems, but not large systems.  A 10 by 10 grid has 100 equations!

 

Gauss Siedel iteration: Start with initial guess and iterate until convergence which is theoretically guaranteed because of the structure of the matrix (above). Continue until percent relative error is below a prescribed threshold.

 

 

Boundary Conditions:

 

1.       Dirichlet boundary conditions: boundary values are fixed.

2.       Neumann boundary conditions: specify a derivative, rather than a constant. Natural boundary conditions have derivatives of zero.

3.       Robbins: derivative is a function of position or time.

 

 

Irregular boundaries: Modify the denominators of the finite difference equations based on distance to edge or next node.

 

function [x,y,U] = elliptic(nx,ny,dx,dy,bc,f)

%ELLIPTIC solution of a two-dimensional elliptic partial

%   differential equation

%

%   [X,Y,U]=ELLIPTIC(NX,NY,DX,DY,BC) solves the Laplace

%   equation for a rectangular object where

%      X = vector of x values

%      Y = vector of y values

%      U = matrix of dependent variable [U(X,Y)]

%      NX = number of divisions in x-direction

%      NY = number of divisions in y-direction

%      DX = x-increment

%      DY = y-increment

%      BC is a matrix of 4x2 or 4x3 containing the types

%      and values of boundary conditions. The order of

%      appearing boundary conditions are lower x, upper x,

%      lower y, and upper y in rows 1 to 4 of the matrix

%      BC, respectively. The first column of BC determines

%      the type of condition:

%         1 for Dirichlet condition, followed by the set

%         value of U in the second column.

%         2 for Neumann condition, followed by the set value

%         of U' in the second column.

%         3 for Robbins condition, followed by the constant

%         and the coefficient of U in the second and third

%         columns, respectively.

%

%   [X,Y,U]=ELLIPTIC(NX,NY,DX,DY,BC,F) solves the Poisson

%   equation for a rectangular object where F is the constant

%   at the right-hand side of the elliptic partial differential

%   equation.

%

%   See also ADAPTMESH, ASSEMPDE, PDENONLIN, POISOLV  

 

Example Problem 29.3

Solve for the temperature distribution on the plate in Figure 29.4, but using 49 interior nodes.

 

BC=[1 0; 1 100; 1 75; 1 50];

[X,Y,U]=elliptic(8,8,5,5,BC);

pcolor(U); colormap(hot);

U  

 

U =

  Columns 1 through 7

   37.5000         0         0         0         0         0         0

   75.0000   38.8060   25.2787   19.6378   17.3503   17.1579   19.4882

   75.0000   54.9452   42.6710   35.9222   32.6053   31.7933   33.6184

   75.0000   63.3039   54.5379   48.7749   45.3554   43.7914   43.9737

   75.0000   68.7323   63.4020   59.2839   56.2500   54.0434   52.4068

   75.0000   73.2233   71.0539   68.7086   66.3174   63.7251   60.4896

   75.0000   78.1071   78.8816   78.1792   76.5859   74.0502   69.8290

   75.0000   85.3234   88.1864   88.5406   87.7968   86.0607   82.3959

   87.5000  100.0000  100.0000  100.0000  100.0000  100.0000  100.0000

  Columns 8 through 9

         0   25.0000

   27.1766   50.0000

   39.2183   50.0000

   46.0782   50.0000

   51.1207   50.0000

   55.9976   50.0000

   62.3802   50.0000

   73.6940   50.0000

  100.0000   75.0000

  

 

Example Problem 29.4

Solve for the temperature distribution on the plate in Figure 29.4, but for the case where the upper edge is insulated.

 

Upper edge is insulated == natural boundary condition == the derivative is zero.

 

BC=[1 0; 2 0; 1 75; 1 50];

[X,Y,U]=elliptic(8,8,5,5,BC);

pcolor(U); colormap(hot)

U

 

U =

  Columns 1 through 7

   37.5000         0         0         0         0         0         0

   75.0000   38.0801   23.9351   17.8730   15.4207   15.3498   18.0826

   75.0000   53.3853   39.7874   32.1361   28.4600   27.8958   30.5743

   75.0000   60.6737   49.6931   42.4240   38.3875   37.1990   38.7764

   75.0000   64.6164   55.8873   49.4794   45.4668   43.7365   44.1431

   75.0000   66.9047   59.7603   54.1395   50.2638   48.1372   47.6213

   75.0000   68.2420   62.1096   57.0546   53.3118   50.9270   49.7856

   75.0000   68.9536   63.3815   58.6575   55.0020   52.4732   50.9753

   72.0954   69.1908   63.8055   59.1917   55.5653   52.9886   51.3718

  Columns 8 through 9

         0   25.0000

   26.4063   50.0000

   37.5424   50.0000

   43.1892   50.0000

   46.4380   50.0000

   48.4196   50.0000

   49.6189   50.0000

   50.2705   50.0000

   50.4876   50.2438