# MATH 462, Spring 2012: Partial Differential Equations for Scientists and Engineers

 Solution of the Poisson equation uxx + uyy = 1 with boundary condition u = 0 on a domain which has the shape of Maryland (triangles show the mesh which was used for computation with the finite element method)

## News

• Assignment 3, due Wednesday, May 9.
Solution of Assignment 3
• Solving the heat equation, wave equation, Poisson equation using separation of variables and eigenfunctions
• Exam 1 was on Wednesday, March 14
• Notes about the heat equation
• How to plot the solutions of the heat equation on [0,1] for Example 1, Example 2: plotheat1.m, plotheat2.m
• Additional literature: This class introduces the basic ideas of Partial Differential Equations where we skip some details and proofs. Here are some graduate level books with more mathematical theory and complete proofs:
• Larsson, Thomée: Partial Differential Equations with Numerical Methods, Springer 2008 (also covers methods for numerical approximation of the solutions)
• Renardy, Rogers: An Introduction to Partial Differential Equations, Springer 2010
• Assignment 2: Due March 5, was handed out on Feb. 24.
Solution of Assignment 2
• Download heat_pwlin.m. This computes the solution of the heat equation on R if the initial function u0(x) is piecewise linear (and constant for x≤z1, x≥zN).
Example: u0(-1)=0,   u0(0)=1,   u0(1)=0. To find the solution for t=0,.02,...,1:
heat_pwlin([-1 0 1],[0 1 0],0:.02:1);
• Feb. 15: We looked for the solution of Ut=Uxx with initial condition U(x,0)=0 for x<0, U(x,0)=1 for x>0. Let g(x):=U(x,1) denote the solution at time t=1. Because of dilation invariance we have
U(x,t) = g(t-1/2x)
We found that
g(x) = ½·π-1/2·0xexp(-p2/4)dp + ½ = ½·erf(x/2) + ½
The "error function" erf(x) is defined as π-1/2·0xexp(-p2)dp, this function is available in Matlab and many other programming languages. In Matlab we can plot the solution U(x,t) for x∈[-5,5], t∈[0,2] as follows:
[X,T]=ndgrid(-5:.1:5,0:.1:2); U = erf(T.^-.5.*X/2)/2 + 1/2; colorcurves(X,T,U);
• Assignment 1, (was posted on February 6), due February 15 at 9pm.
Solution of Assignment 1
• For traffic flow the function u(x,t) represents the density where the maximal density is 1. We then have that speed = 1-u and flux F(u) = u·(1-u). Then the PDE is ut + F(u)x = 0. Note that c(u)=1-2u will be negative for large densities, therefore characteristics have negative slope and density values will propagate to the left. Even if initially the density is a smooth function, from some time t* on there will be a discontinuity in the density ("shock").
Here is a practical demonstration (in real life there are small random perturbations which can create a traffic jam out of nowhere if the initial density is high enough).
• Download the m-files colorcurves.m and quasilin.m. Put these files in the same directory as your other m-files.
How to use quasilin: Consider the initial value problem from class
ut - x·ux = u,     u(x,0) = exp(-x2).
Here c(x,t,u)=-x, f(x,t,u)=u, u0(x)=exp(-x2). We use for x0 the values -3,-2.9,...,2.9,3. We want to find the solution u(x,t) for 0≤t≤1 so we use t-values 0,.1,...,.9,1:
c = @(x,t,u) -x;   f = @(x,t,u) u;   u0 = @(x) exp(-x^2);
[X,v] = quasilin(c,f,u0,-3:.1:3,0:.1:1);
This generates a graph of the characteristics, and a graph of the solution which you can rotate with the mouse.
• "Solving 1st order PDEs with the method of characteristics" was updated (Feb. 1), now contains quasilinear PDEs and using Matlab.
• If you have not used Matlab before or would like to review the basics:
Read the Matlab Primer (PDF file) and (important!) try out the commands on a computer.