Download Partial Derivatives

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Hyperthermia wikipedia , lookup

Thermal conduction wikipedia , lookup

Heat equation wikipedia , lookup

Transcript
Lecture 12
Partial Differential Equations
Boundary Value Problems
Math for CS
Lecture 12
1
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
2
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:
f ( x, y )
f ( x   , y)  f ( x   , y)
fx 
 lim
 0
x
2
f ( x , y )
f ( x, y   )  f ( x, y   )
fy 
 lim
 0
y
2
(1)
The higher order partial derivatives are defined recursively and include the mixed x,y
derivatives:
f x f y
f x ( x, y   )  f x ( x, y   )
f xy 

 lim
y
x  0
2
Math for CS
Lecture 12
3
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
4
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
2 f 2 f

x 2 y 2
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:
2 f 2 f

0
x 2 y 2
f  x( t ), y( t )  g( t )
Inside the region
Along the Boundary
This is the Laplace equation with Dirichlet boundary conditions.
Math for CS
Lecture 12
5
Differential Operators
In the differential equations, there are several derivatives that occur very often. For example
the vector of first derivatives or gradient of the function:
 f f f 
f   , , 
 x y z 
(2)
To clarify the notation of PDE’s and facilitate the calculations, the notation of differential
operators was invented.
Thus, nabla stands for gradient:
    
   , , 
 x y z 
The sum of second derivatives of f(x,y,z), formally obtained as the scalar product of two
gradient operators is called a Laplacian:
           2
2
2 
      , , ,  , ,     2  2  2 
y
z 
  x y z   x y z    x
2
Math for CS
Lecture 12
(3)
6
Differential Operators 2
The 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:
div f   , f  
f 1 f 2 f 3


x y  z
(4)
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:
 i


rot f    f   
 x

 f1 ( x )
j

y
f2 ( x)
k 

    f 3 f 2 f 3 f 1 f 2  f 1 

 

,

,


z
 x z x  y 
  y z

f 3 ( x )
(5)
Several identities can be derived for the operators of gradient, divergence, rotor and
Laplacian.
Math for CS
Lecture 12
7
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:
fx 
 f f r f   f  



x r x  x  x
...
 2 f  f x f x r f x    f x 




2
x
x
 r  x    x   x
...
Math for CS
Lecture 12
Cylindrical coordinates
8
Other Coordinate Systems
We can obtain in cylindrical coordinates
f
1
fx 
cos  


f
1
fy 
sin  


f
fz 
z
Spherical coordinates
f
sin 

f
cos 

And in spherical:
f
f cos  cos  f sin 
cos  sin  

r

r
 r sin 
f
f cos  sin  f cos 
fy 
sin  sin  

r

r
 r sin 
f
sin  f
fz 
cos  
r
r 
fx 
Math for CS
Lecture 12
(2)
9
Laplacian in Cylindrical and Spherical systems
We can obtain in cylindrical coordinates
 2 f 1 f
1 2 f 2 f
f 

 2
 2
2
2

   
z
(6)
And in spherical:
1   2 f 
1
 
f 
1
2 f
f  2
r
 2
 sin
 2 2
2
r r  r  r sin  
  r sin  
(7)
Math for CS
Lecture 12
10
Example: The Heat Equation
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:
y
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:
W  
Math for CS
u
  
x
  
x0  / 2
 
u
x
u
y
u
x
x0   / 2
y0  / 2
x
Lecture 12
11
The Heat Equation
Here δ is the size of the square, µ is the heat conductivity
of the body and
u
t
F4    
u
y
y0   / 2
is the temperature
gradient. The change of the temperature
F1    
of the body is the total thermal flow
u
x x0  / 2
divided by its heat capacitance:
 u
u
   

 x x   / 2 x
u F1  F2  F3  F4
0



2
t
 q
 2 q


      u

 y
x0   / 2 


y0
u

y
 / 2
 2 q



y0   / 2 
F2    
F3    
u
y
u
x x0  / 2
y0  / 2
the last expression is actually the definition of the second derivative, therefore:
u    2 u  2 u 
  2  2 
t q  x
y 
u 
 u
t q
Math for CS
Lecture 12
(9)
12
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:
2
2 y
2  y
a
2
t
x 2
(10)
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
piece which is
 y
.
t 2
2
2 y
F k 2
x
; it causes the acceleration of the
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.
2 2
( E  V )  

2m
Math for CS
Lecture 12
(11)
13
Solution of the Heat Equation
Consider again the Heat Equation:
u
 2u
c 2
t
x
(12)
Let u=XT, where X(x) and T(t); then
XT   cX T
1 T  X 

cT
X
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:
T    c2T
T  e  c t
2
We have chosen a negative constant in order to obtain a bounded solution.
Math for CS
Lecture 12
14
Solution of the Heat Equation 2
X    2 X
X  a cos  x  b sin  x
Thus, the bounded solution of (12) is a linear combination of the functions from the
parametric family
e
 c2 t

(a cos x  b sin x ) ; ax  b
(13)
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).
Math for CS
Lecture 12
15
Solution of the Heat Equation 3
Boundary 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:
 n 

c
nx
nx 
  a  t

e
(
a
cos
x

b
sin
x
)




a
a




2
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.
Math for CS
Lecture 12
16
Example 1
Solve
Given
u
 2u
2 2,
t
x
0  x  3, t  0
(14)
u(0, t )  u( 3, t )  0
u( x ,0)  5 sin 4x  3 sin 8x  2 sin 10x
(15)
Solution
The solution consists of functions:
e
 2 2 t

(a cos x  b sin x ) ; ax  b
The condition u(0,t)=u(3,t)=0 is fulfilled by
 n 

nx 
  2 3  t

b
e
sin
 n

3




2
Math for CS
Lecture 12
(16)
17
Example 1
 n 

nx 
  2 3  t

b
e
sin
 n

3




2
We need only n=12, 24 and 30 in order to fit f(x,0). The solution is
f ( x, t )  5e 32 t sin 4x  3e 128 t sin 8x  2e 200 t sin 10x
2
Math for CS
2
Lecture 12
2
(17)
18
Solution of the String Equation
The vibrating string equation
2
2 y
2  y
c
2
t
x 2
(18)
Can be solved in the way similar to solution of the heat equation. Substituting
y  XT
into (14), we obtain
a1 cos x  b1 sin x  a2 cos ct  b2 sin ct 
Math for CS
Lecture 12
; ax  b
19
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
2 y
2 y
c 2
2
t
x
(19)
Initially it is pulled at the middle, so that
 x  1,  1  x  0
y ( x ,0 )  
1  x , 0  x  1
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:

( 2n  1)  ( 2n  1)
( 2n  1)  
cos
x

a
t

b
t 

n
n

2
2
2






a
sin
m

x

a
cos
m

t

b
sin
m

t
 1n

m
m
 n, m  {0, N }





Math for CS
Lecture 12
(20)
20
Example 2 (2/3)
Solution (continued):
Moreover, since the initial condition
 x  1,  1  x  0
y ( x ,0 )  
1  x , 0  x  1
(21)
is symmetric, only the cos(…x) remains in the solution.
The coefficients bn in (20) are zeros, since
y( x ,0)
0
t
Therefore, the solution has the form

y( x , t )   an cos
n 0
Math for CS
Lecture 12
( 2n  1)
x  cos nt
2
21
Example 2 (3/3)
Where
1
an 
2 cos
2
0
1
2 cos 2
0
Math for CS
2n  1 (1  x )dx
2n  1 dx
2
Lecture 12
22