Numerical Methods Objective

19 downloads 222 Views 45KB Size Report
Mar 30, 2009 ... Why Numerical Methods? • Example: ... Applied Numerical Analysis: Gerald & Wheatley. – Numerical Methods for Engineers: Chapra & Canale.
CE 205

Numerical Methods Dr. Charisma Choudhury Lecture 1 March 30, 2009

Objective • Some of the analysis methods you have used so far.. – Algebra – Calculus – Differential Equations etc.

• Often not possible to determine analytical solution – Complex calculation – Sheer size of problem

1

Why Numerical Methods? • Example: – No closed form solution • Length of one half of the curve y = sin(x): π



1 + cos 2 ( x) dx

0

– Large matrices

• Computer is not so smart – Need to break the problem to simple mathematical problems • Add, subtract, multiply, divide, compare

• Practical considerations – Example: Length of a board derived by solving equation: x 3 - x 2 - 3x + 3=0 • How accurately can we measure for practical applications?

Course Outline • Numerical solution of algebraic and transcendental equations • Solution of systems of linear equations • Linear and non-linear curve-fitting by least square regression • Finite differences • Divided differences • Interpolation • Numerical differentiation and integration • Numerical solution of differential equations

2

Course Outline • Numerical solution of algebraic and transcendental equations • Solution of systems of linear equations • Linear and non-linear curve-fitting by least square regression • Finite differences • Divided differences • Interpolation • Numerical differentiation and integration • Numerical solution of differential equations

Lecture Plan • Algebraic and transcendental equations • Curve-fitting • Differential equations • CE applications and review

5 classes 3 classes 4 classes 1 class

3

References • Any standard undergraduate textbook on Numerical Methods • Some examples: – – – –

Numerical Analysis: Goel & Mittal Applied Numerical Analysis: Gerald & Wheatley Numerical Methods for Engineers: Chapra & Canale Introductory Methods of Numerical Analysis: Sastry

Grading Policy • 3 quizzes • Tentatively on 5th, 9th and 12th class – Or maybe one computer programming assignment? – The last one is only a make-up quiz/assignment

4

Approach • Often multiple methods for solving same problem – Which is the most relevant method? • • • • •

Examine the problem What inputs do we have? What accuracy do we need? What is the computational burden? What is the rate of convergence?

Errors in Numerical Methods • • • •

Error in original data/measurement error Truncation error: ex=1+ x/1! + x 2/2!+ … Round-off error: 1/3, π etc. Calculations errors – significant digits

5

Errors • Abs error = |true-apprx| – Relative= abs error /true • 5000+/-0.10 • 0.005+/-0.1

– True=10/3, apprx = 3.333 – Abs=1/3000 – Rel=1/10000

• Significant digits 4

Algebraic and Transcendental Equations • Algebraic: y =ax+b • Transcendental: y = a sinx+b cosx

6

Solution Methods • • • • • •

Bisection/ Half-interval Search Method of false position/Regula Falsi Secant Method Newton Raphson Iteration Method Many more…

Choice of Method Depends on .. • Required accuracy • Rate of convergence • Inputs – How does initial approximation affect the computation?

• Often combination of multiple methods is the optimum

7

Bisection/ Half-interval Search • Background: – Lessons from Graphical approach • Solve: f(x)=0 – Let y=f(x) – Take a set of rectangular coordinates within a range (say xL and xU) – Plot – Root(s): the point(s) where y crosses x

Background • Different variations (Examples shown in next page) – Single root – Multiple roots – No root within specified range

8

1 root

no roots

3 roots

2 roots

Background • Observations – If f(xl) and f(xU) have opposite signs • Odd number of roots in between

– If f(xl) and f(xU) have same signs • Zero/even number of roots in between

• Exceptions – Discontinuous function

9

Discontinuous Function

Deductions • If f(x) is – continuous between xL and xU and – f(xl) * f(xU)