上課資料(2)

Download Report

Transcript 上課資料(2)

附錄一 Methods of Solving the First Order Differential Equation
graphic method
numerical method
analytic method
direct integration
separable variable
method for linear equation
method for exact equation
homogeneous equation method
Bernoulli’s equation method
series solution
matrix solution
transform
method for Ax + By + c
Laplace transform
Fourier series
Fourier cosine series
Fourier sine series
Fourier transform
29
30
Simplest method for solving the 1st order DE:
Direct Integration
dy(x)/dx = f(x)
y  x    f ( x)dx
 F ( x)  c
where
dF ( x)
 f ( x)
dx
附錄二 Table of Integration
1/x
ln|x| + c
cos(x)
sin(x) + c
sin(x)
–cos(x) + c
tan(x)
–ln|cos(x)| + c
cot(x)
ln|sin(x)| + c
ax
ax/ln(a) + c
1
x2  a2
1 1 x
tan
c
a
a
x
sin 1  c
a
eax 
1
x


c
a 
a
1
a2  x2
x eax
x2
eax
eax  2 2 x 2 
x   2 c
a 
a a 
31
32
Others about Integration
x
(1) Integration 的定義: x f (t )dt
0
x
例:x cos(t ) dt  sin x  c
0
(2) 算完 integration 之後不要忘了加 constant c
(3) If
then

x
x0
f (t )dt  g  x   c
d g  x  f  x
dx
x
1 g  ax   c
f
(
at
)
dt

1
x0
a
c1 is also some constant
d g  ax   a f  ax 
dx
33
2-2 Separable Variables
2-2-1 方法的限制條件
1st order DE 的一般型態:
dy(x)/dx = f(x, y)
[Definition 2.2.1] (text page 46)
If dy(x)/dx = f(x, y) and f(x, y) can be separate as
f(x, y) = g(x)h(y)
i.e., dy(x)/dx = g(x)h(y)
then the 1st order DE is separable (or have separable variable).
34
條件: dy(x)/dx = g(x)h(y)
dy
 cos( x)e x2 y
dx
dy
 x y
dx
35
2-2-2 解法
If
dy
 g ( x ) h( y ) ,
dx
dy
Step 1 h( y )  g ( x)dx
then
分離變數
where
p( y)dy  g ( x)dx
Step 2
 p( y)dy   g ( x)dx
p(y) = 1/h(y)
個別積分
P( y)  c1  G( x)  c2
dP( y )
 p( y )
where
dy
dG ( x)
 g ( x)
dx
P( y )  G ( x)  c
Extra Step: (a) Initial conditions
(b) Check the singular solution (i.e., the constant solution)
36
Extra Step (b) Check the singular solution (常數解):
Suppose that y is a constant r
dy
 g ( x ) h( y )
dx
0  g ( x ) h( r )
h(r )  0
solution for r
See whether the solution is a special case of the general solution.
37
2-2-3 Examples
Example 1 (text page 47)
Extra Step (b)
(1 + x) dy – y dx = 0
Step 1
dy
y

dx 1  x
dy
dx

y 1 x
check the singular
solution
set y = r ,
Step 2 ln y  ln 1  x  c1
0 = r/(1+x)
r = 0,
y  eln 1 x ec1
y  ec1 eln 1 x
y  ec1 1  x  ec1 (1  x)
y  c(1  x)
c  ec1
y=0
(a special case of the
general solution)
38
Example 練習小技巧
遮住解答和筆記,自行重新算一次
(任何和解題有關的提示皆遮住)
Exercise 練習小技巧
初學者,先針對有解答的題目作練習
累積一定的程度和經驗後,再多練習沒有解答的題目
將題目依類型分類,多綀習解題正確率較低的題型
動筆自己算,就對了
39
Example 2 (with initial condition and implicit solution, text page 48)
dy
x,

dx
y
Step 1
y(4) = –3
Extra Step (b)
check the singular solution
ydy   xdx
2
2
Step 2 y / 2   x / 2  c
Extra Step (a)
4.5  8  c, c  12.5
x2  y 2  25 (implicit solution)
y  25  x 2
invalid
y   25  x 2
valid
(explicit solution)
Example 3 (with singular solution, text page 48)
dy
Extra Step (b)
 y2  4
dx
check the singular solution
dy
 y2  4
dx
set y = r ,
dy
 dx
2
y 4
Step 1
1 dy 1 dy

 dx
4 y2 4 y2
0 = r2 – 4
Step 2
1
1
ln y  2  ln y  2  x  c1
4
4
ln
r = 2,
y = 2
y2
 4 x  4c1
y2
y2
 e4 x4c1  ce4 x
y2
c   e 4c1
1  ce4 x
y2
1  ce4 x
or
y = 2
40
41
Example 4 (text page 49)
自修
注意如何計算
sin(2 x)
 cos x dx ,
y
ye
 dy
42
Example in the top of page 50
dy
 xy1/2,
y(0) = 0
dx
Extra Step (b)
Step 1
Check the singular solution
Step 2
Extra Step (a)
1 x4
y

Solution:
or y  0
16
43
補充:其實, 這一題還有更多的解
dy
 xy1/2 ,
dx
y(0) = 0
solutions: (1) y  1 x 4
16
(2) y  0
 1  x 2  b 2 2
for x  b
16

(3) y  0
for b  x  a
1 2
2 2
for x  a
 16  x  a 
b0a
44
2-2-4 IVP 是否有唯一解?
dy
 f  x, y 
dx
y  x0   y0
這個問題有唯一解的條件:(Theorem 1.2.1, text page 16)
如果 f(x, y),

f  x, y  在 x = x0, y = y0 的地方為 continuous
y
則必定存在一個 h,使得 IVP 在 x0−h < x < x0 +h 的區間當中
有唯一解
45
2-2-5 Solutions Defined by Integral
(1)
d x
g  t  dt  g  x 

x
dx 0
(2) If dy/dx = g(x) and y(x0) = y0, then
y  x   y0   g  t  dt
x
x0
積分 (integral, antiderivative) 難以計算的 function,
被稱作是 nonelementary
如
e
 x2
, sin x 2
此時,solution 就可以寫成 y  x   y0  x g  t  dt
x
0
的型態
46
Example 5 (text page 50)
dy
 x2
e
dx
y  3  5
Solution y  x   5  3 e dt
x
t 2
或者可以表示成 complementary error function
y  x   5    erfc  3  erfc  x  
2
47
 error function (useful in probability)
2 x t 2
erf  x  
 e dt

0
 complementary error function
erfc  x  
2


x
e dt  1  erf  x 
t 2
See text page 59 in Section 2.3
2-2-6 本節要注意的地方
(1) 複習並背熟幾個重要公式的積分
(2) 別忘了加 c
並且熟悉什麼情況下 c 可以合併和簡化
(3) 若時間允許,可以算一算 singular solution
(4) 多練習,加快運算速度
48
附錄三 微分方程查詢
http://integrals.wolfram.com/index.jsp
輸入數學式,就可以查到積分的結果
範例:
(a) 先到integrals.wolfram.com/index.jsp 這個網站
(b) 在右方的空格中輸入數學式,例如
數學式
49
(c) 接著按 “Compute Online with Mathematica”
就可以算出積分的結果
按
結果
50
(d) 有時,對於一些較複雜的數學式,下方還有連結,點進去就可 51
以看到相關的解說
連結
其他有用的網站
http://mathworld.wolfram.com/
對微分方程的定理和名詞作介紹的百科網站
http://www.sosmath.com/tables/tables.html
眾多數學式的 mathematical table (不限於微分方程)
http://www.seminaire-sherbrooke.qc.ca/math/Pierre/Tables.pdf
眾多數學式的 mathematical table,包括 convolution, Fourier
transform, Laplace transform, Z transform
軟體當中, Maple, Mathematica, Matlab 皆有微積分結果查詢有
功能
52
53
2-3 Linear Equations
“friendly” form of DEs
2-3-1 方法的適用條件
[Definition 2.3.1] The first-order DE is a linear equation if it has
the following form:
a1  x 
dy
 a0  x  y  g  x 
dx
g(x) = 0: homogeneous
g(x)  0: nonhomogeneous
54
dy
 P  x y  f  x
Standard form:
dx
a1  x 
dy
 a0  x  y  g  x 
dx
g  x
dy a0  x 

y
dx a1  x 
a1  x 
許多自然界的現象,皆可以表示成 linear first order DE
55
2-3-2 解法的推導
dy
 P  x y  f  x
dx
子問題 1
子問題 2
dyc
dy p ( x)
 P  x  yc  0
 P  x  y p ( x)  f  x 
dx
dx
Find the general solution yc(x)
Find any solution yp(x)
(homogeneous solution)
(particular solution)
Solution of the DE
y  x   yc  x   y p ( x)
 yc + yp is a solution of the linear first order DE, since
d ( yc  y p )
56
 P  x  ( yc  y p )
dx

 dy
  dy
  c  P  x  yc    p  P  x  y p 
 dx
  dx

 0  f  x  f  x
 Any solution of the linear first order DE should have the form yc + yp .
The proof is as follows. If y is a solution of the DE, then
 dy

dy
 P  x y   p  P  x yp   f  x  f  x  0
dx
 dx

d ( y  yp )
 P  x( y  yp )  0
dx
dyc
 P  x  yc  0
Thus, y − yp should be the solution of
dx
y should have the form of y = yc + yp
57
Solving the homogeneous solution yc(x) (子問題一)
dyc
 P  x  yc  0
dx
separable variable
dyc
  P  x  dx
yc
ln yc    P  x  dx  c1
 P ( x ) dx
yc  ce 
Set
 P ( x ) dx
y1  e 
, then yc  cy1
Solving the particular solution yp(x) (子問題二)
dy p ( x)
dx
 P  x  y p ( x)  f  x 
Set yp(x) = u(x) y1(x) (猜測 particular solution 和 homogeneous
solution 有類似的關係)
dy1 ( x)
du ( x)
u ( x)
 y1 ( x)
 P  x  u ( x) y1 ( x)  f  x 
dx
dx
du ( x)
 dy ( x)

 u ( x)  1  P  x  y1 ( x )   f  x 
dx
 dx

equal to zero
du ( x)
y1 ( x)
 f  x
dx
y1 ( x)
f  x
du ( x) 
dx
y1 ( x)
f  x
u ( x)  
dx
y1 ( x)
f  x
y p ( x)  y1 ( x) 
dx
y1 ( x)
58
59
 P ( x ) dx
 P ( x ) dx f ( x)]dx
yp  x  e 
[
e

yc  ce 
 P ( x ) dx
solution of the linear 1st order DE:
 P ( x ) dx
 P ( x ) dx
 P ( x ) dx f ( x)]dx
y  x  c e 
e 
[
e

where c is any constant
e
P ( x ) dx
: integrating factor
60
2-3-3 解法
(Step 1) Obtain the standard form and find P(x)
P ( x ) dx

e
(Step 2) Calculate
(Step 3a) The standard form of the linear 1st order DE can be rewritten as:
d   P ( x ) dx   P ( x ) dx
e
y e
f  x


dx 

remember it
(Step 3b) Integrate both sides of the above equation
e
P ( x ) dx
ye 
y   e
 P ( x ) dx
P ( x ) dx
f  x  dx  c,
P ( x ) dx
  P ( x ) dx

f  x  dx  ce
e
or remember it, skip Step 3a
(Extra Step) (a) Initial value
(c) Check the Singular Point
61
dy
a1  x   a0  x  y  g  x 
dx
dy
 P  x y  f  x
dx
Singular points: the locations where a1(x) = 0
i.e., P(x)  
More generally, even if a1(x)  0 but P(x)   or f(x)  , then
the location is also treated as a singular point.
(a) Sometimes, the solution may not be defined on the interval
including the singular points. (such as Example 4)
(b) Sometimes the solution can be defined at the singular points,
such as Example 3
62
More generally, even if a1(x)  0 but P(x)   or f(x)  , then the
location is also treated as a singular point.
Exercise 33
dy
( x  1)  y  ln x
dx
63
2-3-4 例子
Example 2 (text page 56)
dy
 3y  6
dx
Step 1
P( x)  3
Step 2 e P ( x ) dx  e3 x
Extra Step (c)
check the singular point
為何在此時可以將
–3x+c 簡化成 –3x?
Step 3
d 3 x
e y   6e3 x
dx
Step 4 e3 x y  2e3 x  c
y  2  ce3 x
或著,跳過 Step 3,直接代公式
ye 
 P ( x ) dx
P ( x ) dx
  P ( x ) dx

f  x  dx  ce
e
64
Example 3 (text page 57)
dy
x  4 y  x 6e x
dx
Step 1 dy  4 y  x5e x , P  x    4
dx
x
x
Step 2
e
P ( x ) dx
 e 4ln x  x
Step 4
x4 y  ( x 1)e x  c
y  ( x5  x4 )e x  cx4
x 的範圍: (0, )
x=0
4
若只考慮 x > 0 的情形, e  P ( x ) dx  x 4
d 4
 x y   xe x
Step 3
dx
Extra Step (c)
check the singular point
思考: x < 0 的情形
Example 4 (text page 58)
dy
2
x

9

 dx  xy  0
dy
x
 2
y0
dx x  9
x
P  x  2
x 9
e

x
dx
x 2 9
e
1
ln x2 9
2
65
Extra Step (c)
check the singular point
 | x2  9 |
d
| x2  9 |  y  0
dx
| x2  9 |  y  c
y
c
| x2  9 |
defined for x  (–, –3), (–3, 3), or (3, )
not includes the points of x = –3, 3
Example 6 (text, page 59)
dy
 y  f  x
y  0  0
dx
P ( x ) dx

e
 ex
d x
(e y )  e x f  x 
dx
0x1
d x
(e y )  0
dx
e x y  e x  c1
e x y  c2
y  1  c1e  x
from initial condition
y  c2 e  x
要求 y(x) 在 x = 1 的地方
為 continuous
y  (e  1)e x
0  x 1
x 1
check the singular point
x>1
d x
(e y )  e x
dx
y  1  e x
1,
f  x  
0,
66
67
2-3-5 名詞和定義
(1) transient term, stable term
x
y

x

1

5
e
Example 5 (text page 58) 的解為
5e x : transient term 當 x 很大時會消失
x 1: stable term
10
8
6
4
y
2
x1
0
-2
0
2
4
6
8
10
x-axis
68
(2) piecewise continuous
A function g(x) is piecewise continuous in the region of [x1, x2] if
g'(x) exists for any x  [x1, x2].
In Example 6, f(x) is piecewise continuous in the region of [0, 1)
or (1, )
(3) Integral (積分) 有時又被稱作 antiderivative
(4) error function
erf  x  
2
x

0
t 2
e dt
complementary error function
erfc  x  
2


x
e dt  1  erf  x 
t 2
(5) sine integral function
x sin(t )
Si  x   
dt
0
t
Fresnel integral function
S  x    sin  t 2 / 2  dt
x
0
(6) dy  P  x  y  f  x 
dx
f(x) 常被稱作 input 或 deriving function
Solution y(x) 常被稱作 output 或 response
69
70
2-3-6 小技巧
When
dy
dx
is not easy to calculate:
dx
Try to calculate
dy
Example:
dy
1

dx x  y 2
dx
 x  y2
dy
(not linear, not separable)
(linear)
x   y 2  2 y  2  ce y (implicit solution)
2-3-7 本節要注意的地方
71
(1) 要先將 linear 1st order DE 變成 standard form
(2) 別忘了 singular point
注意:singular point 和 Section 2-2 提到的 singular solution 不同
(3) 記熟公式
d   P ( x ) dx   P ( x ) dx
e
y e
f  x


dx 

或
ye 
 P ( x ) dx
P ( x ) dx
  P ( x ) dx

f  x  dx  ce
e
(4) 計算時, e  P ( x ) dx 的常數項可以忽略
72
太多公式和算法,怎麼辦?
最上策: realize + remember it
上策:
realize it
中策:
remember it
下策:
read it without realization and remembrance
最下策: rest
z…..z..…z……
73
Chapter 3 Modeling with First-Order
Differential Equations
應用題
(1) Convert a question into a 1st order DE.
將問題翻譯成數學式
(2) Many of the DEs can be solved by
Separable variable method
or
Linear equation method
(with integration table remembrance)
74
3-1 Linear Models
Growth and Decay (Examples 1~3)
Change the Temperature (Example 4)
Mixtures (Example 5)
Series Circuit (Example 6)
可以用 Section 2-3 的方法來解
Example 1
(an example of growth and decay, text page 84)
Initial: A culture (培養皿) initially has P0 number of bacteria.
翻譯  A(0) = P0
The other initial condition: At t = 1 h, the number of bacteria is
measured to be 3P0/2.
翻譯  A(1) = 3P0/2
關鍵句: If the rate of growth is proportional to the number of
bacteria A(t) presented at time t,
dA
k is a constant
 kA
dt
Question: determine the time necessary for the number of bacteria to
triple
翻譯  find t such that A(t) = 3P0
翻譯 
這裡將課本的 P(t) 改成 A(t)
75
dA
 kA
dt
Step 1
A(0) = P0, A(1) = 3P0/2
可以用 什麼方法解?
Extra Step (b)
check singular solution
dA
 kdt
A
Step 2 ln A  kt  c1
A  ekt c1
A  cekt
c   e c1
Extra (1) P0  c 1
Step (a)
(2) 3P0 / 2  cek
c = P0
k = ln(3/2) = 0.4055
A  P0e0.4055t
針對這一題的問題
3P0  P0e 0.4055t
t  ln(3) / 0.4055  2.71h
76
77
課本用 linear (Section 2.3) 的方法來解 Example 1
思考:為什麼此時需要兩個 initial values 才可以算出唯一解?
Example 4 (an example of temperature change, text page 86)
Initial: When a cake is removed from an oven, its temperature is measured at
300 F.
翻譯  T(0) = 300
The other initial condition: Three minutes later its temperature is 200  F.
翻譯  T(3) = 200
question: Suppose that the room temperature is 70 F. How long will it take
for the cake to cool off to 75 F? (註:這裡將課本的問題做一些修改)
翻譯  find t such that T(t) = 75.
另外,根據題意,了解這是一個物體溫度和周圍環境的溫度交互作用的
問題,所以 T(t) 所對應的 DE 可以寫成
dT  k T  70 
dt
k is a constant
78
dT  k T  70 
dt
79
T(0) = 300
T(3) = 200
課本用 separable variable 的方法解
如何用 linear 的方法來解?
80
Example 5 (an example for mixture, text page 87)
Concentration:
2 lb/gal
300 gallons
3 gal/min
3 gal/min
A: the amount of salt in the tank
dA
 (input rate of salt)  (output rate of salt)
dt
3A
 3 2 
300
81
82
LR series circuit
From Kirchhoff’s second law
L
di
 Ri  E  t 
dt
83
RC series circuit
q
 Ri  E  t 
C
q
dq
 R  E t 
C
dt
q: 電荷
84
How about an LRC series circuit?
q
dq
d 2q
 R  L 2  E t 
C
dt
dt
85
Example 7 (text page 89) LR series circuit
 E(t): 12 volt,  inductance: 1/2 henry,
 resistance: 10 ohms,  initial current: 0
1 di
di
P(t )  20
 10i  12
 20i  24
2 dt
dt
6
i (t )   ce20t
5
i(0)  0
6
0 c
5
6 6
i(t )   e20t
5 5
6 20t
e i  e c
5
20t
P ( t ) dt

e
 e20t c1
這裡 + c1 可省略
d 20t
e i  24e20t
dt
86
Circuit problem for t is small and
For the LR circuit:
L
transient
For the RC circuit:
R
transient
R
stable
C
stable
t

87
3-2 Nonlinear Models
可以用 separable variable 或其他的方法來解
3-2-1 Logistic Equation
used for describing the growth of population
dP
a
 P(a  bP)  bP(  P)
dt
b
The solution of a logistic equation is called the logistic function.
Two stable conditions: P  0 and P 
a
.
b
88
Logistic curves for differential initial conditions
89
Solving the logistic equation
dP
 P(a  bP)
dt
dP
 dt
P(a  bP)
separable
variable
 1/ a b / a 


 dP  dt
 P a  bP 
1
1
ln P  ln a  bP  t  c
a
a
ln
d
b
dP ( a  bP )
dP  
dP  ln a  bP  c0
註: 
a  bP
a  bP
P
 at  ac
a  bP
P
 c1e at
a  bP
c1  eac
(with initial condition P(0) = P0)
P t  
ac1
bc1  e at
P t  
aP0
bP0  (a  bP0 )e at
logistic function
Example 1 (text page 97) There are 1000 students.
 Suppose a student carrying a flu virus returns to an isolate college
campus of 1000 students.
翻譯  x(0) = 1
 If it is assumed that the rate at which the virus spreads is proportional
not only to the number x of infected students but also to the number of
students not infected,
dx  t 
 kx 1000  x  k is a constant
翻譯 
dt
 determine the number of infected students after 6 days
翻譯  find x(6)
 if it is further observed that after 4 days x(4) = 50
90
91
整個問題翻譯成
dx  t 
 kx 1000  x 
dt
Initial: x(0) = 1, x(4) = 50
find x(6)
可以用separable variable 的方法
dx  t 
 kx 1000  x 
dt
dx  t 
 kdt
x 1000  x 
(c2e1000kt  1) x  c21000e1000kt
x  0  1
1
1  dx
dx 


  kdt
1000  x 1000  x 
dx
dx

 1000kdt
x x  1000
ln x  ln x  1000  1000kt  c1
x
 e1000 kt c1
x  1000
x
 c2 e1000 kt (c  ec1 )
2
x  1000
(c  c21 )
1000
x
1  ce 1000 kt
1000
1 c
c  999
x
1000
1  999e 1000 kt
50 
x  4  50
1000
1  999e 4000 k
1000k  0.9906
x
1000
1  999e 0.9906t
x  6  276
92
93
Logistic equation 的變形
dP
 P(a  bP)  h
(1)
dt
人口有遷移的情形
(2) dP  P(a  bP)  cP
dt
遷出的人口和人口量呈正比
(3)
(4)
dP
 P(a  bP)  ce kP
dt
dP
 P(a  b ln P)
dt
 bP(a / b  ln P)
人口越多,遷入的人口越少
Gompertz DE
a /b
e
飽合人口為
飽合人口
人口增加量,和 ln
P
呈正比
3-2-2 化學反應的速度
A+BC
• Use compounds A and B to for compound C
• x(t): the amount of C
• To form a unit of C requires s1 units of A and s2 units of B
• a: the original amount of A
• b: the original amount of B
• The rate of generating C is proportional to the product of the
amount of A and the amount of B
dx  t 
 k  a  s1 x  b  s2 x 
dt
See Example 2
94
95
3-3 Modeling with Systems of DEs
Some Systems are hard to model by one dependent variable
but can be modeled by the 1st order ordinary differential equation
dx  t 
 g1  t , x, y 
dt
dy  t 
 g 2  t , x, y 
dt
They should be solved by the Laplace Transform and other
methods
from Kirchhoff’s 1st law
i1 t   i2 t   i3 t 
from Kirchhoff’s 2nd law
di  t 
(1) E  t   i1R1  L1 2  i2 R2
dt
di3  t 
(2) E  t   i1R1  L2
dt
Three dependent variable
We can only simplify it into two
dependent variable
96
from Kirchhoff’s
1st
law
i1 t   i2 t   i3 t 
from Kirchhoff’s 2nd law
di1  t 
 i2  t  R
(1) E  t   L
dt
(2) q3  t   i2  t  R
C
1
d
i
t

i
t

R
i2  t 

1 
2  
C
dt
97
98
Chapter 3: 訓練大家將和 variation 有關的問題寫成 DE 的能力
……. the variation is proportional to………………
99
練習題
Section 2-2:
4, 7, 12, 13, 18, 21, 25, 28, 30, 36, 46, 48, 50, 54(a)
Section 2-3:
7, 9, 13, 15, 21, 29, 30, 33, 36, 40, 53, 55(a), 56(a)
Section 3-1: 4, 5, 10, 15, 20, 29, 32
Section 3-2: 2, 5, 14, 15
Section 3-3: 12, 13
Review 3:
3, 4, 11, 12