CS3220 - Introduction to Scientific Computing Summer 2008 Jonathan Kaldor 1
Overview • Course Mechanics • What is scientific computing anyways? • MATLAB refresher 2
Course Mechanics • See syllabus • Homeworks • Exams • Grading • TA: Jesse Simons 3
Scientific Computing • a.k.a. numerical analysis, a.k.a. numerical methods... • Different things to different people 4
Scientific Computing • Pedantic definition: use of computers to support other sciences • Analysis of data • Model Generation • ... but not entirely 5
Scientific Computing • Another definition: intersection of analytical math with applied computer science • How to solve (or approximate) answers to problems in • linear algebra • calculus • differential equations 6
Scientific Computing • In reality, combination of the two • Given a problem (maybe, but not always, motivated by other scientific fields)... • ... determine the methods needed to solve the problem... • ... and understand how to implement the solutions efficiently on a computer 7
Scientific Computing • “But don’t we already know how to solve those problems?” 8
Why it is important • Yes, but the computer adds its own peculiarities • Floating point numbers introduce additional error • Running time important 9
Floating Point Numbers • In math, numbers have as much precision as needed • On computers, numbers have a finite precision • e.g. π versus 3.141592 • Leads to accumulation of error • 1e-10 + 1e10 = ??? 10
Floating Point Numbers • In math, zero is well-defined and distinct • In floating point, imprecision leads to uncertainty • Result of computation is 1e-15 ... is it actually zero? 11
Floating Point Numbers (a real life example) • As part of research, needed to solve cubic equation • detect collisions between two triangles as they move over time • Quadratic formula for quadratics, no closed-form solution for quartics • For cubics, though... 12
Floating Point Numbers (a real life example) 13
Floating Point Numbers (a real life example) • Implemented closed form solution for cubics... 13
Floating Point Numbers (a real life example) • Implemented closed form solution for cubics... • ... and it worked!... 13
Floating Point Numbers (a real life example) • Implemented closed form solution for cubics... • ... and it worked!... • ... well, almost all of the time 13
Floating Point Numbers (a real life example) • So what happened? • Method was unstable - accumulation of floating point error in method meant answers were not exact • ... and it was just large enough to occasionally miss 14
Conditioning • Another example: in linear algebra, n x n matrices are either singular (not invertible) or non-singular (invertible) • In scientific computing, third option: ill- conditioned (nearly-singular) • matrix is technically non-singular, but close enough that inverse cannot be computed with good accuracy 15
This Course • Study types of problems, methods of solution • Emphasis on: • Problem recognition • How each method works • How things can go wrong 16
This Course • Additional goals: • Efficient code • Being able to discuss sources of error • MATLAB plotting tools • Identifying easy / hard problems 17
Course Topics (List) • Linear Systems • Linear Fitting • Interpolation • Root finding / optimization • Differential Equations 18
Course Topics (Visually) [see http://www.graphics.cornell.edu/~jmkaldor/caf-scarf-2-h264-960-24.mov ] 19
Recommend
More recommend