Introduction to Scientic Computing Steve Marschner Cornell CS 322 - - PowerPoint PPT Presentation

introduction to scienti c computing
SMART_READER_LITE
LIVE PREVIEW

Introduction to Scientic Computing Steve Marschner Cornell CS 322 - - PowerPoint PPT Presentation

Disasters Problems Themes Deconstruction Introduction to Scientic Computing Steve Marschner Cornell CS 322 Cornell CS 322 Introduction to Scientic Computing 1 Disasters Problems Themes Deconstruction Outline Two numerical cautionary


slide-1
SLIDE 1

Disasters Problems Themes Deconstruction

Introduction to Scientic Computing

Steve Marschner Cornell CS 322

Cornell CS 322 Introduction to Scientic Computing 1

slide-2
SLIDE 2

Disasters Problems Themes Deconstruction

Outline

Two numerical cautionary tales Standard types of problems and solutions Themes of CS322 Deconstructing matrix-vector products

Cornell CS 322 Introduction to Scientic Computing 2

slide-3
SLIDE 3

Disasters Problems Themes Deconstruction

Ariane 5 explosion

Cornell CS 322 Introduction to Scientic Computing 3

slide-4
SLIDE 4

Disasters Problems Themes Deconstruction

Ariane 5 explosion

First launch of Ariane 5 expendable launcher lost control and exploded at t + 40 sec. Problem: number format conversion error

  • Convert 64-bit FP (Matlab double) 16-bit signed integer

(Matlab int16)

  • Value is ≥ 215
  • Uncaught exception =

⇒ crash of guidance system Loss: 5 × 108 dollars (that's $25,856 as an int16)

Cornell CS 322 Introduction to Scientic Computing 3

slide-5
SLIDE 5

Disasters Problems Themes Deconstruction

Patriot anti-missile system failure

Cornell CS 322 Introduction to Scientic Computing 4

slide-6
SLIDE 6

Disasters Problems Themes Deconstruction

Patriot anti-missile system failure

Patriot had trouble hitting fast-moving targets, sometimes. In 1991 a Scud missile hit a barracks, killing 28, triggering a US government investigation. . .

  • System makes time calculations to sync to radar
  • Starts to fail after it's been up for a day or so

Cornell CS 322 Introduction to Scientic Computing 4

slide-7
SLIDE 7

Disasters Problems Themes Deconstruction

Patriot anti-missile system failure

Clock reads in tenths of a second since boot time Software multiplies by 0.1 to get seconds

  • Number format: xed point with 24 bits of fraction
  • precision better than a millionth of a second
  • does not represent 1/10 exactly

What is the error in representing 0.1 and what is its effect?

Cornell CS 322 Introduction to Scientic Computing 4

slide-8
SLIDE 8

Disasters Problems Themes Deconstruction

Sleipner A offshore platform failure

Norwegian offshore drilling platform collapses and sinks Concrete structure designed using nite element structural analysis

  • What this means, roughly
  • Approximation not precise enough

An example of a higher-level problem → maybe not a numerical one, really.

These stories borrowed from Douglas Arnold read more: http://www.ima.umn.edu/∼arnold/disasters/disasters.html Cornell CS 322 Introduction to Scientic Computing 5

slide-9
SLIDE 9

Disasters Problems Themes Deconstruction

Standard types of problems

  • Systems of equations
  • linear geometric transformation circuit analysis
  • nonlinear orbital calculations
  • Overconstrained systems
  • linear linear data modeling circuit analysis
  • nonlinear nonlinear data modeling
  • Approximation
  • linear tting polynomials
  • nonlinear tting gamma curves

Cornell CS 322 Introduction to Scientic Computing 6

slide-10
SLIDE 10

Disasters Problems Themes Deconstruction

Standard types of problems

  • Optimization
  • nonlinear practically everything
  • constrained spacetime constraints
  • linear programming economics
  • Integration
  • denite integrals (quadrature) lighting
  • differential equations

◮ initial value problem mechanical systems ◮ boundary value problem ordinary: hanging chain cloth, uids Cornell CS 322 Introduction to Scientic Computing 6

slide-11
SLIDE 11

Disasters Problems Themes Deconstruction

Types of methods

  • Direct (xed sequence of operations leads to an

answernumber of steps is predetermined)

  • Iterative (repeatedly rene an approximation until some

accuracy goal is reachednumber of steps variable)

  • Probabilistic (approximate the answer by some computation

based on a number of stochastic experiments)

Cornell CS 322 Introduction to Scientic Computing 7

slide-12
SLIDE 12

Disasters Problems Themes Deconstruction

Properties of methods

  • Accuracy
  • Stability
  • Rate of convergence
  • Execution time (time complexity)
  • Memory requirements (space complexity)

Cornell CS 322 Introduction to Scientic Computing 8

slide-13
SLIDE 13

Disasters Problems Themes Deconstruction

Themes of CS322

  • continuous mathematics
  • nite precision arithmetic
  • precision, accuracy
  • intuitive sense for precision
  • high level thinking
  • stability
  • of problems
  • of algorithms

Cornell CS 322 Introduction to Scientic Computing 9

slide-14
SLIDE 14

Disasters Problems Themes Deconstruction

Themes of CS322

  • iterative approximation
  • convergence (guarantees)
  • convergence (rate)
  • efciency
  • computational complexity
  • effective use of linear algebra libraries
  • applications
  • visualization
  • direct vs. iterative methods
  • linear vs. nonlinear problems

Cornell CS 322 Introduction to Scientic Computing 9

slide-15
SLIDE 15

Disasters Problems Themes Deconstruction

Deconstructing a matrix-vector product

There are a number of ways to think about the meaning of a matrix-vector product. Some examples follow, but rst a more systematic nomenclature: Ax = b   a11 a12 a13 a21 a22 a23 a31 a32 a33     x1 x2 x3   =   b1 b2 b3   This 3 × 3 example can serve to dene this notation for any size matrices and vectors. Note that the row index is rst, then the column index (contrary to C, Java, etc.).

Cornell CS 322 Introduction to Scientic Computing 10

slide-16
SLIDE 16

Disasters Problems Themes Deconstruction

Deconstructing a matrix-vector product

scalar level

A matrix-vector product is shorthand for a sum of products of entries:   a11 a12 a13 a21 a22 a23 a31 a32 a33     x1 x2 x3   =   b1 b2 b3   bi =

3

  • j=1

aijxj for i = 1, 2, 3

Cornell CS 322 Introduction to Scientic Computing 11

slide-17
SLIDE 17

Disasters Problems Themes Deconstruction

Deconstructing a matrix-vector product

scalar level

A matrix-vector product is shorthand for a sum of products of entries:    a11 · · · a1n . . . ... . . . an1 · · · ann       x1 . . . xn    =    b1 . . . bn    bi =

n

  • j=1

aijxj for i = 1, . . . , n

Cornell CS 322 Introduction to Scientic Computing 11

slide-18
SLIDE 18

Disasters Problems Themes Deconstruction

Deconstructing a matrix-vector product

dot product

A matrix-vector product is shorthand for dot products with the rows:   a11 a12 a13 a21 a22 a23 a31 a32 a33     x1 x2 x3   =   b1 b2 b3       r1 r2 r3       | x |   =   r1 · x r2 · x r3 · x   =   b1 b2 b3   bi = ri · x for i = 1, 2, 3

Cornell CS 322 Introduction to Scientic Computing 12

slide-19
SLIDE 19

Disasters Problems Themes Deconstruction

Deconstructing a matrix-vector product

dot product

A matrix-vector product is shorthand for dot products with the rows:    a11 · · · a1n . . . ... . . . an1 · · · ann       x1 . . . xn    =    b1 . . . bn         r1 . . . rn        | x |   =    r1 · x . . . rn · x    =    b1 . . . bn    bi = ri · x for i = 1, . . . , n

Cornell CS 322 Introduction to Scientic Computing 12

slide-20
SLIDE 20

Disasters Problems Themes Deconstruction

Deconstructing a matrix-vector product

linear combination

A matrix-vector product is shorthand for a linear combination of columns:   a11 a12 a13 a21 a22 a23 a31 a32 a33     x1 x2 x3   =   b1 b2 b3     | | | c1 c2 c3 | | |     x1 x2 x3   =   | b |   b = x1c1 + x2c2 + x3c3

Cornell CS 322 Introduction to Scientic Computing 13

slide-21
SLIDE 21

Disasters Problems Themes Deconstruction

Deconstructing a matrix-vector product

linear combination

A matrix-vector product is shorthand for a linear combination of columns:    a11 · · · a1n . . . ... . . . an1 · · · ann       x1 . . . xn    =    b1 . . . bn      | | c1 · · · cn | |      x1 . . . xn    =   | b |   b =

n

  • j=1

xjcj

Cornell CS 322 Introduction to Scientic Computing 13