# PARTIAL DIFFERENTIAL EQUATIONS (PDEs

)
Classification of PDEs: 1. According to the order Order First order Second order Thrid order

Example

∂u ∂u −α =0 ∂x ∂y

∂ 2u ∂u +u =0 2 ∂x ∂y
 ∂ 3u  ∂ 2 u ∂u  3 +  ∂x  ∂x∂y + ∂y = 0  
2

2. According to the linearity Example: a second order PDE:

a (.)
Linear Quasilinear Non-linear

∂ 2u ∂ 2u ∂ 2u + 2b(.) + c(.) 2 + d (.) = 0 ∂y 2 ∂x∂y ∂x
Condition (.)≡(x,y) (.)≡(x,y,u,δu/δx, δu/δy) (.)≡(x,y,u,δ2u/δx2, δu2/δy2,δ2u/δxδy)

Category

Linear second order PDEs in two independent variabels are further clasified into three forms: elliptic, parabolic, and hyperbolic.

a

∂ 2u ∂ 2u ∂ 2u ∂u ∂u + 2b +c 2 +d +e fu + g = 0 2 ∂x ∂x∂y ∂y ∂x ∂y
Category Elliptic Parabolic Hyperbolic Condition b2-ac<0 b2-ac=0 b2-ac>0

MATLAB solver for PDEs pdepe : Solve initial-boundary value problems for systems of parabolic and elliptic partial differential equations (PDEs) in one space variable and time Syntax: sol = pdepe(m,pdefun,icfun,bcfun,xmesh,tspan) sol = pdepe(m,pdefun,icfun,bcfun,xmesh,tspan,options) sol = pdepe(m,pdefun,icfun,bcfun,xmesh,tspan,options,p1,p2...) Arguments M A parameter corresponding to the symmetry of the problem. m can be slab = 0, cylindrical = 1, or spherical = 2. pdefun A function that defines the components of the PDE. icfun A function that defines the initial conditions. bcfun A function that defines the boundary conditions. xmesh A vector [x0, x1, ..., xn] specifying the points at which a numerical solution is requested for every value in tspan. The elements of xmesh must satisfy x0 < x1 < ... < xn. The length of xmesh must be >= 3. tspan A vector [t0, t1, ..., tf] specifying the points at which a solution is requested for every value in xmesh. The elements of tspan must satisfy t0 < t1 < ... < tf. The length of tspan must be >= 3. options Some options of the underlying ODE solver are available in pdepe: RelTol, AbsTol, NormControl, InitialStep, and MaxStep. In most cases, default values for these options provide satisfactory solutions. See odeset for details. p1,p2,...Optional parameters to be passed to pdefun, icfun, and bcfun. pdepe solves PDEs of the form:

∂u  ∂u ∂  m  ∂u    ∂u   c  x , t , u,  = x −m  x f  x , t , u,   + s  x, t , u,  ∂x  ∂t ∂x  ∂x    ∂x   
The PDEs hold for t0≤t≤tf and a≤x≤b. The interval [a,b] must be finite. For t=t0 and all x, the solution components satisfy initial conditions of the form:

pr.f.u.1. % -------------------------------------------------------------function [pl. t .DuDx) c = pi^2. the solution components satisfy a boundary condition of the form: ∂u   p ( x.u(end.1). function pdex1 m = 0.x.  = 0 ∂x   Example 1: Computation. % Extract the first solution component as u. u = sol(:.ql.:. f = DuDx. t . Where .u ( x.t) pl = ul. figure plot(x.qr] = pdex1bc(xl.t). pr = pi * exp(-t). t ) = 0 ∂u πe − t + (1. qr = 1. surf(x. t ) f  x. sol = pdepe(m.') xlabel('Distance x') ylabel('Time t') % A solution profile can also be illuminating. Example 2.0) = sin(πx ) π2 and boundary conditions u (0.t. u ) + q ( x .u) title('Numerical solution computed with 20 mesh points.5). % A surface plot is often a good way to study a solution.ur.s] = pdex1pde(x. t 0 ) = u0 ( x ) For all t and either x=a or x=b. t ) = 0 ∂x It is convenient to use subfunctions to place all the functions required by pdepe in a single Mfile. ∂u ∂  ∂u  =   This equation holds on an interval t≥0 and 0≤x≤1 ∂t ∂x  ∂x  The PDE satisfies the initial condition u ( x.:)) title('Solution at t = 2') xlabel('Distance x') ylabel('u(x.xr.t.@pdex1ic.2)') % -------------------------------------------------------------function [c.2.20).@pdex1pde. % -------------------------------------------------------------function u0 = pdex1ic(x) u0 = sin(pi*x). This example illustrates the solution of a system of PDEs. t = linspace(0. x = linspace(0. ql = 0.ul. s = 0.@pdex1bc. and plotting of the solution of a single PDE. u.

5 1 1.ur.:. pr = [ur(1)-1.t. ql = [1. % -------------------------------------------------------------------------function [pl. The PDE satisfies the initial conditions and boundary conditions In the form expected by pdepe.024. ylabel('Time t'). surf(x. figure. title('u1(x.99 0.t.xr.DuDx) c = [1.u(2). 0.@pdex4bc.t)').2).005 0. ylabel('Time t'). xlabel('Distance x').s] = pdex4pde(x.1 0.t.05 0.t)'). u1 = sol(:.@pdex4ic.05 0.:.* DuDx. t = [0 0.95 0. surf(x.u. u2 = sol(:. % -------------------------------------------------------------------------function u0 = pdex4ic(x) u0 = [1. y = u(1) .2 0.005 0.17] . 1].t) pl = [0. 0]. 1].1).1 0. xlabel('Distance x'). the left boundary condition is and the right boundary condition is The coding in MATLAB: function pdex4 m = 0. title('u2(x. ul(2)].ql. sol = pdepe(m.t).5 2].7 0. 0]. s = [-F. 0]. % -------------------------------------------------------------------------function [c.This equation holds on an interval 0≤x≤1 for times t≥0.pr.5 0. F].9 0. x = [0 0.01 0. the equations are In the form expected by pdepe.u2).u1).995 1].ul. figure.47*y).x. F = exp(5.@pdex4pde.73*y)-exp(-11.qr] = pdex4bc(xl.01 0. . f = [0.f. qr = [0.