Docsity

Lecture Notes on Numerical Methods | CS 257, Study notes of Computer Science

Partial preview of the text

Download Lecture Notes on Numerical Methods | CS 257 and more Study notes Computer Science in PDF only on Docsity!

Lecture 1

Numerical Methods

L. Olson

Department of Computer Science University of Illinois at Urbana-Champaign

January 17, 2006

Numerical Methods?

Numerical Analysis?

Analytic Solution vs. Numerical Solution

Analytic Solution (a.k.a. symbolic): The exact numerical or symbolic representation of the solution I (^) may use special characters such as π, e, or tan ( 83 ) Numerical Solution: The computational representation of the solution I (^) entirely numerical

Example (analytic)

π tan ( 83 )

Example (numerical)

Numerical Computation and Approximation

Numerical Approximation is needed to carry out the steps in the numerical calculation. The overall process is a numerical computation.

Example (symbolic computation, numerical solution)

Example (numerical computation, numerical approximation)

Method vs. Algorithm vs Implementation

Method: a mathematical description of a calculation Algorithm: a detailed sequence of steps Implementation: a particular instantiation of the the algorithm

Algorithm 1

(^1) Grind fresh beans (^2) Place new filter in filter holder (^3) Measure 4 tablespoons into the filter (^4) Wash and rinse the coffeepot (^5) Fill coffeemaker with 4 cups of water (^6) Start the machine

Algorithm 2

(^1) Take coffee from the can (^2) Place new filter in filter holder (^3) Pour coffee into filter (^4) Empty coffeepot (^5) Fill coffeemaker with water (^6) Start the machine

accuracy is much different results are not consistent after each run BUT algorithm 2 is cheaper (both in speed and in resources)

Method vs. Algorithm vs Implementation

Method: a general description of a process Algorithm: a detailed description of the method Implementation: a particular instantiation of the the algorithm

Implementation 1

(^1) Grind fresh Starbucks beans in a Williams and Sonoma 1000 grinder (^2) Place new unbleached Mr. Coffee filter in filter holder (^3) Measure 4 tablespoons with hand into the filter (^4) Wash and rinse the coffeepot (^5) Fill KitchenAid coffeemaker with 4 cups water (^6) Start the machine

expensive implementation is it worth it?

Archimedes

287-212BC developed the "Method of Exhaustion" Method for determining π I (^) find the length of the permieter of a polygon inscribed inside a circle of radius 1/ 2 I (^) find the permiter of a polygon circumscribed outside a circle of radius 1/ 2 I (^) the value of π is between these two lengths

Method of Exhaustion

A circle is not a polygon A circle is a polygon with an infinite number of sides Cn = circumference of an n-sided polygon inscribed in a circle of radius 1 / 2 limn→∞ = π Archimedes deterimined 223 71 <π <

  1. 1408 <π < 3. 1429

two places of accuracy.... see http://www.pbs.org/wgbh/nova/archimedes/pi.html

Numerical Analysis

Definition (Trefethen)

Study of algorithms for the problems of continuous mathematics

We’ve been doing this since Calculus (and before!) Riemann sum for calculating a definite integral Newton’s Method Taylor’s Series expansion + truncation

Big Questions

How algorithms work and how they fail Why algorithms work and why they fail

Connects mathematics and computer science Need mathematical theory, computer programming, and scientific inquiry

Numerical Analysis

Numerical focus: Approximation An approximation solution is sought. How close is this to the desired solution? Efficiency How fast and cheap (memory) can we compute a solution? Stability Is the solution sensitive to small variations in the problem setup? Error What is the role of finite precition of our computers?

Numerical Analysis

Why? Numerical methods improve scientific simulation Some disasters attributable to bad numerical computing (Douglas Arnold)

I (^) The Patriot Missile failure, in Dharan, Saudi Arabia, on February 25, 1991 which resulted in 28 deaths, is ultimately attributable to poor handling of rounding errors. I (^) The explosion of the Ariane 5 rocket just after lift-off on its maiden voyage off French Guiana, on June 4, 1996, was ultimately the consequence of a simple overflow. I (^) The sinking of the Sleipner A offshore platform in Gandsfjorden near Stavanger, Norway, on August 23, 1991, resulted in a loss of nearly one billion dollars. It was found to be the result of inaccurate finite element analysis.

look at areas of application along the way:

Engineering simulating physical systems from industry or the environment, e.g. design/ analysis of buildings/bridges/aircraft/automobiles, weather prediction, prediction of traffic flow. Biology Simulation of biological processes, e.g. spread of disease, population growth, blood flow/circulation/nerve firing. (Computational genetics often uses discrete algorithms, drawing from combinatorics, rather than numerical analysis.)

Computer graphics image compression, representation of curves/surfaces/lighting

Economics/Finance modeling/simulation of financial data. Scientific computing: design of algorithms for high performance/parallel computing.

Social/behavioral sciences simulation of social processes.

The Boring Part

http://www.cs.uiuc.edu/class/sp06/cs257/

Book: Numerical Methods With Matlab: Implementation and Application by Gerald Recktenwald UIUC bookstore: $102 new, $77 used Amazon: $96 new, $48 used eCampus: $99 new

Luke’s contact: Office: 4312 Siebel Center Office Hours: TR 11- email: lukeo AT uiuc.edu IM: cs256prof

Adam Reichert, Reza Zamani Nasab, Jacob Schroder contact: Office: 0228 Siebel Center Office Phone: 265- Office Hours: TBD emails: {areiche2, zamani, jschrod3} AT uiuc.edu