900 likes | 1.16k Views
Numerical Analysis. EE, NCKU Tien-Hao Chang (Darby Chang). Summary. 1 exam, 1project and some exercises http://zoro.ee.ncku.edu.tw/na /. Target. Solve problems with numerical methods. In this slide. Why numerical methods? differences between human and computer
E N D
Numerical Analysis EE, NCKU Tien-Hao Chang (Darby Chang)
Summary 1 exam, 1project and some exercises http://zoro.ee.ncku.edu.tw/na/
Target Solve problems with numerical methods
In this slide • Why numerical methods? • differences between human and computer • a very simple numerical method • What is algorithm? • definition and components • three problems and three algorithms • Convergence • compare rate of convergence
Why such methods? Computer is stupid
x-2=0 Human says, “x=2, easy!”
{ x-2=0; } Computer says, “compilation error!”
http://www.wallcoo.com/paint/Donald_Zolan_Early_Childhood_02/wallpapers/1280x1024/painting_children_kjb_DonaldZolan_68TheThinker_sm.jpghttp://www.wallcoo.com/paint/Donald_Zolan_Early_Childhood_02/wallpapers/1280x1024/painting_children_kjb_DonaldZolan_68TheThinker_sm.jpg Human is logical (thinking)
http://files.myopera.com/conansakura/albums/31567/thumbs/2.jpg_thumb.jpghttp://files.myopera.com/conansakura/albums/31567/thumbs/2.jpg_thumb.jpg Can do inference
http://www.aclibrary.org/eventkeeper/Graphics/SLZ/computer.jpghttp://www.aclibrary.org/eventkeeper/Graphics/SLZ/computer.jpg Computer is procedural (executing)
An example • (((x+3)-2)+6)=0 • Human requires only the rules (in this case, arithmetic), • and can inference the steps for the solution
Computer • (((x+3)-2)+6)=0 • Requires the exact procedure (steps) • { x0=0–6; } • { x1=x0+2; } • { x=x1–3; } • These steps is numerical method
http://www.masternewmedia.org/images/fast_snail_id86636_size350.jpghttp://www.masternewmedia.org/images/fast_snail_id86636_size350.jpg It is fast
So, why numerical methods? • Computer is stupid • Computer is fast (and works hard) • Sometimes, stupid methods can solve difficult problems
We know that is no earlier than PM 7:15, and is no later than PM 8:00. So…
could be PM 7:38 rubbish =.=
A systematic procedure • Let as PM 7:38 • Evaluate the above formula • If the result exceeds 98.6, we use PM 7:27, otherwise, we use PM 7:49 instead • Repeat step 2 & 3 until the result is close to 98.6 enough
http://www.leda-tutorial.org/en/unofficial/Pictures/BisectionMethod.pnghttp://www.leda-tutorial.org/en/unofficial/Pictures/BisectionMethod.png Bisection method
Bisection method • The concept is • 1) find the mid-point, 2) evaluate it, and 3) shrink the solution range • It is stupid: just trial and error • But it works, because is ascending • And…
And very accurate Actually, it is getting accurate after every trial
When #trails Computer works hard, so it could happen
Algorithm The heart of numerical analysis
Algorithm • Definition • A precisely defined sequence of steps • In this course • design; • implement; and • examine the performance
By hand too painful (but you might need to)
With computer in other words, do programming
Programming Even scared!
An example from statistics • Mean and standard deviation on nvalues
In action input is
It is also an algorithm (a precisely defined sequence of steps)
Not A difficult sequence of steps
Another example Definite integral using trapezoidal rule
Error • The analytic solution is • The absolute error is
Observations of the errors • , the absolute error, is a decreasing function of • When is doubled, is reduced by a factor (roughly 1/4) • From the numerical evidencewhere is independent of