Você está na página 1de 56

By:

school.edhole.com
Chapter 8 Differential Equations
An equation that defines a relationship between an
unknown function and one or more of its derivatives
is referred to as a differential equation.
A first order differential equation:


Example:
8-2
) , ( y x f
dx
dy
=
5 . 0 5 . 2 obtain we , 1 and 2 ng Substituti
2
5
get we it, Solving
. 1 at 2 condition boundary with , 5
2
2
= = =
+ =
= = =
x y x y
c x y
x y x
dx
dy
school.edhole.com
Example:


A second-order differential equation:


Example:
8-3
) , , (
2
2
dx
dy
y x f
dx
y d
=
) ( x y c
dx
dy
=
' 2 ' ' y xy x y + + =
school.edhole.com
Taylor Series Expansion
Fundamental case, the first-order ordinary differential
equation:


Integrate both sides


The solution based on Taylor series expansion:
0 0
at subject to ) ( x x y y x f
dx
dy
= = =
} }
=
x
x
y
y
dx x f dy
0 0
) (
8-4
}
+ = =
x
x
dx x f y x g y
0
) ( ) ( or
0
) ( ) ( ' and ) ( where
... ) ( ' '
! 2
) (
) ( ' ) ( ) ( ) (
0 0 0 0
0
2
0
0 0
x f x g x g y
x g
x x
x g x x x g x g y
= =
+

+ + = =
school.edhole.com
Example : First-order Differential Equation
Given the following differential equation:


The higher-order derivatives:
1 at 1 such that 3
2
= = = x y x
dx
dy
8-5
4 n for 0
6
6
3
3
2
2
> =
=
=
n
n
dx
y d
dx
y d
x
dx
y d
school.edhole.com
The final solution:










8-6
1 where
) 1 ( ) 1 ( 3 ) 1 ( 3 1
) 6 (
! 3
) 1 (
) 6 (
! 2
) 1 (
) 3 )( 1 ( 1
! 3
) 1 (
! 2
) 1 (
) 1 ( 1 ) (
0
3 2
3
0
2
2
0
3
3 3
2
2 2
=
+ + + =

+ + =

+ + =
x
x x x
x
x
x
x x
dx
y d x
dx
y d x
dx
dy
x x g
school.edhole.com
8-7
x One Term Two Terms Three Terms Four Terms
1 1 1 1 1
1.1 1 1.3 1.33 1.331
1.2 1 1.6 0.72 1.728
1.3 1 1.9 2.17 2.197
1.4 1 2.2 2.68 2.744
1.5 1 2.5 3.25 3.375
1.6 1 2.8 3.88 4.096
1.7 1 3.1 4.57 4.913
1.8 1 3.4 5.32 5.832
1.9 1 3.7 6.13 6.859
2 1 4 7 8
Table: Taylor Series Solution
school.edhole.com
8-8
school.edhole.com
General Case
The general form of the first-order ordinary differential
equation:


The solution based on Taylor series expansion:
0 0
at subject to ) , ( x x y y y x f
dx
dy
= = =
... ) , ( ' '
! 2
) (
) , ( ' ) ( ) , ( ) (
0 0
0
0 0 0 0 0
+

+ + = = y x g
x x
y x g x x y x g x g y
8-9
school.edhole.com
Eulers Method
Only the term with the first derivative is used:


This method is sometimes referred to as the one-step
Eulers method, since it is performed one step at a time.
e
dx
dy
x x x g x g + + = ) ( ) ( ) (
0 0
8-10
school.edhole.com
Example: One-step Eulers Method
Consider the differential equation:


For x =1.1



Therefore, at x=1.1, y=1.44133 (true value).

1 at 1 such that 4
2
= = = x y x
dx
dy
8-11
} }
=
1 . 1
1
2
1
4 dx x dy
y
44133 . 0
3
4
1
1 . 1
1
3
= = x y
school.edhole.com
8-12
0.008373. is error The
1.43296 g(1.10)
value estimated the steps, five after 0.02, of size step a For
0.020833. to reduced is error The
4205 . 1 ] ) 05 . 1 ( 4 )[ 05 . 1 10 . 1 ( ) 05 . 1 ( ) 10 . 1 (
2 . 1 2 . 0 1 ] ) 1 ( 4 )[ 00 . 1 05 . 1 ( ) 1 ( ) 05 . 1 (
: ) 05 . 1 and 1 (at
twice equation s r' apply Eule and 0.05 of size step a Use
value). absolute (in 0.04133 error The
4 . 1 ] ) 1 ( 4 [ 1 . 0 1 ) 1 . 1 (
get we , 1 . 0 ) ( of size step a With
2
2
2
0
=
= + =
= + = + =
= =
=
= + =
= = A
g g
g g
x x
g
x x x
school.edhole.com
Errors with Euler`s Method
Local error: over one step size.
Global error: cumulative over the range of the solution.
The error c using Euler`s method can be approximated using the
second term of the Taylor series expansion as




If the range is divided into n increments, then the error at the end
of range for x would be nc.



]. , [ in maximum the is where
! 2
) (
0
2
2
2
2 2
0
x x
dx
y d
dx
y d x x
= c
8-13
school.edhole.com
Example: Analysis of Errors






8-14
0088 . 0 ) 02 . 0 )( 1 . 1 )( 4 ( 5
022 . 0 ) 05 . 0 )( 1 . 1 )( 4 ( 2
044 . 0 ) 1 . 0 )( 1 . 1 ( 4
: 1 . 1 at
error the on limits upper the 0.02. and 0.05, 0.1, of sizes step For
) ( 4 ) 8 (
! 2
) (
by bounded is error the Thus,
8
1 at 1 that such 4
2
02 . 0
2
05 . 0
2
1 . 0
2
0
2
0
2
2
2
= =
= =
= =
=
=

=
=
= = =
c
c
c
c
x
x x x x
x x
x
dx
y d
x y x
dx
dy
school.edhole.com
8-15
Table: Local and Global Errors with a Step Size of 0.1.
x Exact
solution
Numerical
Solution
Local
Error(%)
Global
Error(%)
1 1 1 0 0
1.1 1.4413333 1.4 -2.8677151 -2.8677151
1.2 1.9706667 1.884 -2.300406 -4.3978349
1.3 2.596 2.46 -1.9003595 -5.238829
1.4 3.3253333 3.136 -1.6038492 -5.6936648
1.5 4.1666667 3.92 -1.396 -5-92
1.6 5.128 4.82 -1.1960478 -6.0062402
1.7 6.2173333 5.844 -1.0508256 -6.004718
1.8 7.4426667 7 -0.9315657 -5.947689
1.9 8.812 8.296 -0.8321985 -5.8556514
2 10.333333 9.74 -0.7483871 -5.7419355
school.edhole.com
8-16
x Exact
solution
Numerical
Solution
Local
Error(%)
Global
Error(%)
1 1 1 0 0
1.05 1.2101667 1.2 -0.8401047 -0.8401047
1.1 1.4413333 1.4205 -0.7400555 -1.4454209
1.15 1.6945 1.6625 -0.6589948 -1.8884627
1.2 1.9706667 1.927 -0.5920162 -2.2158322
1.25 2.2708333 2.215 -0.5357798 -2.4587156
1.3 2.596 2.5275 -0.4879301 -2.6386749
1.35 2.9471667 2.8655 -0.4467568 -2.771023
1.4 3.3253333 3.23 -0.4109864 -2.8668805
1.45 3.7315 3.622 -0.3796507 -2.9344768
1.5 4.1666667 4.4025 -0.352 -2.98
Table: Local and Global Errors with a Step Size of 0.05.
school.edhole.com
8-17
x Exact
solution
Numerica
l Solution
Local
Error(%)
Global
Error(%)
1.55 4.6318333 4.4925 -0.3274441 -3.0081681
1.6 5.128 4.973 -0.3055122 -3.0226209
1.65 5.6561667 5.485 -0.2858237 -3.0261956
1.7 6.2173333 6.0295 -0.2680678 -3.0211237
1.75 6.8125 6.6075 -0.2519878 -3.0091743
1.8 7.4426667 7.22 -0.2373701 -2.9917592
1.85 8.1088333 7.868 -0.2240355 -2.9700121
1.9 8.812 8.5525 -0.2118323 -2.9448479
1.95 9.5531667 9.2745 -0.2006316 -2.9170083
2 10.333333 10.035 -0.1903226 -2.8870968
Table: Local and Global Errors with a Step Size of 0.05
(continued).
school.edhole.com
8-18
x Exact solution Numerical Solution Local Error(%) Global Error(%)
1 1 1 0 0
1.02 1.0816107 1.08 -0.1489137 -0.1489137
1.04 1.1664853 1.163232 -0.1408219 -0.2789005
1.06 1.254688 1.24976 -0.1334728 -0.392767
1.08 1.3462827 1.339648 -0.1267688 -0.4928138
1.1 1.4413333 1.43296 -0.120629 -0.5809436
1.2 1.9706667 1.95312 -0.0963464 -0.8903924
1.3 2.596 2.56848 -0.0793015 -1.0600924
1.4 3.3253333 3.28704 -0.0667201 -1.1515638
1.5 4.1666667 4.1168 -0.057088 -1.1968
1.6 5.128 5.06876 -0.049506 -1.2137285
1.7 6.2173333 6.14192 -0.0434055 -1.212953
1.8 7.4426667 7.35328 -0.0384092 -1.2010032
1.9 8.812 8.70784 -0.0342563 -1.1820245
2 10.333333 10.2136 -0.0307613 -1.1587097
Table: Local and Global Errors with a Step Size of 0.02.
school.edhole.com
Modified Eulers Method
Use an average slope, rather than the slope at the start
of the interval :
a. Evaluate the slope at the start of the interval
b. Estimate the value of the dependent variable y at the
end of the interval using the Eulers metod.
c. Evaluate the slope at the end of the interval.
d. Find the average slope using the slopes in a and c.
e. Compute a revised value of the dependent variable y
at the end of the interval using the average slope of
step d with Eulers method.
8-19
school.edhole.com
Example : Modified Eulers Method





1 at 1 that such = = = x y y x
dx
dy
10768 . 1 ) 07684 . 1 ( 1 . 0 1 ) 0 . 1 1 . 1 ( ) 0 . 1 ( ) 1 . 1 ( 1e.
07684 . 1 ) 15369 . 1 1 (
2
1
1d.
15369 . 1 1 . 1 1 . 1 c. 1
1 . 1 ) 1 ( 1 . 0 1 ) 0 . 1 1 . 1 ( ) 0 . 1 ( ) 1 . 1 ( 1b.
1 1 1 a. 1
: 1 . 0 for iteration first the of steps five The
1 . 1
1
1
= + = + =
= + =
= =
= + = + =
= =
= A
a
a
dx
dy
g g
dx
dy
dx
dy
dx
dy
g g
dx
dy
x
8-20
school.edhole.com
8-21
23193 . 1 ) 1 . 1 2 . 1 ( ) 1 . 1 ( ) 2 . 1 ( 2e.
24251 . 1 ) (
2
1
2d.
32732 . 1 22345 . 1 2 . 1 c. 2
22345 . 1 ) 15771 . 1 ( 1 . 0 10768 . 1 ) 1 . 1 2 . 1 ( ) 1 . 1 ( ) 2 . 1 ( 2b.
15771 . 1 10768 . 1 1 . 1 a. 2
: interval second for the steps The
2 . 1 1 . 1
2 . 1
1 . 1
1 . 1
= + =
= + =
= =
= + = + =
= = =
a
a
dx
dy
g g
dy
dx
dy
dx
dy
dx
dx
dy
dx
dy
g g
y x
dx
dy
school.edhole.com
Second-order Runge-Kutta Methods

The modified Eulers method is a case of the second-
order Runge-Kutta methods. It can be expressed as



x h x x x
x x g y x g y
h y x hf y h x f y x f y y
i i
i i i i
i i i i i i i i
A = A + =
A + = =
+ + + + =
+
+
+
,
), ( ), ( where
))] , ( , ( ) , ( [ 5 . 0
1
1
1
8-22
school.edhole.com
The computations according to Eulers method:
1. Evaluate the slope at the start of an interval, that is,
at (x
i
,y
i
) .

2. Evaluate the slope at the end of the interval
(x
i+1
,y
i+1
) :

3. Evaluate y
i+1
using the average slope S
1
of and S
2
:

8-23
) , (
1 i i
y x f S =
) , (
1 2
hS y h x f S
i i
+ + =
h S S y y
i i
) ( 5 . 0
2 1 1
+ + =
+
school.edhole.com
Third-order Runge-Kutta Methods
The following is an example of the third-order Runge-
Kutta methods :

h y x hf y h x hf y x hf y h x f
y x hf y h x f y x f y y
i i i i i i i i
i i i i i i i i
)))] , ( 5 . 0 , 5 . 0 ( 2 ) , ( , (
)) , ( 5 . 0 , 5 . 0 ( 4 ) , ( [
6
1
1
+ + + +
+ + + + + =
+
8-24
school.edhole.com

The computational steps for the third-order method:
1. Evaluate the slope at (x
i
,y
i
).

2. Evaluate a second slope S
2
estimate at the mid-point
in of the step as

3. Evaluate a third slope S
3
as

4. Estimate the quantity of interest y
i+1
as
8-25
) 5 . 0 , 5 . 0 (
1 2
hS y h x f S
i i
+ + =
) 2 , (
2 1 3
hS hS y h x f S
i i
+ + =
h S S S y y
i i
] 4 [
6
1
3 2 1 1
+ + + =
+
) , (
1 i i
y x f S =
school.edhole.com
Fourth-order Runge-Kutta Methods

1. Compute the slope S
1
at (x
i
,y
i
).

2. Estimate y at the mid-point of the interval.

3. Estimate the slope S
2
at mid-interval.

4. Revise the estimate of y at mid-interval


. at that such ) , (
0 0
h x x x y y y x f
dx
dy
= A = = =
8-26
) , (
1 i i
y x f S =
) , (
2
2 / 1 i i i i
y x f
h
y y + =
+
) 5 . 0 , 5 . 0 (
1 2
hS y h x f S
i i
+ + =
2 2 / 1
2
S
h
y y
i i
+ =
+
school.edhole.com
5. Compute a revised estimate of the slope S
3
at mid-
interval.

6. Estimate y at the end of the interval.

7. Estimate the slope S
4
at the end of the interval

8. Estimate y
i+1
again.



8-27
) 5 . 0 , 5 . 0 (
2 3
hS y h x f S
i i
+ + =
3 1
hS y y
i i
+ =
+
) , (
3 4
hS y h x f S
i i
+ + =
) 2 2 (
6
4 3 2 1 1
S S S S
h
y y
i i
+ + + + =
+
school.edhole.com
Predictor-Corrector Methods
Unless the step sizes are small, Eulers method and
Runge-Kutta may not yield precise solutions.
The Predictor-Corrector Methods iterate several times
over the same interval until the solution converges to
within an acceptable tolerance.
Two parts: predictor part and corrector part.
8-28
school.edhole.com
Euler-trapezoidal Method
Eulers method is the predictor algorithm.
The trapezoidal rule is the corrector equation.
Eluer formula (predictor):


Trapezoidal rule (corrector):


The corrector equation can be applied as many times as
necessary to get convergence.
,*
,* , 1
i
i j i
dx
dy
h y y + =
+
] [
2
1 , 1 ,*
,* , 1
+
+
+ + =
j i i
i j i
dx
dy
dx
dy h
y y
8-29
school.edhole.com
Example 8-6: Euler-trapezoidal Mehtod
1 at 1 that such : Problem = = = x y y x
dx
dy
1 . 1 ) 1 ( 1 . 0 1
1 . 0
1 1 1
is 1 . 1 at for estimate ) (predictor initial The
0 , 1
0 , 0
,* 0 0 , 1
0 , 0
= + =
(

+ =
= =
=
y
dx
dy
y y
dx
dy
x y
8-30
15369 . 1 1 . 1 1 . 1
: estimate the improve to used is equation corrector The
0 , 1
= =
dx
dy
school.edhole.com
8-31
| |
| |
| | 10789 . 1 15782 . 1 1
2
1 . 0
1
2
15782 . 1 10789 . 1 1 . 1
10789 . 1 15771 . 1 1
2
1 . 0
1
2
15771 . 1 10768 . 1 1 . 1
10768 . 1 15369 . 1 1
2
1 . 0
1
2
2 , 1 0 , 0
,* 0 3 , 1
2 , 1
1 , 1 0 , 0
,* 0 2 , 1
1 , 1
0 , 1 0 , 0
,* 0 1 , 1
= + + =
(

+ + =
= =
= + + =
(

+ + =
= =
= + + =
(

+ + =
dx
dy
dx
dy h
y y
dx
dy
dx
dy
dx
dy h
y y
dx
dy
dx
dy
dx
dy h
y y
. have we And
. 1 . 1 at 1.10789 to converges , Since
3 , 1 ,* 1
2 , 1 3 , 1
y y
x y y y
=
= =
school.edhole.com
8-32
22367 . 1 ) 15782 . 1 ( 1 . 0 10789 . 1
: equation predictor the , 2 . 1 at of estimate For the
,* 1 ,* 1 0 , 2
= + = + =
=
dx
dy
h y y
x y
| |
33203 . 1 23215 . 1 2 . 1
23215 . 1 32744 . 1 15782 . 1
2
1 . 0
10789 . 1
2
32744 . 1 22367 . 1 2 . 1
: equation corrector The
2 , 2
1 , 2 ,* 1
,* 1 1 , 2
1 , 2
= =
= + + =
(

+ + =
= =
dx
dy
dx
dy
dx
dy h
y y
dx
dy
school.edhole.com
8-33
| |
| |
1.23239. is 2 . 1 at of estimate The
. iterations three in converges algorithm corrector the Again,
23239 . 1 33215 . 1 15782 . 1
2
1 . 0
10789 . 1
2
33215 . 1 23238 . 1 2 . 1
23238 . 1 33203 . 1 15782 . 1
2
1 . 0
10789 . 1
2
3 , 2 ,* 1
,* 1 3 , 2
3 , 2
2 , 2 ,* 1
,* 1 2 , 2
=
= + + =
(

+ + =
= =
= + + =
(

+ + =
x y
dx
dy
dx
dy h
y y
dx
dy
dx
dy
dx
dy h
y y
school.edhole.com
Milne-Simpson Method
Milnes equation is the predictor euqation.
The Simpsons rule is the corrector formula.
Milnes equation (predictor):


For the two initial sampling points, a one-step
method such as Eulers equation can be used.
Simpsoss rule (corrector):

8-34
] 2 2 [
3
4
,* 2 ,* 1 ,*
,* 3 0 , 1

+
+ + =
i i i
i i
dx
dy
dx
dy
dx
dy h
y y
] 4 [
3
,* 1 ,* , 1
,* 1 , 1
+
+
+ + + =
i i j i
i j i
dx
dy
dx
dy
dx
dy h
y y
school.edhole.com
Example 8-7: Milne-Simpson Mehtod
. 4 . 1 and 3 . 1 at estimate want to We
1 at 1 that such : Problem
= =
= = =
x x y
x y y x
dx
dy
x
y
dx
dy
8-35
1 1 1
1.1 1.10789 1.15782
1.2 1.23239 1.33215
Assume that we have the following values,
obtained from the Euler-trapezoidal method
in Example 8-6.
school.edhole.com
51917 . 1 36560 . 1 3 . 1
36560 . 1 ) 33215 . 1 ( 1 . 0 23239 . 1
: used be can method s Euler'
, 3 . 1 at for estimate ) (predictor initial the compute To
0 , 3
,* 2
,* 2 0 , 3
= =
= + = + =
=
dx
dy
dx
dy
h y y
x y
8-36
| |
37474 . 1
15782 . 1 ) 33215 . 1 ( 4 51917 . 1
3
1 . 0
10789 . 1
4
3
1 . 0
: formular corrector The
,* 1 ,* 2 0 , 3
,* 1 1 , 3
=
+ + + =
(

+ + + =
dx
dy
dx
dy
dx
dy
y y
school.edhole.com
8-37
| |
| |
37492 . 1
15782 . 1 ) 33215 . 1 ( 4 52434 . 1
3
1 . 0
10789 . 1
52434 . 1 37491 . 1 3 . 1
37491 . 1
15782 . 1 ) 33215 . 1 ( 4 52424 . 1
3
1 . 0
10789 . 1
52424 . 1 37474 . 1 3 . 1
3 , 3
2 , 3
2 , 3
1 , 3
=
+ + + =
= =
=
+ + + =
= =
y
dx
dy
y
dx
dy
The computations for x=1.3 are complete.
school.edhole.com
8-38
The Milne predictor equation for estimating y at x=1.4:
( )
( ) ( ) | |
53762 . 1
15782 . 1 2 33215 . 1 52434 . 1 2
3
1 . 0 4
1
2 2
3
4
,* 1 ,* 2 ,* 3
,* 0 0 , 4
=
+ + =
(

+ + =
dx
dy
dx
dy
dx
dy h
y y
73610 . 1 53762 . 1 4 . 1
1 , 4
= =
dx
dy
The corrector formular:
school.edhole.com
8-39
( ) | |
( ) | |
complete. is it Then
53791 . 1 33215 . 1 52434 . 1 4 73617 . 1
3
1 . 0
23239 . 1
73617 . 1 53791 . 1 4 . 1
53791 . 1
33215 . 1 52434 . 1 4 73601 . 1
3
1 . 0
23239 . 1
4
3
2 , 4
2 , 4
,* 2 ,* 3 0 , 4
,* 2 1 , 4
= + + + =
= =
=
+ + + =
(

+ + + =
y
dx
dy
dx
dy
dx
dy
dx
dy h
y y
school.edhole.com
Least-Squares Method
The procedure for deriving the least-squares function:
1. Assume the solution is an nth-order polynomial:

2. Use the boundary condition of the ordinary
differential equation to evaluate one of
(b
o
,b
1
,b
2
,,b
n
).
3. Define the objective function:
8-40
n
n x
x b x b b b y + + + + =
2
2 1 0

dx e F
x
}
=
2
dx
dy
dx
y d
e =

where
school.edhole.com
4. Find the minimum of F with respect to the unknowns
(b
1
,b
2
, b
3
,,b
n
) , that is


5. The integrals in Step 4 are called the normal
equations; the solution of the normal equations yields
value of the unknowns (b
1
,b
2
, b
3
,,b
n
).
8-41
}
=
c
c
=
c
c
x all
i i
dx
b
e
e
b
F
0 2
school.edhole.com
Example 8-8: Least-squares Method
2 /
2
: solution Analytical
1. x 0 interval for the it Solve
0 at 1 that such : Problem
x
e y
x y xy
dx
dy
=
s s
= = =
8-42
1
1
0
1 0
1 0


1
is model linear the Thus . 1 yields
) 0 ( 1
condition boundary the Using

b
dx
y d
x b y
b
b b y
x b b y
=
+ =
=
+ = =
+ =
First, assume a linear model is used:
school.edhole.com
8-43
0 )
5 4 3
2
2
(
0 ) 1 )]( 1 ( [ 2 2
1
) 1 (
: function error The
0
5
1
4 3
1
2
1
0 0
2
1 1
1
2
1
1 1 1
= + +
= + =
=
+ = =
} }
x
x x
x b x x b x
x b
dx x x b x b dx
db
de
e
x
db
de
x b x b xy b e
x y
x
x
32
15
32
15
1
1
Thus, . b get we , 1 with integral above
the solve , 1 0 range the in interested are we Since
+ =
= =
s s
school.edhole.com
Table: A linear model for the least-squares method
8-44
x True y Value Numerical y Value

Error (%)
0 1. 1. -
0.2 1.0202 1.0938 7.2
0.4 1.0833 1.1875 9.6
0.6 1.1972 1.2812 7.0
0.8 1.3771 1.3750 0.0
1.0 1.6487 1.46688 -10.9
2 /
2
x
e y = x y
32
15
1 + =
school.edhole.com
Next, to improve the accuracy of estimates, a
quadratic model is used:

8-45
x x x b x b
x b x b x x b b xy x b b e
x b b
dx
y d
b
b b b y
x b x b b y
+ =
+ + + = + =
+ =
=
+ + = =
+ + =
) 2 ( ) 1 (
) 1 ( 2 2
is function error The
2


. 1 yields
) 0 ( ) 0 ( 1
condition boundary the Using

3
2
2
1
2
2 1 2 1 2 1
2 1
0
2
2 1 0
2
2 1 0
school.edhole.com
8-46
( ) ( ) | |( )
4
1
12
5
15
8

: limit upper the as 1 Using
0
4 6 5 2 4
3
3
2

0 1 2 1
1
2 1
0
4 6
2
5
1
2 4
2
2
2
3
1
1
0
2 3
2
2
1
2
1
= +
=
=
(

+ + + +
= +
=
c
c
}
b b
x
x x b x b x x b
x b
x b
x b
dx x x x x b x b
x
b
e
x
x
school.edhole.com
8-47
( ) ( ) | |( )
2
2 1
2 1
0
5 7
2
5
1
2 5
2
4
2
4
1
2
1
0
3 3
2
2
1
3
2
78776 . 0 14669 . 0 1
. 78776 . 0 and 14669 . 0 get We
15
7
105
71
20
9

: limit upper the as 1 Using
0
5 7 5 3
2
5
4
3
4
4
2

0 2 2 1 2
2
x x y
b b
b b
x
x x b x b x x b x b x b
x b
dx x x x x x b x b
x x
b
e
x
x
+ =
= =
= +
=
=
(

+ + + +
= +
=
c
c
}
school.edhole.com
Table: A quadratic model for the least-squares method
8-48
x True y Value Numerical y Value

Error (%)
0 1. 1. -
0.2 1.0202 1.0022 -1.8
0.4 1.0833 1.0674 0.0
0.6 1.1972 1.1956 0.0
0.8 1.3771 1.38668 0.0
1.0 1.6487 1.6411 0.0
2 /
2
x
e y =
2
78776 . 0 14669 . 0 1 x x y + =
school.edhole.com
Galerkin Method



Example: Galerkin Method
The same problem as Example 8-8.
Use the quadratic approximating equation.

i
i
i
x
i
b
e
w
w
n i edx w
c
c
=
= =
}
method, squares least For the
factor. ng a weighti is where
... 2 , 1 0
8-49
. and Let
2
2 1
x w x w = =
school.edhole.com
8-50
2
2 1
2 1
1
0
2 3
2
2
1
1
0
3
2
2
1
85526 . 0 26316 . 0 1
: result final The
4
1
3
1
15
2

3
1
15
7
12
1

: equations normal following get the We
0 ] ) 2 ( ) 1 ( [
0 ] ) 2 ( ) 1 ( [
x x y
b b
b b
dx x x x x b x b
xdx x x x b x b
+ =
= +
= +
= +
= +
}
}
school.edhole.com
Table: Example for the Galerkin method
x True y value Numerical y value Error
(%)
0 1. 1. --
0.2 1.0202 0.9816 0.0
0.4 1.0833 1.0316 0.0
0.6 1.1972 1.1500 0.0
0.8 1.3771 1.3368 0.0
1.0 1.6487 1.5921 0.0
2 /
2
x
e y =
2
85526 . 0 26316 . 0 1 x x y + =
8-51
school.edhole.com
Higher-Order Differential Equations
Second order differential equation:


Transform it into a system of first-order differential
equations.
dx
dy
dx
dy
y y y
y
dx
dy
y y x f
dx
dy
= = =
=
=
1
2 1
2
1
2 1
2
and where
) , , (
|
.
|

\
|
=
dx
dy
y x f
dx
y d
, ,
2
2
8-52
school.edhole.com
In general, any system of n equations of the following
type can be solved using any of the previously
discussed methods:
8-53
) ,... , , (

) ,... , , (
) ,... , , (
) ,... , , (
2 1
2 1 3
3
2 1 2
2
2 1 1
1
n n
n
n
n
n
y y y x f
dx
dy
y y y x f
dx
dy
y y y x f
dx
dy
y y y x f
dx
dy
=
=
=
=

school.edhole.com
Example: Second-order Differential Equation
8-54
EI
X X
EI
M
dX
Y d
2
2
2
10
: Problem

= =
Z
dX
dY
EI
X X
EI
M
dX
dZ
=

= =

10

: into med transfor be can It
2
h Z Y X f Y Y
h Z Y X f Z Z
Z Y X EI
i i i i i
i i i i i
) , , (
) , , (
: equations following the solve to method s Euler' Use
02314 . 0 and 0 , 0 at 3600 Assume
1 1
2 1
+ =
+ =
= = = =
+
+
school.edhole.com
Table: Second-order Differential Equation
Using a Step Size of 0.1 Ft
X
(ft)
Y
(ft)
Exact Z Exact Y
(ft)
0 0 -0.0231481 0 -0.0231481 0
0.1 0.000275 -0.0231481 -0.0023148 -0.0231344 -0.0023144
0.2 0.0005444 -0.0231206 -0.0046296 -0.0230933 -0.004626
0.3 0.0008083 -0.0230662 -0.0069417 -0.0230256 -0.0069321
0.4 0.0010667 -0.0229854 -0.0092483 -0.0229319 -0.0092302
0.5 0.0013194 -0.0228787 -0.0115469 -0.0228125 -0.0115177
0.6 0.0015667 -0.0227468 -0.0138347 -0.0226681 -0.0137919
0.7 0.0018083 -0.0225901 -0.0161094 -0.0224994 -0.0160505
0.8 0.0020444 -0.0224093 -0.0183684 -0.0223067 -0.018291
0.9 0.002275 -0.0222048 -0.0206093 -0.0220906 -0.020511
8-55
dX
dZ
dX
dY
Z =
school.edhole.com
Table: Second-order Differential Equation
Using a Step Size of 0.1 Ft (continued)
X
(ft)
Y
(ft)
Exact Z Exact Y
(ft)
1 0.0025 -0.0219773 -0.0228298 -0.0218519 -0.0227083
2 0.0044444 -0.0185565 -0.0434305 -0.0183333 -0.04296663
3 0.0058333 -0.0134412 -0.0298019 -0.0131481 -0.0588194
4 0.0066667 -0.007187 -0.0704998 -0.0068519 -0.0688889
5 0.0069444 -0.0003495 -0.0746352 0.00000000 -0.071228
6 0.0066667 0.0065157 -0.0718747 0.0068519 -0.0688889
7 0.0058333 0.0128532 -0.06244066 0.0131481 -0.0588194
8 0.0044444 0.0181074 -0.0471107 0.0183333 -0.042963
9 0.0025 0.0217227 -0.0272183 0.0278519 -0.0227083
10 0.000000 0.0231435 -0.00466523 0.0231481 0.000000
8-56
dX
dZ
dX
dY
Z =
school.edhole.com

Você também pode gostar