Sie sind auf Seite 1von 22

Universidad Nacional de Ingeniería

Facultad de Ciencias
Maestría en Ciencia de la Computación

Cálculo Numérico II
IF392

Cap1: Introducción

Prof: J. Solano
Bibliografía:

2
Bibliografía:
Introduction to Numerical Methods

 What are NUMERICAL METHODS?


 Why do we need them?
 Topics covered in this course.
Numerical Methods
Numerical Methods:
Algorithms that are used to obtain numerical
solutions of a mathematical problem.

Why do we need them?


1. No analytical solution exists,
2. An analytical solution is difficult to obtain or not
practical.
Outlines of the Course
• Error, Taylor Theorem • Numerical Integration
• Solution of nonlinear • Numerical Differentiation
Equations • Solution of ordinary
• Solution of a System of differential equations
nonlinear Equations • Solution of Partial
• Solution of linear differential equations
Equations.
• Least Squares curve fitting
• Interpolation
Solution of Nonlinear Equations
• Some simple equations can be solved analytically:

x2  4x  3  0
4 4 2  4(1)(3)
Analytic solution roots 
2(1)
x  1 and x  3

• Many other equations have no analytical solution:

x 9  2 x 2  5  0

x  No analytic solution
xe 

Methods for Solving Nonlinear Equations

• Bisection Method

• Newton-Raphson Method

• Secant Method
SystemsSystems
of Nonlinear Equations
of Nonlinear Equations
Locate the roots of a set of simultaneous nonlinear equations:

f1 ( x1 , x2 , x3 ,  , xn )  0
f 2 ( x1 , x2 , x3 , , xn )  0

f n ( x1 , x2 , x3 , , xn )  0
Example:
x12  x1 x2  10  f1 ( x1 , x2 )  x12  x1 x2  10  0
x2  3 x1 x2 2  57  f 2 ( x1 , x2 )  x2  3 x1 x2 2  57  0
Solution of Systems of Linear Equations
x1  x2  3
x1  2 x2  5
We can solve it as :
x1  3  x2 , 3  x2  2 x2  5
 x2  2, x1  3  2  1
What to do if we have
1000 equations in 1000 unknowns.
Cramer’s Rule is Not Practical
Cramer' s Rule can be used to solve the system :
3 1 1 3
5 2 1 5
x1   1, x2  2
1 1 1 1
1 2 1 2

But Cramer' s Rule is not practical for large problems.


To solve N equations with N unknowns, we need (N  1)(N  1)N!
multiplica tions.
To solve a 30 by 30 system, 2.3 1035 multiplica tions are needed.
A super computer needs more than 10 20 years to compute this.
Methods for Solving Systems of Linear
Equations
• Naive Gaussian Elimination

• Gaussian Elimination with Scaled Partial Pivoting

• Algorithm for Tri-diagonal Equations


Curve Fitting: Least Squares curve fitting

• Given a set of data:

• Select a curve that best fits the data. One choice is to find
the curve so that the sum of the square of the error is
minimized.
Interpolation
• Given a set of data:

• Find a polynomial P(x) whose graph passes through all


tabulated points.

yi  P( xi ) if xi is in the table
Methods for Curve Fitting and
Interpolation
• Least Squares
o Linear Regression
o Nonlinear Least Squares Problems

• Interpolation
o Newton Polynomial Interpolation
o Lagrange Interpolation
Integration
• Some functions can be integrated analytically:

3 3
1 2 9 1
1 xdx  2 x 1  2  2  4
But many functions have no analytical solutions :
a

e
x2
dx  ?
0
Methods for Numerical Integration

• Trapezoid Method.
• Simpson Method.

• Romberg Method.
• Gauss Quadrature
Numerical Differentiation
Solution of Ordinary Differential
Equations (EDO)
A solution t o the differenti al equation :
x(t )  3 x (t )  3 x(t )  0
x (0)  1; x(0)  0
is a function x(t) that satisfies the equations.

* Analytical solutions are available for


special cases only.
Solution of Partial Differential Equations

Partial Differential Equations are more difficult to solve


than ordinary differential equations:

2 2
 u  u
2
 2
20
x t
u (0, t )  u (1, t )  0, u ( x,0)  sin(x)
Summary
Topics Covered in the Course
• Numerical Methods:
• Solution of Nonlinear Equations
Algorithms that are used
to obtain numerical • Solution of Linear Equations
solution of a mathematical • Curve Fitting
problem. • Least Squares
• We need them when • Interpolation
No analytical solution • Numerical Integration
exists or it is difficult to
obtain it. • Numerical Differentiation
• Solution of Ordinary Differential
Equations

Das könnte Ihnen auch gefallen