Euler Method for Solving Ordinary Differential Equations

Download Report

Transcript Euler Method for Solving Ordinary Differential Equations

Numerical Methods
Golden Section Search Method Example
http://nm.mathforcollege.com
For more details on this topic



Go to http://nm.mathforcollege.com
Click on Keyword
Click on Golden Section Search Method
You are free


to Share – to copy, distribute, display and
perform the work
to Remix – to make derivative works
Under the following conditions



Attribution — You must attribute the work in
the manner specified by the author or licensor
(but not in any way that suggests that they
endorse you or your use of the work).
Noncommercial — You may not use this work
for commercial purposes.
Share Alike — If you alter, transform, or build
upon this work, you may distribute the resulting
work only under the same or similar license to
this one.
Example
.
2
2

2

The cross-sectional area A of a gutter with equal base and
edge length of 2 is given by (trapezoidal area):
Max. f ( )  A  4 sin  (1  cos )  4 sin   2 sin(2 )
Find the angle  which maximizes the cross-sectional area
of the gutter. Using an initial interval of [0,  ] find the
2
solution after 2 iterations.
  0.05
Convergence achieved if “ interval length ” is within
5
http://nm.mathforcollege.com
Solution
The function to be maximized is f ( )  4 sin  (1  cos )
Iteration 1: Given the values for the boundaries of
xL  0 and xu   / 2we can calculate the initial intermediate
points as follows:
5 1
5 1
( xu  x L )  0 
(1.5708)  0.97080 f (0.97080)  5.1654
2
2
5 1
5 1
x 2  xu 
( xu  x L )  1.5708
(1.5708)  0.60000 f (0.60000)  4.1227
2
2
x1  x L 
f2
f1
X1=?
XL
6
X2
X1
XL=X2
Xu
X2=X1
Xu
http://nm.mathforcollege.com
Solution Cont
x1  x L 
5 1
5 1
( xu  x L )  0.60000
(1.5708 0.60000)  1.2000
2
2
To check the stopping criteria the difference between xu
and x L is calculated to be
xu  xL  1.5708 0.60000 0.97080
7
http://nm.mathforcollege.com
Solution Cont
Iteration 2
x L  0.60000
xu  1.5708
f ( x1 )  f ( x2 )
x1  1.2000
f (1.2000)  5.0791
x 2  0.97080
f (0.97080)  5.1654
x L  0.60000
xu  1.2000
x1  0.97080
x 2  xu 
XL
8
X2
X 1 Xu
5 1
5 1
( xu  x L )  1.2000
(1.2000 0.6000)  0.82918
2
2
xu  x L
 1.2000 0.6000  0.9000
2
http://nm.mathforcollege.com
Theoretical Solution and
Convergence
Iteration
1
2
3
4
5
6
7
8
9
xl
0.0000
0.6002
0.6002
0.8295
0.9712
0.9712
1.0253
1.0253
1.0253
xu
1.5714
1.5714
1.2005
1.2005
1.2005
1.1129
1.1129
1.0794
1.0588
x1
0.9712
1.2005
0.9712
1.0588
1.1129
1.0588
1.0794
1.0588
1.0460
x2
0.6002
0.9712
0.8295
0.9712
1.0588
1.0253
1.0588
1.0460
1.0381
f(x1)
5.1657
5.0784
5.1657
5.1955
5.1740
5.1955
5.1908
5.1955
5.1961
xu  x L 1.0253 1.0588

 1.0420
2
2
f(x2)
4.1238
5.1657
4.9426
5.1657
5.1955
5.1937
5.1955
5.1961
5.1957

1.5714
0.9712
0.6002
0.3710
0.2293
0.1417
0.0876
0.0541
0.0334
f (1.0420)  5.1960
The theoretically optimal solution to the problem
happens at exactly 60 degrees which is 1.0472 radians
and gives a maximum cross-sectional area of 5.1962.
9
http://nm.mathforcollege.com
THE END
http://nm.mathforcollege.com
Acknowledgement
This instructional power point brought to you by
Numerical Methods for STEM undergraduate
http://nm.mathforcollege.com
Committed to bringing numerical methods to the
undergraduate
For instructional videos on other topics, go to
http://nm.mathforcollege.com
This material is based upon work supported by the National Science
Foundation under Grant # 0717624. Any opinions, findings, and
conclusions or recommendations expressed in this material are those of
the author(s) and do not necessarily reflect the views of the National
Science Foundation.
The End - Really