Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical...

28
Numerical Methods 林文杰 Wen-Chieh Lin Assistant Professor Department of Computer Science and Institute of Multimedia Engineering

Transcript of Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical...

Page 1: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods

林文杰 Wen-Chieh LinAssistant Professor

Department of Computer Science andInstitute of Multimedia Engineering

Page 2: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 2

Introduction

AdministrationAbout meCourse overview

Page 3: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 3

AdministrationCourse web

http://caig.cs.nctu.edu.tw/course/NM

Office hoursEC707, Wed 3:30—5:00 PM

TA:劉政旻

[email protected] 512, ext. 54787

黃怡錚[email protected], ext. 56675

Page 4: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 4

Textbook Applied Numerical Analysis, 7th ed. (2004), by

Gerald & Wheatley, Addison-Wesley.

Page 5: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 5

References

Applied Numerical Methods with MATLAB forEngineers and Scientists, (2005), by S. C.Chapra, McGraw-Hill.

Scientific Computing: An Introductory Survey,2nd Ed. (2002), by Michael Heath, McGraw-Hill

Numerical Recipes in C++, 2nd Ed. (2002) byWilliam H. Press, Saul A. Teukolsky, WilliamT. Vetterling, Brian P. Flannery, CambridgeUniversity Press

Page 6: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 6

Perquisites and Grading

PerquisitesCalculusLinear algebra

Assignments (40%)Written homeworkMATLAB programmingQuiz (depending on class attendance)

Midterm exam (30%) Final exam (30%)

Page 7: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 7

Late and Cheating Policies

Turn in assignments on the class of the duedate

Penalty of 10% of the value of theassignment/day

0 points for any cheating on assignments ortest

Page 8: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 8

About me

Ph.D. in Robotics, School of CS, CMUTexture synthesis, replacement and trackingPhysics-based animation

M.S. & B.S. in Control Eng., NCTU Join NCTU in March 2006

Page 9: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 9

Near-regular TextureAnalysis and Manipulation

Page 10: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 10

Dynamic Near-regular TextureTracking and Replacement

visibility map

Page 11: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 11

Application: Superimposition with Occlusion

Page 12: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 12

Dynamic Texture Replacement—underwater texture

Page 13: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 13

Physics-based Animation

Page 14: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 14

What is this course about?

This is not a course to teach you to code. This is a course to teach you computer

algorithms for analyzing and solving scienceand engineering problems in numerical ways.

Page 15: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 15

Numerical Analysis/Methods

What is numerical analysis/method?Analysis and design of algorithms for numerically

solving mathematical problems in science andengineering

Why do we care about numerical analysis?Simulation of real-world phenomena and eventsVirtual prototyping of engineering designs

Page 16: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 16

Analysis vs. Numerical Analysis

Consider solvingAnalytically, we know that is a root of the

equationNumerically, how do we find the root of the

equation using a computer program?Computer can only do arithmetic operationsDesign a procedure consisting of only

arithmetic operations to find the root

22 x2

Page 17: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 17

Numerically Solving

99515625.14125.1

030625.2425.1

1025.245.1

96.14.1

25.25.1

2

2

2

2

2

Too large

Too small

A bit closer

Close

Pretty close

22 x

This is actually a root finding methodcalled “Bisection”!

Page 18: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 18

Course OverviewApproximation and errors Solving nonlinear equations

Solving sets of equations

Page 19: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 19

Course Overview (cont.) Interpolation and curve

fittingFind intermediate values

from a table of dataFit curves to data If the curve passes all

data points, we call itinterpolation.

Interpolation

Page 20: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 20

Course Overview (cont.)Approximation of functions

with polynomials or ratio of polynomials

Numerical differentiation and integration approximate derivative values of a function approximate definite integral, even when no

analytical form exists

Numerical solution of ordinary differentialequations

Optimization

Page 21: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 21

Applications of Numerical Methods

Computer graphics—root finding,interpolation, curve fitting, optimization, ODEsolver, PDE solver, finite element methodPhysics-based animationGeometry modeling

Computer vision—optimization, curve fitting,linear equationsStereo visionShape from shading

Page 22: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 22

Applications of Numerical Methods (cont.)

Machine learning—curve fitting, linearequations, function approximationPattern recognitionNeural network

Simulation for prototyping—ODE solver, PDEsolver, optimization, numerical integration,interpolation, finite element methodCircuit designMechanical designCAD/CAM

Page 23: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 23

Examples in Physics-based Animation

Generate motion based on physical laws (e.g.,Newton’s laws, Fluid dynamics)

Simulated physical phenomena gravity momentum collision friction fluid flow (liquid, gas, turbulence) flexibility, elasticity fracture

Page 24: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 24

Simulated Flames

Duc Quang Nguyen, Ronald Fedkiw and Henrik Wann Jensen,SIGGRAPH 2003

Page 25: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 25

Simulated Water

Nick Foster and Ronald Fedkiw, SIGGRAPH 2001

Page 26: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 26

Simulated Cloth

Kwang-Jin Choi and Hyeong-Seok Ko, SIGGRAPH 2002

Page 27: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 27

Simulated Deformable Object

Doug James & Dinesh Pai, SIGGRAPH 2002

Page 28: Numerical Methods - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/NM/Intro.pdf · Applied Numerical Methods with MATLAB for Engineers and Scientists, (2005), by S. C. Chapra, McGraw-Hill.

Numerical Methods © Wen-Chieh Lin 28

Questions?