CSE 541 Numerical Methods - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

CSE 541 Numerical Methods

Description:

A function is a mapping from a set of values (called the domain) to another set ... This is called Horner's rule or method. 11/24/09. 17. CSE 541 - Numerical Methods ... – PowerPoint PPT presentation

Number of Views:64
Avg rating:3.0/5.0
Slides: 20
Provided by: rogerc2
Category:

less

Transcript and Presenter's Notes

Title: CSE 541 Numerical Methods


1
CSE 541Numerical Methods
  • Mathematical Preliminaries and Algorithms

2
Review of Functions
  • A function is a mapping from a set of values
    (called the domain) to another set of values
    (called the range)
  • A 1D function, y f(x) or expressed as (x, f(x))
  • x is the independent variable and y is dependent
    variable
  • Higher dimensional functions, z f(x, y)
  • We will stick with 1D functions in lecture for
    the most part

3
Algorithm Function Extrema
  • Take a function f(x) and any point t on the
    domain, give me an algorithm that will tell
    determine if f(t) is an extrema

y
f(x)
x
t
4
Review of Functions
  • First derivative, f (x)
  • How fast the function changes
  • Slope
  • Mathematical definition
  • Extrema of a function occur where f (x) 0

5
AlgorithmFunction Minimum or Maximum
  • Take a function f(x) and any point t on the
    domain, give me an algorithm that will tell
    determine if f(t) is a function min or max

y
f(x)
x
t
6
Review of Functions
  • Second derivative, f (x)
  • Acceleration
  • Indicates curvature
  • Determines whether the function at x is a minimum
    or maximum

7
Tangents (Gradients) and Normals
  • Assume a 2nd degree function
  • Geometric formulation of the first derivative
    Tangent line
  • A linear approximation to the curve at t is l(x)
    b f(t)x
  • l(x) intersects the curve at t, so it
    interpolates the function

f (t)
N -1/f (t)
y
f(x)
x
t
8
Higher Dimensional Functions
  • A surface is a 2D function in 3D
  • Surface (x, y, f(x,y) )
  • A volume (hyper-surface) is a 3D function in 4D
  • Volume (x, y, z, f(x,y,z) )

9
Partial Derivatives
  • Keep the other dimensions constant

10
Tangent (Gradient)
  • Assume a 2nd degree function
  • Tangent at point (s, t) is a linear slope, i.e.
    a plane
  • axbyczd 0

11
Tangent Plane Construction
  • Assume a 2nd degree function
  • Give me a geometric algorithm to construct the
    tangent plane at point (s, t)

Images courtesy of TJ Murphy http//www.math.ou.e
du/tjmurphy/Teaching/2443/TangentPlane/TangentPla
ne.html
12
Tangent Plane Construction
13
Tangent Plane Construction
14
Normal
  • The normal to the plane is
  • A vector perpendicular to the tangent plane

15
The Class of Polynomials
  • Specific functions of the form
  • For many polynomials, the latter coefficients are
    zero. For example
  • p(x) 3x25x3

16
Algorithm Efficiency
  • Suppose we want to evaluate this polynomial at x
    2
  • f(x) 2x4 x3 3x2 x1 2
  • How many mults are required to compute f(2)?
  • Re-write the expression as
  • f(x) (((2x 1)x 3)x 1)x 2
  • This is called Horners rule or method.

17
Errors in Calculcations
  • A program implementation of a calculation will
    introduce errors, e.g.
  • We may know the true solution, e.g. f(x) x2

18
Errors in Calculations
  • Error
  • How far away am I from the true solution?
  • Simple definition a b , where a is the
    true value and b is an approximation
  • We may only be able to compute an approximation
  • Approxiate Pi?
  • Determining an error is not easy in many cases
  • May be able to find an error bound, a b lt e

19
Absolute vs Relative Errors
  • Are all errors the same?
  • a 1,000,000 and b 1,000,000.01, error .01
  • vs
  • a .02 and b .01, error .01
  • Absolute error a b
  • Relative error a b / a
  • Scale factor brings things into perspective
Write a Comment
User Comments (0)
About PowerShow.com