math for cslecture 121 partial differential equations boundary value problems
Post on 20-Dec-2015
240 views
TRANSCRIPT
Math for CS Lecture 12 1
Lecture 12
Partial Differential Equations
Boundary Value Problems
Math for CS Lecture 12 2
Contents
1. Partial Differential Equations
2. Boundary Value Problems
3. Differential Operators
4. Cylindrical and Spherical coordinate systems
5. Examples of the Problems
6. Solution of the heat equation
7. Solution of the string equation
Math for CS Lecture 12 3
Partial Derivatives
Consider a function of two or more variables e.g. f(x,y). We can talk about derivatives of
such a function with respect to each of its variables:
The higher order partial derivatives are defined recursively and include the mixed x,y
derivatives:
(1)
2
),(),(lim
),(0
yxfyxf
x
yxff x
2
),(),(lim
),(0
yxfyxf
y
yxff y
2
),(),(lim
0
yxfyxf
x
f
y
ff xxyxxy
Math for CS Lecture 12 4
Partial Differential Equations
Partial differential equation (PDE) is an equation containing an unknown function of two or
more variables and its partial derivatives.
Invention of PDE’s by Newton and Leibniz in 17th century mark the beginning of modern
science. PDE’s arise in the physical problems, both in classical physics and quantum
mechanics.
Orbits of the planets or spaceships, flow of the liquid around a submarine or air around an
airplane, electrical currents in the circuit or processor, and actually majority of the physics
and engineering inspired problems are described by partial differential equations.
Math for CS Lecture 12 5
Boundary Value Problem Consider the shape of the soap film stretched on approximately horizontal frame. Let
z=h(x,y) be the description of the shape (height) of this film. The tension force, acting on the
unit piece of the surface is proportional to
And equals zero for an equilibrium solution. Let h(x(t),y(t))=g(t) be the parametric
description of the frame. Thus, the following differential equation defines the shape of the
soap film:
This is the Laplace equation with Dirichlet boundary conditions.
2
2
2
2
y
f
x
f
)()(),(
02
2
2
2
tgtytxf
y
f
x
f
Inside the region
Along the Boundary
Math for CS Lecture 12 6
Differential OperatorsIn the differential equations, there are several derivatives that occur very often. For example
the vector of first derivatives or gradient of the function:
To clarify the notation of PDE’s and facilitate the calculations, the notation of differential
operators was invented.
Thus, nabla stands for gradient:
The sum of second derivatives of f(x,y,z), formally obtained as the scalar product of two
gradient operators is called a Laplacian:
z
f
y
f
x
ff ,,
(3)
zyx
,,
2
2
2
2
2
22 ,,,,,
zyxzyxzyx
(2)
Math for CS Lecture 12 7
Differential Operators 2The divergence of a vector function (f1(x,y,z), f2(x,y,z), f3(x,y,z)) is the sum of its first
derivatives, or a scalar product of the function with nabla:
The rotor of a vector function (f1(x,y,z), f2(x,y,z), f3(x,y,z)) is the vector product of the
function with nabla:
Several identities can be derived for the operators of gradient, divergence, rotor and
Laplacian.
z
f
y
f
x
fff
321,div
y
f
x
f
z
f
x
f
z
f
y
f
xfxfxf
zyx
kji
ff 121323
321
,,
)()()(
rot
(4)
(5)
Math for CS Lecture 12 8
Other Coordinate Systems We defined the differential operators in Euclidian
coordinates. However, it is sometimes more convenient
to use other systems, like spherical coordinates (r,φ,θ)
for spherically symmetric problems or cylindrical
(ρ,φ,z) for cylindrically symmetrical problems.
Using the identities:
...
...
2
2
x
f
x
f
x
r
r
f
x
f
x
f
x
f
x
f
x
r
r
f
x
ff
xxxx
x
Cylindrical coordinates
Math for CS Lecture 12 9
Other Coordinate SystemsWe can obtain in cylindrical coordinates
And in spherical:
z
ff
fff
fff
z
y
x
cos1
sin
sin1
cos
(2)
Spherical coordinates
f
rr
ff
r
f
r
f
r
ff
r
f
r
f
r
ff
z
y
x
sincos
sin
cossincossinsin
sin
sincoscossincos
Math for CS Lecture 12 10
Laplacian in Cylindrical and Spherical systemsWe can obtain in cylindrical coordinates
And in spherical:
2
2
2
2
22
2 11
z
fffff
2
2
2222
2 sin
1sin
sin
11
f
r
f
rr
fr
rrf
(6)
(7)
Math for CS Lecture 12 11
1. The heat equation, describing the temperature in solid u(x,y,z,t) as a function of
position (x,y,z) and time t:
This equation is derived as follows:
Consider a small square of size δ, shown on
the figure. Its heat capacitance is δ2·q, where
q is the heat capacitance per unit area. The
heat flow inside this square is the difference
of the flows through its four walls. The heat
flow through each wall is:
Example: The Heat Equation
2/0
xx
u
y
xx
uW
2/0
xx
u
2/0
yy
u
Math for CS Lecture 12 12
Here δ is the size of the square, µ is the heat conductivity
of the body and is the temperature
gradient. The change of the temperature
of the body is the total thermal flow
divided by its heat capacitance:
the last expression is actually the definition of the second derivative, therefore:
The Heat Equation
2/1
0
xx
uF
q
yu
yu
q
xu
xu
q
FFFF
t
u yyxx
2
2/2/
2
2/2/
24321 0000
2/2
0
xx
uF
2/
3
0
yy
uF
2/
4
0
yy
uF
uqt
u
y
u
x
u
qt
u
2
2
2
2
(9)
t
u
Math for CS Lecture 12 13
Examples of Physical Equations
2. The vibrating string equation, describing the deviation y(x,t) of the taut string from its
equilibrium y=0 position:
The derivation of this equation is somewhat similar to the heat equation: we consider a small
piece of the string; the force acting on this piece is ; it causes the acceleration of
the piece which is .
3. The Schrödinger equation. This equation defines the wave function of the particle in the
static field, and used, for example to calculate the electron orbits of the atoms.
22
2)(
mVE
2
22
2
2
x
ya
t
y
2
2
x
ykF
2
2
t
y
(11)
(10)
Math for CS Lecture 12 14
Solution of the Heat EquationConsider again the Heat Equation:
Let u=XT, where X(x) and T(t); then
In the last equation the left part is function of t, while the right part is the function of x.
Therefore, this equation can only be valid if both parts are constant, say –λ2. Then:
We have chosen a negative constant in order to obtain a bounded solution.
2
2
x
uc
t
u
X
X
T
T
c
TXcTX
1
tceT
TcT2
2
(12)
Math for CS Lecture 12 15
Solution of the Heat Equation 2
Thus, the bounded solution of (12) is a linear combination of the functions from the
parametric family
the solution ax+b corresponds to λ=0.
The specific solution of equation (12) with initial conditions f(0,x) and f(t,x1) f(t,x2) is found
via decomposition of f(0,x) in the basis (13), satisfying f(t,x1) f(t,x2).
xbxaX
XX
sincos
2
baxxbxae tc ;)sincos(2
(13)
Math for CS Lecture 12 16
Solution of the Heat Equation 3Boundary and initial conditions restrict the family of these functions:
The limitation of the domain to [-a,a] restricts the functions from a parametric family to a
countable set of 2a periodic functions:
The symmetry (odd or even) of the initial conditions further restricts the basis to sin(..) or
cos(..).
Similarly, the Dirichlet (constant value) or Neuman (zero derivative) boundary conditions
restrict the basis to the functions, satisfying the conditions.
)sincos(
2
xa
xnbx
a
xnae
ta
nc
Math for CS Lecture 12 17
Example 1Solve
Given
Solution
The solution consists of functions:
The condition u(0,t)=u(3,t)=0 is fulfilled by
xxxxu
tutu
10sin28sin34sin5)0,(
0),3(),0(
0,30,2 2
2
txx
u
t
u
baxxbxae t ;)sincos(22
(14)
(15)
3sin
2
32 xn
ebt
n
n
(16)
Math for CS Lecture 12 18
Example 1
We need only n=12, 24 and 30 in order to fit f(x,0). The solution is
3sin
2
32 xn
ebt
n
n
xexexetxf ttt 10sin28sin34sin5),(222 20012832 (17)
Math for CS Lecture 12 19
Solution of the String EquationThe vibrating string equation
Can be solved in the way similar to solution of the heat equation. Substituting
into (14), we obtain
baxtcbtcaxbxa ;sincossincos 2211
(18)2
22
2
2
x
yc
t
y
XTy
Math for CS Lecture 12 20
Example 2 (1/3)The taut string equation is fixed at points x=-1 and x=1; f(-1,t)=f(1,t)=0; Its equation of
motion is
Initially it is pulled at the middle, so that
Find out the motion of the string.
Solution:
The solution of (19) is comprised of the functions, obtaining zero values at x=-1 and x=1:
},0{,
sincossin
2
)12(
2
)12(
2
)12(cos
1
Nmn
tmbtmaxma
tn
btn
axn
mmn
nn
(19)2
2
2
2
x
yc
t
y
10,1
01,1)0,(
xx
xxxy
(20)
Math for CS Lecture 12 21
Example 2 (2/3)Solution (continued):
Moreover, since the initial condition
is symmetric, only the cos(…x) remains in the solution.
The coefficients bn in (20) are zeros, since
Therefore, the solution has the form
(21)
10,1
01,1)0,(
xx
xxxy
0)0,(
t
xy
tnxn
atxyn
n cos
2
)12(cos),(
0
Math for CS Lecture 12 22
Example 2 (3/3)Where
dx
n
dxxn
an
1
0
2
1
0
212
cos2
)1(2
12cos2