introduction to scienti c computing
play

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


  1. Disasters Problems Themes Deconstruction Introduction to Scienti�c Computing Steve Marschner Cornell CS 322 Cornell CS 322 Introduction to Scienti�c Computing 1

  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 Scienti�c Computing 2

  3. Disasters Problems Themes Deconstruction Ariane 5 explosion Cornell CS 322 Introduction to Scienti�c Computing 3

  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 ≥ 2 1 5 • Uncaught exception = ⇒ crash of guidance system Loss: 5 × 10 8 dollars (that's $25,856 as an int16 ) Cornell CS 322 Introduction to Scienti�c Computing 3

  5. Disasters Problems Themes Deconstruction Patriot anti-missile system failure Cornell CS 322 Introduction to Scienti�c Computing 4

  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 Scienti�c Computing 4

  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 Scienti�c Computing 4

  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 Scienti�c Computing 5

  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 Scienti�c Computing 6

  10. Disasters Problems Themes Deconstruction Standard types of problems • Optimization ◦ nonlinear practically everything ◦ constrained spacetime constraints ◦ linear programming economics • Integration ◦ de�nite integrals (quadrature) lighting ◦ differential equations ◮ initial value problem mechanical systems ◮ boundary value problem ordinary: hanging chain cloth, �uids Cornell CS 322 Introduction to Scienti�c Computing 6

  11. Disasters Problems Themes Deconstruction Types of methods • Direct (�xed sequence of operations leads to an answer�number of steps is predetermined) • Iterative (repeatedly re�ne an approximation until some accuracy goal is reached�number of steps variable) • Probabilistic (approximate the answer by some computation based on a number of stochastic �experiments�) Cornell CS 322 Introduction to Scienti�c Computing 7

  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 Scienti�c Computing 8

  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 Scienti�c Computing 9

  14. Disasters Problems Themes Deconstruction Themes of CS322 • iterative approximation ◦ convergence (guarantees) ◦ convergence (rate) • ef�ciency ◦ computational complexity ◦ effective use of linear algebra libraries • applications • visualization • direct vs. iterative methods • linear vs. nonlinear problems Cornell CS 322 Introduction to Scienti�c Computing 9

  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       a 11 a 12 a 13 x 1 b 1  = a 21 a 22 a 23 x 2 b 2      a 31 a 32 a 33 x 3 b 3 This 3 × 3 example can serve to de�ne 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 Scienti�c Computing 10

  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:       a 11 a 12 a 13 x 1 b 1  = a 21 a 22 a 23 x 2 b 2      a 31 a 32 a 33 x 3 b 3 3 � for i = 1 , 2 , 3 b i = a ij x j j =1 Cornell CS 322 Introduction to Scienti�c Computing 11

  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:       · · · a 11 a 1 n x 1 b 1 . . . . ... . . . .  . .   .   =  .       · · · a n 1 a nn x n b n n � for i = 1 , . . . , n b i = a ij x j j =1 Cornell CS 322 Introduction to Scienti�c Computing 11

  18. Disasters Problems Themes Deconstruction Deconstructing a matrix-vector product dot product A matrix-vector product is shorthand for dot products with the rows:       a 11 a 12 a 13 x 1 b 1  = a 21 a 22 a 23 x 2 b 2      a 31 a 32 a 33 x 3 b 3  � r 1 �   |   r 1 · x    b 1  � r 2 �   =  = x r 2 · x b 2         | r 3 · x b 3 � r 3 � for i = 1 , 2 , 3 b i = r i · x Cornell CS 322 Introduction to Scienti�c Computing 12

  19. Disasters Problems Themes Deconstruction Deconstructing a matrix-vector product dot product A matrix-vector product is shorthand for dot products with the rows:       · · · a 11 a 1 n x 1 b 1 . . . . ... . . . .  . .   .   =  .       · · · a n 1 a nn x n b n  � r 1 �      r 1 · x b 1  |  . . .   . . .  = x . .  = .             |   r n · x b n � r n � for i = 1 , . . . , n b i = r i · x Cornell CS 322 Introduction to Scienti�c Computing 12

  20. Disasters Problems Themes Deconstruction Deconstructing a matrix-vector product linear combination A matrix-vector product is shorthand for a linear combination of columns:       a 11 a 12 a 13 x 1 b 1  = a 21 a 22 a 23 x 2 b 2      a 31 a 32 a 33 x 3 b 3       | | | x 1 |  = c 1 c 2 c 3 x 2 b      | | | | x 3 b = x 1 c 1 + x 2 c 2 + x 3 c 3 Cornell CS 322 Introduction to Scienti�c Computing 13

  21. Disasters Problems Themes Deconstruction Deconstructing a matrix-vector product linear combination A matrix-vector product is shorthand for a linear combination of columns:       a 11 · · · a 1 n x 1 b 1 . . . . ... . . . . . . .  = .            a n 1 · · · a nn x n b n   x 1  | |   |  . . · · · c 1 c n .  = b        | | | x n n � b = x j c j j =1 Cornell CS 322 Introduction to Scienti�c Computing 13

Recommend


More recommend