Professional Documents
Culture Documents
Semana - 1 - Calculo Numerico II - PGRA
Semana - 1 - Calculo Numerico II - PGRA
IF-392
Semana 01
Dr. Pierre Giovanny Ramos Apestegui
problem.
• Review to ODEs.
• Taylor series methods.
d v2
u u 2 2
+ 6tv = 1 − 2 =0
dt 2 y 2
x
involve one or more involve one or more
Ordinary derivatives of partial derivatives of
unknown functions unknown functions
dv c
= 9.8 − v
dt M
M : mass
c : drag coefficient
v : velocity
Cálculo Numérico II-IF392
Definitions
Ordinary
differential
equation
dv c
= 9.8 − v
dt M
dv c
= 9.8 − v (Dependent
dt M variable)
unknown
function to be
determined
dv c
= 9.8 − v
dt M
(independent variable)
the variable with respect to which
other variables are differentiated
Examples :
dx(t )
− x(t ) = et First order ODE
dt
d 2 x(t ) dx(t )
2
−5 + 2 x(t ) = cos(t ) Second order ODE
dt dt
3
d x(t )
2
dx(t )
2
− + 2 x 4 (t ) = 1 Second order ODE
dt dt
Cálculo Numérico II-IF392
Linear ODE
An ODE is linear if The unknown function and its
derivatives appear to power one No product of the
unknown function and/or its derivatives
Examples :
dx(t )
− x(t ) = et
dt Linear ODE
d 2 x(t ) dx(t )
2
− 5 + 2t 2
x(t ) = cos(t ) Linear ODE
dt dt
3
d x(t ) dx(t )
2
Non-linear ODE
2
− + x(t ) = 1
dt dt
d 2 x (t )
+ 4 x (t ) = 0 Second order ODE
dt 2
x ( 0) = a Two conditions are needed
x (0) = b to uniquely specify the
solution
Auxiliary Conditions
All conditions are at one point • The conditions are not at one point
of the independent variable of the independent variable
The auxiliary conditions are at • The auxiliary conditions are not at one
one point of the independent point of the independent variable
variable • More difficult to solve than initial
value problems
Numerical Solutions
• Numerical methods are used to obtain a graph or a
table of the unknown function.
• Most of the Numerical methods used to solve ODEs
are based directly (or indirectly) on the truncated
Taylor series expansion.
Cálculo Numérico II-IF392
Classification of the Methods
Numerical Methods
for Solving ODE
dy( x)
= f ( x, y ), y ( x0 ) = y0
dx
Estimates of the solution at different base points:
dy h2 d 2 y hn d n y
y ( x0 ) + h + 2
+ ... +
dx x = x0 ,
y= y
2! dx x = x0 , n! dx n x = x0 ,
0 y = y0 y = y0
The nth order Taylor series method uses the nth order
Truncated Taylor series expansion.
dy
y ( x0 + h) = y ( x0 ) + h + O(h 2 )
dx x = x0 ,
y = y0
Notation :
xn = x0 + nh, yn = y ( xn ),
dy
= f ( xi , yi )
dx x = xi ,
y = yi
Euler Method
yi +1 = yi + h f ( xi , yi )
Euler Method :
y0 = y ( x0 )
yi +1 = yi + h f ( xi , yi ) for i = 1,2,...
y1
y0
x0 x1 x2 x
Slope=f(x0,y0)
y1
y1=y0+hf(x0,y0)
hf(x0,y0)
y0
x0 x1 x2 x
h
x0 x1 x2 x
h h
dy
= 1+ x ,
2
y (1) = −4
dx
to determine y(1.01), y(1.02) and y(1.03).
• We can use Taylor series to quantify the local truncation error in Euler’s method.
Given y' = f ( x , y ) f ( xi , yi ) 2
yi" 2 yi( n ) n Ea = h + R3
yi +1 = yi + y h +
'
i h + ... + h + Rn 2!
2! n!
f ( n−1) ( x i , yi ) n
f ( xi , yi ) 2
yi +1 = yi + f ( x i , yi )h +
f ' ( x i , yi ) 2
h + ... + h + O( hn+1 ) Ea h = O(h 2 )
2! n! 2!
EULER Local Truncation ERROR
dx 2! dx
2
d y
2
needs to be derived analytically.
dx
Cálculo Numérico II-IF392
Third Order Taylor Series Methods
dy ( x)
Given = f ( y, x), y ( x0 ) = y0
dx
Third order Taylor Series method
2 2 3 3
dy h d y h d y
yi +1 = yi + h + 2
+ 3
+ O(h )
4
dx 2! dx 3! dx
2 3
d y d y
2
and 3 need to be derived analytically.
dx dx
Cálculo Numérico II-IF392
High Order Taylor Series Methods
dy ( x)
Given = f ( y, x), y ( x0 ) = y0
dx
th
n order Taylor Series method
dy h 2 d 2 y hn d n y n +1
yi +1 = yi + h + 2
+ .... + n
+ O(h )
dx 2! dx n! dx
2 3 n
d y d y d y
2
, 3 ,....., n need to be derived analytically.
dx dx dx
Graphical comparison of the errors of the Euler method and the Taylor method of
order 2. Cálculo Numérico II-IF392
Example 2
Second order Taylor Series Method
2
d x(t )
What is : 2
?
dt
2
Cálculo Numérico II-IF392
Example 2
f (t , x) = 1 − 2 x 2 − t , t0 = 0, x0 = 1, h = 0.01
2
h
xi +1 = xi + h(1 − 2 xi − ti ) + ( − 1 − 4 xi (1 − 2 xi − ti ))
2 2
2
Step1 :
x1 = 1 + 0.01(1 − 2(1) 2
− 0) +
(0.01)
2
(−1 − 4(1)(1 − 2 − 0)) = 0.9901
2
Step 2 :