numerical methods - 國立臺北科技大學taipei techjuiching/nmsyllabus.pdf · 2018-02-26 ·...
TRANSCRIPT
Numerical Methods
Textbook• Chapra, “Applied Numerical Methods with
MATLAB for Engineers and Scientists, 3nd Edition.”
• Publisher: McGraw-Hill• Class Note: www.ntut.edu.tw/~juiching
Grading Policy• 15 Weekly programming home work:
75%.• Programming capability evaluation:
25%.
Teaching Hours• Lecture: 1:10 pm ~ 2:00 pm, Tuesday.• Lab: 2:10 pm ~ 4:00 pm, Tuesday.• Office hour: 4:10 pm~7:00 pm, Tuesday
and Thursday.
Goal• Learn numerical methods. • Learn MATLAB.
What is “Numerical Methods”?
• Solving mathematical equations by computer programs numerically.
Why learn “Numerical Methods”?
• Equations in engineering mathematics– the simplest.– solutions in functional form.
• Problems in real life– usually not solvable by the technique in engineering
mathematics.– solutions not necessarily in functional form.
Why learn “Numerical Methods”? (cont.)
• Example: the volume of liquid V in a hollow horizontal cylinder of radius r and length L is related to the depth of the liquid h by
• If r is fixed, can youdetermine h for a given V?
V' r 2cos&1 r&hr
&(r&h) 2rh&h 2 LV' r 2cos&1 r&hr
&(r&h) 2rh&h 2 L
Lh
Symbolical v.s. Numerical
• Symbolical– Solve equations by derivative technique.– Mimic the way human brains solve problems.– Solutions are in function form.– Specific but not general.– Efficient but limited. Many are not solvable.– Software: Mathemetica, Maple
Symbolical v.s. Numerical (cont.)
• Numerical– Utilize the advantages of computers: fast, large and
repetitive.– Very different from the way human brains solve
problems.– Solutions are in numerical form.– General.– Not efficient but not limited.– Software: MATLAB and any programming languages.
Symbolical v.s. Numerical (cont.)
• Symbolical– Example:
&d 2f(x)dx 2
'1%4x 2, f(0)'f(1)'0
Y f(x)'5x6&
x 2
2&
x 4
3
&d 2f(x)dx 2
'1%4x 2, f(0)'f(1)'0
Y f(x)'5x6&
x 2
2&
x 4
3
Symbolical v.s. Numerical (cont.)
• Numerical– Example: same as previous.
f )(x)' f(x%Δ x)& f(x&Δx)2Δx
f ))(x)' f(x%Δ x)&2 f(x)% f(x&Δ x)Δx 2
&fi% 1& 2 fi% fi& 1
Δ x 2' 1% 4x 2
i
Δx'0 .1
1Δx2
2 &1 0 0 0 0 0 0 0&1 2 &1 0 0 0 0 0 00 &1 2 &1 0 0 0 0 00 0 &1 2 &1 0 0 0 00 0 0 &1 2 &1 0 0 00 0 0 0 &1 2 &1 0 00 0 0 0 0 &1 2 &1 00 0 0 0 0 0 &1 2 &10 0 0 0 0 0 0 &1 2
f1f2!
f9
'
1%4x 21
1%4x 22
!
1%4x 29
1Δx2
2 &1 0 0 0 0 0 0 0&1 2 &1 0 0 0 0 0 00 &1 2 &1 0 0 0 0 00 0 &1 2 &1 0 0 0 00 0 0 &1 2 &1 0 0 00 0 0 0 &1 2 &1 0 00 0 0 0 0 &1 2 &1 00 0 0 0 0 0 &1 2 &10 0 0 0 0 0 0 &1 2
f1f2!
f9
'
1%4x 21
1%4x 22
!
1%4x 29
Symbolical v.s. Numerical (cont.)
• Comparison
0
0.05
0.1
0.15
0.2
0.25
0.3
0 0.2 0.4 0.6 0.8 1
f(x)
x
exactfinite difference
Symbolical v.s. Numerical (cont.)
DescriptionOf Problem
Formulate
SolveSymbolically
SolveNumerically
NumericalData
Contents
• Roots of Equations• Linear Algebraic Equations and Matrices
– Direct solver– Iterative solver
• Curve Fitting• Numerical Integration Formulas• ODEs• Eigenvalues
What is MATLAB?• Short for MATrix LABoratory• A numerical computing environment and
programming language.• Merits:
– Interactive– Easy matrix manipulation– Plotting of functions and data– Creation of user interfaces– Interface with programs in other languages– Many libraries of useful functions
Importance of MATLAB• A must-have tool for engineers.• A common software engineering students
must learn in the United States.• At least, a good replacement of calculators.• Example: computing the following formula
V' r 2cos&1 r&hr
&(r&h) 2rh&h 2 LV' r 2cos&1 r&hr
&(r&h) 2rh&h 2 L
A Simple Demo of MATLAB• Every variable is a matrix. Case sensitive.• Assigning values to variables
– Real number– Complex number– Matrix
• Mathmatical operations– Matrix operation– Element-by-element operation
A Simple Demo of MATLAB(cont.)
• Built-in functions• Graphics• Script files• Function files• Conditional statement “if”• Loops
– “for”– “while”
Free Compatible MATLAB Packages
• Octave• FreeMAT• SciLAB
Milestones of AI
• Autonomous Cars• Robots• Chess• Quiz
Autonomous Cars
• DARPA Grand Challenge 2004– Route: Mojave Desert, 150 miles.– Prize: 1 million.– Result: no team succeeded.
• DARPA Grand Challenge 2005– Result: 5 teams succeeded.
• DARPA Grand Challenge 2007– Route: urban area in California, 60 miles.– Prize: 3.5 million total.– Result: 6 teams succeeded.
Robots
• DARPA Robotics Challenge 2015– Semi-autonomous ground robots that could do
complex tasks in dangerous, degraded, human-engineered environments.
– Complete 8 tasks simulating disaster response.– Prize: 3.5 millions total.– Winner: Korea KAIST (Korea Advanced
Institute of Science and Technology).
Chess
• IBM Deep Blue chess computer defeated World Champion Kasparov in 1997.
• In 2016, Google Alpha Go defeated Lee Sedol, the second-highest in Go international Championship ranking.
Quiz
• In 2011, IBM Watson defeated on quiz show Jeopardy! former winners Brad Rutterand Ken Jennings and received the first place prize of $1 million.