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

Post on 16-May-2018

307 views 7 download

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

Numerical Methods

林文杰 Wen-Chieh LinAssistant Professor

Department of Computer Science andInstitute of Multimedia Engineering

Numerical Methods © Wen-Chieh Lin 2

Introduction

AdministrationAbout meCourse overview

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:劉政旻

proof.liu@gmail.comEC 512, ext. 54787

黃怡錚sayhello.cs96g@g2.nctu.edu.twEC229B, ext. 56675

Numerical Methods © Wen-Chieh Lin 4

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

Gerald & Wheatley, Addison-Wesley.

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

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%)

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

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

Numerical Methods © Wen-Chieh Lin 9

Near-regular TextureAnalysis and Manipulation

Numerical Methods © Wen-Chieh Lin 10

Dynamic Near-regular TextureTracking and Replacement

visibility map

Numerical Methods © Wen-Chieh Lin 11

Application: Superimposition with Occlusion

Numerical Methods © Wen-Chieh Lin 12

Dynamic Texture Replacement—underwater texture

Numerical Methods © Wen-Chieh Lin 13

Physics-based Animation

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.

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

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

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”!

Numerical Methods © Wen-Chieh Lin 18

Course OverviewApproximation and errors Solving nonlinear equations

Solving sets of equations

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

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

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

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

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

Numerical Methods © Wen-Chieh Lin 24

Simulated Flames

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

Numerical Methods © Wen-Chieh Lin 25

Simulated Water

Nick Foster and Ronald Fedkiw, SIGGRAPH 2001

Numerical Methods © Wen-Chieh Lin 26

Simulated Cloth

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

Numerical Methods © Wen-Chieh Lin 27

Simulated Deformable Object

Doug James & Dinesh Pai, SIGGRAPH 2002

Numerical Methods © Wen-Chieh Lin 28

Questions?