Top Banner
CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering http://www.engr.uconn.edu/~jinbo 1
32

CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

Jan 13, 2016

Download

Documents

Doris Hubbard
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

CSE 3802 / ECE 3431

Numerical Methods in Scientific Computation

Jinbo BiDepartment of Computer Science & Engineering

http://www.engr.uconn.edu/~jinbo

1

Page 2: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

The Instructor• Ph.D in Mathematics

• Previous professional experience:

– Siemens Medical Solutions Inc.

– Department of Defense, Bioanalysis

• Research interests: biomedical informatics, machine learning, data mining, optimization, mathematical programming,

• Apply machine learning techniques in biological data, medical image analysis, patient health records analysis

• Homepage is at http://www.engr.uconn.edu/~jinbo

2

Page 3: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

Numerical Methods,Lecture 1 3

• Lectures are Tuesday and Thursday, 12:30 –1:45 pm

• No specific lab time, but significant computer time expected.

• Computers are available in ITEB C25 and C27.

Class Meetings

Prof. Jinbo Bi CSE, UConn

Page 4: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

4

• Homework will be assigned once every week or two and due usually the following week.

• You may collaborate on the homework, but your submissions should be your own work.

• Grading:• Homework 30%• Exam 1 and 2 40%• Final Exam 30%

Class Assignments

Numerical Methods Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 5: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

5

• MATH 2110Q Multivariate Calculus• Taylor series

• MATH 2410Q Introduction to Differential Equations • Integration

• MATH 2210 Linear Algebra• Equation systems

Mathematical Background

Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 6: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

6

• Languages to be used:• Matlab, C, C++

• CSE 1100/1010 programming experience

• Any OS is acceptable

Computer Background

Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 7: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

7

• Go over the course syllabus• Course website

http://www.engr.uconn.edu/~jinbo/Fall2013_Numerical_Methods.htm

Syllabus

Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 8: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

8

Today’s Class:

• Introduction to numerical methods• Basic content of course and class

expectations• Mathematical modeling

Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 9: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

9

Introduction

• What are numerical methods?• “… techniques by which mathematical

problems are formulated so that they can be solved with arithmetic operations.” (Chopra and Canale)

• What type of mathematical problems?• Roots, Integration, Optimization, Curve

Fitting, Differential Equations, and Linear Systems

Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 10: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

Introduction

• How do you solve these difficult mathematical problems?

• Example: What are the roots of x2-7x+12?

• Three general non-computer methods• Analytical• Graphical• Manual

10Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 11: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

• This is what you learned in math class• Gives exact solutions• Example:

• Roots at 3 and 4

• Not always possible for all problems and usually restricted to simple problems with few variables or axes

• The real world is more complex than the simple problems in math class

Analytical Solutions

)4)(3(1272 xxxx

11Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 12: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

Graphical Solution

12Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 13: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

• Using pen and paper, slide rulers, etc. to solve an engineering problem

• Very time consuming• Error-prone

Manual Solution

13Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 14: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

Numerical Methods

• What are numerical methods?• “… techniques by which mathematical

problems are formulated so that they can be solved with arithmetic operations.” (Chopra and Canale)

• Arithmetic operations map into computer arithmetic instructions

• Numerical methods allow us to formulate mathematical problems so they can be solved numerically (e.g., by computer)

14Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 15: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

• What is this course about?• Using numerical methods to solve

mathematical problems that arise in engineering

• Most of the focus will be on engineering problems

Course Overview

15Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 16: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

• Introduction• Programming• Mathematical Modeling• Error Analysis

• Mathematical Problems• Roots, Linear Systems, Integration,

Optimization, Curve Fitting, Differential Equations

Basic Materials

16Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 17: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

A mathematical model is the formulation of a physical or engineering system in mathematical terms.

• Empirical• Theoretical

Mathematical Modeling

17Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 18: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

Mathematical Modeling

18Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

• A mathematical model is represented as a functional relationship of the form

Dependent independent forcingVariable = f variables, parameters, functions

• Dependent variable: Characteristic that usually reflects the state of the system

• Independent variables: Dimensions such as time and space along which the systems behavior is being determined

• Parameters: reflect the system’s properties or composition• Forcing functions: external influences acting upon the system

Page 19: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

A simple example:• In an electrical circuit, I = V/R; The

current, I, is dependent on resistance parameter, R, and forcing voltage function, V.

Mathematical Modeling

19Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 20: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

Example 1

20Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

• Newton’s 2nd low of Motion states that “the time rate change of momentum of a body is equal to the resulting force acting on it.”

• The model is formulated as

F = m a

F=net force acting on the body (N)

m=mass of the object (kg)

a=its acceleration (m/s2)

Page 21: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

• What is the velocity of a falling object?• First step is to model the system• Newton’s second law

• Total force is gravity and air resistance

Example 1

m

F

dt

dv

m

FamaF

cvmgFFF AirGravity

21Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 22: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

• First order differential equation• Analytical solution

Example 1

vm

cg

m

cvmg

m

F

dt

dv

)1()( tmc

ec

gmtv

22Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 23: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

• m=68.1kg, c=12.5 kg/s

Example 1

23Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 24: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

• What if we can’t find an analytical solution?

• How do you get a computer to solve the differential equation?

• Use numerical methods

Example 1

24Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 25: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

• Use the finite divided difference approximation of the derivative

• The approximation becomes exact as Δt → 0

Euler’s Method

ii

ii

tt

tvtv

dt

dv

1

1 )()(

25Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 26: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

• Using Euler’s method, we can approximate the velocity curve

Euler’s Method

)()()(

1

1i

ii

ii tvm

cg

tt

tvtv

dt

dv

)()()()( 11 iiiii tv

m

cgtttvtv

26Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 27: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

• Assume Δt=2

Euler’s Method

0)0( v

6.19)0(2)0()2(

v

m

cgvv

0.32)2(2)2()4(

v

m

cgvv

……

27Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 28: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

Euler’s method

28Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 29: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

• Avoids solving differential equation• Not an exact formula of the function• Gets more exact as Δt→0• How do we choose Δt? Dependent on

the tolerance of error.• How do we estimate the error?

Euler’s Method

29Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 30: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

Overview of the problems

30Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 31: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

Overview of the problems

31Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn

Page 32: CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation Jinbo Bi Department of Computer Science & Engineering jinbo.

Next class

• Programming and Software• Read Chapters 1 & 2

32Numerical Methods, Lecture 1

Prof. Jinbo Bi CSE, UConn